< prev index next >
src/java.desktop/share/classes/javax/sound/midi/SysexMessage.java
Print this page
*** 38,58 ****
* flag.
* <p>
* As dictated by the Standard MIDI Files specification, two status byte values
* are legal for a {@code SysexMessage} read from a MIDI file:
* <ul>
! * <li>0xF0: System Exclusive message (same as in MIDI wire protocol)</li>
! * <li>0xF7: Special System Exclusive message</li>
* </ul>
* When Java Sound is used to handle system exclusive data that is being
* received using MIDI wire protocol, it should place the data in one or more
* {@code SysexMessages}. In this case, the length of the system exclusive data
* is not known in advance; the end of the system exclusive data is marked by an
* end-of-exclusive flag (0xF7) in the MIDI wire byte stream.
* <ul>
! * <li>0xF0: System Exclusive message (same as in MIDI wire protocol)</li>
! * <li>0xF7: End of Exclusive (EOX)</li>
* </ul>
* The first {@code SysexMessage} object containing data for a particular system
* exclusive message should have the status value 0xF0. If this message contains
* all the system exclusive data for the message, it should end with the status
* byte 0xF7 (EOX). Otherwise, additional system exclusive data should be sent
--- 38,58 ----
* flag.
* <p>
* As dictated by the Standard MIDI Files specification, two status byte values
* are legal for a {@code SysexMessage} read from a MIDI file:
* <ul>
! * <li>0xF0: System Exclusive message (same as in MIDI wire protocol)
! * <li>0xF7: Special System Exclusive message
* </ul>
* When Java Sound is used to handle system exclusive data that is being
* received using MIDI wire protocol, it should place the data in one or more
* {@code SysexMessages}. In this case, the length of the system exclusive data
* is not known in advance; the end of the system exclusive data is marked by an
* end-of-exclusive flag (0xF7) in the MIDI wire byte stream.
* <ul>
! * <li>0xF0: System Exclusive message (same as in MIDI wire protocol)
! * <li>0xF7: End of Exclusive (EOX)
* </ul>
* The first {@code SysexMessage} object containing data for a particular system
* exclusive message should have the status value 0xF0. If this message contains
* all the system exclusive data for the message, it should end with the status
* byte 0xF7 (EOX). Otherwise, additional system exclusive data should be sent
*** 146,156 ****
* @param data the system exclusive message data (without the status byte)
* @param length the length of the valid message data in the array; it
* should be non-negative and less than or equal to
* {@code data.length}
* @throws InvalidMidiDataException if the parameter values do not specify a
! * valid MIDI meta message
* @see #setMessage(byte[], int)
* @see #setMessage(int, byte[], int)
* @see #getData()
* @since 1.7
*/
--- 146,156 ----
* @param data the system exclusive message data (without the status byte)
* @param length the length of the valid message data in the array; it
* should be non-negative and less than or equal to
* {@code data.length}
* @throws InvalidMidiDataException if the parameter values do not specify a
! * valid MIDI system exclusive message
* @see #setMessage(byte[], int)
* @see #setMessage(int, byte[], int)
* @see #getData()
* @since 1.7
*/
*** 176,185 ****
--- 176,187 ----
* data array must be a valid system exclusive status byte (0xF0 or 0xF7).
*
* @param data the system exclusive message data
* @param length the length of the valid message data in the array,
* including the status byte
+ * @throws InvalidMidiDataException if the parameter values do not specify a
+ * valid MIDI system exclusive message
*/
@Override
public void setMessage(byte[] data, int length) throws InvalidMidiDataException {
int status = (data[0] & 0xFF);
if ((status != 0xF0) && (status != 0xF7)) {
*** 193,203 ****
*
* @param status the status byte for the message (0xF0 or 0xF7)
* @param data the system exclusive message data
* @param length the length of the valid message data in the array
* @throws InvalidMidiDataException if the status byte is invalid for a
! * sysex message
*/
public void setMessage(int status, byte[] data, int length) throws InvalidMidiDataException {
if ( (status != 0xF0) && (status != 0xF7) ) {
throw new InvalidMidiDataException("Invalid status byte for sysex message: 0x" + Integer.toHexString(status));
}
--- 195,205 ----
*
* @param status the status byte for the message (0xF0 or 0xF7)
* @param data the system exclusive message data
* @param length the length of the valid message data in the array
* @throws InvalidMidiDataException if the status byte is invalid for a
! * system exclusive message
*/
public void setMessage(int status, byte[] data, int length) throws InvalidMidiDataException {
if ( (status != 0xF0) && (status != 0xF7) ) {
throw new InvalidMidiDataException("Invalid status byte for sysex message: 0x" + Integer.toHexString(status));
}
< prev index next >