home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / sound / midi / MidiMessage.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  917 b   |  50 lines

  1. package javax.sound.midi;
  2.  
  3. import java.io.ByteArrayInputStream;
  4. import java.io.DataInputStream;
  5. import java.io.IOException;
  6.  
  7. public abstract class MidiMessage implements Cloneable {
  8.    protected byte[] data;
  9.    protected int length = 0;
  10.  
  11.    protected MidiMessage(byte[] var1) {
  12.       this.data = var1;
  13.       this.length = var1.length;
  14.    }
  15.  
  16.    protected void setMessage(byte[] var1, int var2) throws InvalidMidiDataException {
  17.       this.length = var2;
  18.       if (this.data.length < this.length) {
  19.          this.data = new byte[this.length];
  20.       }
  21.  
  22.       System.arraycopy(var1, 0, this.data, 0, var2);
  23.    }
  24.  
  25.    public byte[] getMessage() {
  26.       byte[] var1 = new byte[this.length];
  27.       System.arraycopy(this.data, 0, var1, 0, this.length);
  28.       return var1;
  29.    }
  30.  
  31.    public int getStatus() {
  32.       int var1 = 0;
  33.  
  34.       try {
  35.          ByteArrayInputStream var2 = new ByteArrayInputStream(this.data, 0, this.length);
  36.          DataInputStream var3 = new DataInputStream(var2);
  37.          var1 = var3.readUnsignedByte();
  38.       } catch (IOException var4) {
  39.       }
  40.  
  41.       return var1;
  42.    }
  43.  
  44.    public int getLength() {
  45.       return this.length;
  46.    }
  47.  
  48.    public abstract Object clone();
  49. }
  50.