throws IOException, IllegalArgumentException
throws IOException
  public static int write(Sequence in, int fileType, OutputStream out)    throws IOException, IllegalArgumentException  {    Iterator writers = ServiceFactory.lookupProviders(MidiFileWriter.class);    while (writers.hasNext())    {      MidiFileWriter fw = (MidiFileWriter) writers.next();          if (fw.isFileTypeSupported(fileType, in))        return fw.write(in, fileType, out);    }    throw new IllegalArgumentException("File type " + fileType + " is not supported");  }