* @see #isFileTypeSupported(int, Sequence)
* @see #getMidiFileTypes(Sequence)
*/
public static int write(Sequence in, int fileType, OutputStream out) throws IOException {
MidiFileWriter providers[] = getMidiFileWriters();
//$$fb 2002-04-17: Fix for 4635287: Standard MidiFileWriter cannot write empty Sequences
int bytesWritten = -2;
//$$fb 2001-08-03: reverse this loop to give external providers more priority (Bug #4487550)
for(int i = providers.length-1; i >= 0; i-- ) {