APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.media.sound

public final Class StandardMidiFileReader

Additional top-level class in compilation unit: SMFParser.

extends MidiFileReader
Class Inheritance
Imports
java.io.BufferedInputStream, .DataInputStream, .EOFException, .File, .FileInputStream, .IOException, .InputStream, java.net.URL, javax.sound.midi.InvalidMidiDataException, .MetaMessage, .MidiEvent, .MidiFileFormat, .MidiMessage, .Sequence, .SysexMessage, .Track, javax.sound.midi.spi.MidiFileReader

MIDI file reader.
Authors
Kara Kytle, Jan Borgersen, Florian Bomers

Field Summary

Modifier and TypeField and Description
private static final int
private static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public MidiFileFormat
getMidiFileFormat(InputStream stream)

Implements abstract javax.sound.midi.spi.MidiFileReader.getMidiFileFormat.

Obtains the MIDI file format of the input stream provided.

public MidiFileFormat
getMidiFileFormat(URL url)

Implements abstract javax.sound.midi.spi.MidiFileReader.getMidiFileFormat.

Obtains the MIDI file format of the URL provided.

public MidiFileFormat
getMidiFileFormat(File file)

Implements abstract javax.sound.midi.spi.MidiFileReader.getMidiFileFormat.

Obtains the MIDI file format of the File provided.

private MidiFileFormat
getMidiFileFormatFromStream(InputStream stream, int fileLength, SMFParser smfParser)

public Sequence
getSequence(InputStream stream)

Implements abstract javax.sound.midi.spi.MidiFileReader.getSequence.

Obtains a MIDI sequence from the input stream provided.

public Sequence
getSequence(URL url)

Implements abstract javax.sound.midi.spi.MidiFileReader.getSequence.

Obtains a MIDI sequence from the URL provided.

public Sequence
getSequence(File file)

Implements abstract javax.sound.midi.spi.MidiFileReader.getSequence.

Obtains a MIDI sequence from the File provided.

Field Detail

bisBufferSizeback to summary
private static final int bisBufferSize
MThd_MAGICback to summary
private static final int MThd_MAGIC

Constructor Detail

StandardMidiFileReaderback to summary
public StandardMidiFileReader()

Method Detail

getMidiFileFormatback to summary
public MidiFileFormat getMidiFileFormat(InputStream stream) throws InvalidMidiDataException, IOException

Implements abstract javax.sound.midi.spi.MidiFileReader.getMidiFileFormat.

Doc from javax.sound.midi.spi.MidiFileReader.getMidiFileFormat.

Obtains the MIDI file format of the input stream provided. The stream must point to valid MIDI file data. In general, MIDI file readers may need to read some data from the stream before determining whether they support it. These parsers must be able to mark the stream, read enough data to determine whether they support the stream, and, if not, reset the stream's read pointer to its original position. If the input stream does not support this, this method may fail with an IOException.

Annotations
@Override
Exceptions
InvalidMidiDataException:
if the stream does not point to valid MIDI file data recognized by the system
IOException:
if an I/O exception occurs
getMidiFileFormatback to summary
public MidiFileFormat getMidiFileFormat(URL url) throws InvalidMidiDataException, IOException

Implements abstract javax.sound.midi.spi.MidiFileReader.getMidiFileFormat.

Doc from javax.sound.midi.spi.MidiFileReader.getMidiFileFormat.

Obtains the MIDI file format of the URL provided. The URL must point to valid MIDI file data.

Annotations
@Override
Exceptions
InvalidMidiDataException:
if the URL does not point to valid MIDI file data recognized by the system
IOException:
if an I/O exception occurs
getMidiFileFormatback to summary
public MidiFileFormat getMidiFileFormat(File file) throws InvalidMidiDataException, IOException

Implements abstract javax.sound.midi.spi.MidiFileReader.getMidiFileFormat.

Doc from javax.sound.midi.spi.MidiFileReader.getMidiFileFormat.

Obtains the MIDI file format of the File provided. The File must point to valid MIDI file data.

Annotations
@Override
Exceptions
InvalidMidiDataException:
if the File does not point to valid MIDI file data recognized by the system
IOException:
if an I/O exception occurs
getMidiFileFormatFromStreamback to summary
private MidiFileFormat getMidiFileFormatFromStream(InputStream stream, int fileLength, SMFParser smfParser) throws InvalidMidiDataException, IOException
getSequenceback to summary
public Sequence getSequence(InputStream stream) throws InvalidMidiDataException, IOException

Implements abstract javax.sound.midi.spi.MidiFileReader.getSequence.

Doc from javax.sound.midi.spi.MidiFileReader.getSequence.

Obtains a MIDI sequence from the input stream provided. The stream must point to valid MIDI file data. In general, MIDI file readers may need to read some data from the stream before determining whether they support it. These parsers must be able to mark the stream, read enough data to determine whether they support the stream, and, if not, reset the stream's read pointer to its original position. If the input stream does not support this, this method may fail with an IOException.

Annotations
@Override
Exceptions
InvalidMidiDataException:
if the stream does not point to valid MIDI file data recognized by the system
IOException:
if an I/O exception occurs
getSequenceback to summary
public Sequence getSequence(URL url) throws InvalidMidiDataException, IOException

Implements abstract javax.sound.midi.spi.MidiFileReader.getSequence.

Doc from javax.sound.midi.spi.MidiFileReader.getSequence.

Obtains a MIDI sequence from the URL provided. The URL must point to valid MIDI file data.

Annotations
@Override
Exceptions
InvalidMidiDataException:
if the URL does not point to valid MIDI file data recognized by the system
IOException:
if an I/O exception occurs
getSequenceback to summary
public Sequence getSequence(File file) throws InvalidMidiDataException, IOException

Implements abstract javax.sound.midi.spi.MidiFileReader.getSequence.

Doc from javax.sound.midi.spi.MidiFileReader.getSequence.

Obtains a MIDI sequence from the File provided. The File must point to valid MIDI file data.

Annotations
@Override
Exceptions
InvalidMidiDataException:
if the File does not point to valid MIDI file data recognized by the system
IOException:
if an I/O exception occurs