public static void writeFasta ( final OutputStream outstream , final List < FastaSequence > sequences , final int width ) throws IOException { final OutputStreamWriter writer = new OutputStreamWriter ( outstream ) ; final BufferedWriter fastawriter = new BufferedWriter ( writer ) ; for ( final FastaSequence fs : sequences ) { fastawriter . write ( fs . getFormatedSequence ( width ) ) ; } outstream . flush ( ) ; fastawriter . close ( ) ; writer . close ( ) ; }
Writes list of FastaSequeces into the outstream formatting the sequence so that it contains width chars on each line