Hello everybody,

   I was recently writing about inconsistency in
FastaFormat class, I send the updated version of the
function which works as intended.

    public void writeSequence(Sequence seq, String
format, PrintStream os)
        throws IOException
    {
        String requestedFormat = new String(format);
        boolean found = false;

        String [] formats = (String [])
getFormats().toArray(new String[0]);
        
        for(int i = 0; i < formats.length; i++) {
          found = found ||
(formats[i].compareTo(format) == 0);
        }

        if (! found)
            throw new IOException("Failed to write: an
invalid file format '"
                                  + format
                                  + "' was requested");

        writeSequence(seq, os);
    }

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
_______________________________________________
Biojava-l mailing list  -  [EMAIL PROTECTED]
http://biojava.org/mailman/listinfo/biojava-l

Reply via email to