home *** CD-ROM | disk | FTP | other *** search
- package javax.sound.midi;
-
- import java.io.ByteArrayInputStream;
- import java.io.DataInputStream;
- import java.io.IOException;
-
- public abstract class MidiMessage implements Cloneable {
- protected byte[] data;
- protected int length = 0;
-
- protected MidiMessage(byte[] var1) {
- this.data = var1;
- this.length = var1.length;
- }
-
- protected void setMessage(byte[] var1, int var2) throws InvalidMidiDataException {
- this.length = var2;
- if (this.data.length < this.length) {
- this.data = new byte[this.length];
- }
-
- System.arraycopy(var1, 0, this.data, 0, var2);
- }
-
- public byte[] getMessage() {
- byte[] var1 = new byte[this.length];
- System.arraycopy(this.data, 0, var1, 0, this.length);
- return var1;
- }
-
- public int getStatus() {
- int var1 = 0;
-
- try {
- ByteArrayInputStream var2 = new ByteArrayInputStream(this.data, 0, this.length);
- DataInputStream var3 = new DataInputStream(var2);
- var1 = var3.readUnsignedByte();
- } catch (IOException var4) {
- }
-
- return var1;
- }
-
- public int getLength() {
- return this.length;
- }
-
- public abstract Object clone();
- }
-