- java.lang.Object
-
- javax.sound.midi.spi.MidiFileWriter
-
-
Constructor Summary
Constructors Constructor and Description MidiFileWriter()
-
Method Summary
Methods Modifier and Type Method and Description abstract int[]
getMidiFileTypes()
Obtains the set of MIDI file types for which file writing support is provided by this file writer.abstract int[]
getMidiFileTypes(Sequence sequence)
Obtains the file types that this file writer can write from the sequence specified.boolean
isFileTypeSupported(int fileType)
Indicates whether file writing support for the specified MIDI file type is provided by this file writer.boolean
isFileTypeSupported(int fileType, Sequence sequence)
Indicates whether a MIDI file of the file type specified can be written from the sequence indicated.abstract int
write(Sequence in, int fileType, File out)
Writes a stream of bytes representing a MIDI file of the file type indicated to the external file provided.abstract int
write(Sequence in, int fileType, OutputStream out)
Writes a stream of bytes representing a MIDI file of the file type indicated to the output stream provided.
-
-
-
Method Detail
-
getMidiFileTypes
public abstract int[] getMidiFileTypes()
Obtains the set of MIDI file types for which file writing support is provided by this file writer.- Returns:
- array of file types. If no file types are supported, an array of length 0 is returned.
-
getMidiFileTypes
public abstract int[] getMidiFileTypes(Sequence sequence)
Obtains the file types that this file writer can write from the sequence specified.- Parameters:
sequence
- the sequence for which MIDI file type support is queried- Returns:
- array of file types. If no file types are supported, returns an array of length 0.
-
isFileTypeSupported
public boolean isFileTypeSupported(int fileType)
Indicates whether file writing support for the specified MIDI file type is provided by this file writer.- Parameters:
fileType
- the file type for which write capabilities are queried- Returns:
true
if the file type is supported, otherwisefalse
-
isFileTypeSupported
public boolean isFileTypeSupported(int fileType, Sequence sequence)
Indicates whether a MIDI file of the file type specified can be written from the sequence indicated.- Parameters:
fileType
- the file type for which write capabilities are queriedsequence
- the sequence for which file writing support is queried- Returns:
true
if the file type is supported for this sequence, otherwisefalse
-
write
public abstract int write(Sequence in, int fileType, OutputStream out) throws IOException
Writes a stream of bytes representing a MIDI file of the file type indicated to the output stream provided.- Parameters:
in
- sequence containing MIDI data to be written to the filefileType
- type of the file to be written to the output streamout
- stream to which the file data should be written- Returns:
- the number of bytes written to the output stream
- Throws:
IOException
- if an I/O exception occursIllegalArgumentException
- if the file type is not supported by this file writer- See Also:
isFileTypeSupported(int, Sequence)
,getMidiFileTypes(Sequence)
-
write
public abstract int write(Sequence in, int fileType, File out) throws IOException
Writes a stream of bytes representing a MIDI file of the file type indicated to the external file provided.- Parameters:
in
- sequence containing MIDI data to be written to the external filefileType
- type of the file to be written to the external fileout
- external file to which the file data should be written- Returns:
- the number of bytes written to the file
- Throws:
IOException
- if an I/O exception occursIllegalArgumentException
- if the file type is not supported by this file writer- See Also:
isFileTypeSupported(int, Sequence)
,getMidiFileTypes(Sequence)
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-javax/sound/midi/spi/midifilewriter.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.