Lines Matching refs:length
73 * The length of the actual message in the data array.
76 * type byte, and the variable-length-int describing the
77 * length of the message.
100 * @param length an amount of bytes in the {@code data} byte array;
102 * {@code data.length}
110 public MetaMessage(int type, byte[] data, int length)
113 setMessage(type, data, length); // can throw InvalidMidiDataException
127 if (data.length>=3) {
128 dataLength=data.length-3;
130 while (pos<data.length && (data[pos] & 0x80)!=0) {
150 * @param length the number of bytes in the <code>data</code>
155 public void setMessage(int type, byte[] data, int length) throws InvalidMidiDataException {
160 if ((length > 0 && length > data.length) || length < 0) {
161 throw new InvalidMidiDataException("length out of bounds: "+length);
164 this.length = 2 + getVarIntLength(length) + length;
165 this.dataLength = length;
166 this.data = new byte[this.length];
169 writeVarInt(this.data, 2, length); // write the length as a variable int
170 if (length > 0) {
171 System.arraycopy(data, 0, this.data, this.length - this.dataLength, this.dataLength);
181 if (length>=2) {
192 * length data. The length of the data for the meta message is
193 * the length of the array. Note that the length of the entire
201 System.arraycopy(data, (length - dataLength), returnedArray, 0, dataLength);
212 byte[] newData = new byte[length];
213 System.arraycopy(data, 0, newData, 0, newData.length);
222 int length = 0;
225 length++;
227 return length;