FileDocCategorySizeDatePackage
MidiMessage.javaAPI DocAndroid 1.5 API2131Wed May 06 22:41:02 BST 2009javax.sound.midi

MidiMessage

public abstract class MidiMessage extends Object implements Cloneable

Fields Summary
protected byte[]
data
protected int
length
Constructors Summary
protected MidiMessage(byte[] data)

        if (data == null) {
            length = 0;
        } else {
            length = data.length;
            this.data = data;
        }
    
Methods Summary
public abstract java.lang.Objectclone()

public intgetLength()

        return length;
    
public byte[]getMessage()

        if (data == null) {
            throw new NullPointerException();
        }
        return data.clone();
    
public intgetStatus()

        if ((data == null) || (length == 0)) {
            return 0;
        }
        return data[0] & 0xFF;
    
protected voidsetMessage(byte[] data, int length)

        if ((length < 0) || (length > data.length)) {
            // sound.03=length out of bounds: {0}
            throw new IndexOutOfBoundsException(Messages.getString("sound.03", length)); //$NON-NLS-1$
        }

        this.data = new byte[length];
        if (length != 0) {
            for (int i = 0; i < length; i++) {
                this.data[i] = data[i];
            }
        }
        this.length = length;