javax.sound.midi.spi
Class MidiFileReader

java.lang.Object
  extended by javax.sound.midi.spi.MidiFileReader

public abstract class MidiFileReader
extends Object

The MidiFileReader abstract class defines the methods to be provided by a MIDI file reader.

Since:
1.3

Constructor Summary
MidiFileReader()
           
 
Method Summary
abstract  MidiFileFormat getMidiFileFormat(File file)
          Read a MidiFileFormat from the given stream.
abstract  MidiFileFormat getMidiFileFormat(InputStream stream)
          Read a MidiFileFormat from the given stream.
abstract  MidiFileFormat getMidiFileFormat(URL url)
          Read a MidiFileFormat from the given stream.
abstract  Sequence getSequence(File file)
          Read a Sequence from the given stream.
abstract  Sequence getSequence(InputStream stream)
          Read a Sequence from the given stream.
abstract  Sequence getSequence(URL url)
          Read a Sequence from the given stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MidiFileReader

public MidiFileReader()
Method Detail

getMidiFileFormat

public abstract MidiFileFormat getMidiFileFormat(InputStream stream)
                                          throws InvalidMidiDataException,
                                                 IOException
Read a MidiFileFormat from the given stream.

Parameters:
stream - the stream from which to read the MIDI data
Returns:
the MidiFileFormat object
Throws:
InvalidMidiDataException - if the stream refers to invalid data
IOException - if an I/O exception occurs while reading

getMidiFileFormat

public abstract MidiFileFormat getMidiFileFormat(URL url)
                                          throws InvalidMidiDataException,
                                                 IOException
Read a MidiFileFormat from the given stream.

Parameters:
url - the url from which to read the MIDI data
Returns:
the MidiFileFormat object
Throws:
InvalidMidiDataException - if the url refers to invalid data
IOException - if an I/O exception occurs while reading

getMidiFileFormat

public abstract MidiFileFormat getMidiFileFormat(File file)
                                          throws InvalidMidiDataException,
                                                 IOException
Read a MidiFileFormat from the given stream.

Parameters:
file - the file from which to read the MIDI data
Returns:
the MidiFileFormat object
Throws:
InvalidMidiDataException - if the file refers to invalid data
IOException - if an I/O exception occurs while reading

getSequence

public abstract Sequence getSequence(InputStream stream)
                              throws InvalidMidiDataException,
                                     IOException
Read a Sequence from the given stream.

Parameters:
stream - the stream from which to read the MIDI data
Returns:
the Sequence object
Throws:
InvalidMidiDataException - if the stream refers to invalid data
IOException - if an I/O exception occurs while reading

getSequence

public abstract Sequence getSequence(URL url)
                              throws InvalidMidiDataException,
                                     IOException
Read a Sequence from the given stream.

Parameters:
url - the url from which to read the MIDI data
Returns:
the Sequence object
Throws:
InvalidMidiDataException - if the url refers to invalid data
IOException - if an I/O exception occurs while reading

getSequence

public abstract Sequence getSequence(File file)
                              throws InvalidMidiDataException,
                                     IOException
Read a Sequence from the given stream.

Parameters:
file - the file from which to read the MIDI data
Returns:
the Sequence object
Throws:
InvalidMidiDataException - if the file refers to invalid data
IOException - if an I/O exception occurs while reading