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 ); // throws IOException
flag = true;
break;
} catch (IllegalArgumentException e) {
// thrown if this provider cannot write the sequence, try the next
continue;