public class

StandardMidiFileWriter

extends MidiFileWriter
java.lang.Object
   ↳ javax.sound.midi.spi.MidiFileWriter
     ↳ com.sun.media.sound.StandardMidiFileWriter

Class Overview

MIDI file writer.

Summary

Public Constructors
StandardMidiFileWriter()
Public Methods
int[] getMidiFileTypes()
new
int[] getMidiFileTypes(Sequence sequence)
Obtains the file types that this provider can write from the sequence specified.
boolean isFileTypeSupported(int type)
Indicates whether file writing support for the specified MIDI file type is provided by this file writer.
int write(Sequence in, int type, OutputStream out)
Writes a stream of bytes representing a MIDI file of the file type indicated to the output stream provided.
int write(Sequence in, int type, File out)
Writes a stream of bytes representing a MIDI file of the file type indicated to the external file provided.
[Expand]
Inherited Methods
From class javax.sound.midi.spi.MidiFileWriter
From class java.lang.Object

Public Constructors

public StandardMidiFileWriter ()

Public Methods

public int[] getMidiFileTypes ()

new

Returns
  • array of file types. If no file types are supported, an array of length 0 is returned.

public int[] getMidiFileTypes (Sequence sequence)

Obtains the file types that this provider 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.

public boolean isFileTypeSupported (int type)

Indicates whether file writing support for the specified MIDI file type is provided by this file writer.

Parameters
type the file type for which write capabilities are queried
Returns
  • true if the file type is supported, otherwise false

public int write (Sequence in, int type, OutputStream out)

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 file
type type of the file to be written to the output stream
out stream to which the file data should be written
Returns
  • the number of bytes written to the output stream
Throws
IOException

public int write (Sequence in, int type, File out)

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 file
type type of the file to be written to the external file
out external file to which the file data should be written
Returns
  • the number of bytes written to the file
Throws
IOException