public static int write(AudioInputStream stream,AudioFileFormat.Type fileType,File out) throws IOException {
  List providers=getAudioFileWriters();
  int bytesWritten=0;
  boolean flag=false;
  for (int i=0; i < providers.size(); i++) {
    AudioFileWriter writer=(AudioFileWriter)providers.get(i);
    try {
      bytesWritten=writer.write(stream,fileType,out);
      flag=true;
      break;
    }
 catch (    IllegalArgumentException e) {
      continue;
    }
  }
  if (!flag) {
    throw new IllegalArgumentException("could not write audio file: file type not supported: " + fileType);
  }
 else {
    return bytesWritten;
  }
}

public static int write ( AudioInputStream stream , AudioFileFormat . Type fileType , File out ) throws IOException { List providers = getAudioFileWriters ( ) ; int bytesWritten = 0 ; boolean flag = false ; for ( int i = 0 ; i < providers . size ( ) ; i ++ ) { AudioFileWriter writer = ( AudioFileWriter ) providers . get ( i ) ; try { bytesWritten = writer . write ( stream , fileType , out ) ; flag = true ; break ; } catch ( IllegalArgumentException e ) { continue ; } } if ( ! flag ) { throw new IllegalArgumentException ( "could not write audio file: file type not supported: " + fileType ) ; } else { return bytesWritten ; } }
writes a stream of bytes representing an audio file of the specified file type to the external file provided .
