RichSequenceIterator.hasNext from empty file return true!!!

Khalil El Mazouari <[email protected]>
Newsgroups gmane.comp.java.bio.general
Message-ID <[email protected]>
Hi,

RichSequenceIterator.hasNext from empty file return true!!! and throws an infinite BioException loop!!!
Any explanation?? Thanks

khalil

test using the following code

    public static void main(String[] args) {
       String path = "emptyFile.txt";

         BufferedReader br = null;
      try {
         br = new BufferedReader(new FileReader(path));
      } catch (FileNotFoundException ex) {
         ex.printStackTrace();
      }
      RichSequenceIterator seqs = RichSequence.IOTools.readFastaProtein(br, null);
        while (seqs.hasNext()) {
         try {
            RichSequence seq = seqs.nextRichSequence();
         } catch (NoSuchElementException ex) {
            ex.printStackTrace();
         } catch (BioException ex) {
            ex.printStackTrace();
         }
        }

====

org.biojava.bio.BioException: Could not read sequence
        at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(RichStreamReader.java:113)
        at com.kem.ae.core.Empty.main(Empty.java:51)
Caused by: java.io.IOException: Premature stream end
        at org.biojavax.bio.seq.io.FastaFormat.readRichSequence(FastaFormat.java:178)
        at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(RichStreamReader.java:110)
        ... 1 more
org.biojava.bio.BioException: Could not read sequence
        at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(RichStreamReader.java:113)
        at com.kem.ae.core.Empty.main(Empty.java:51)
Caused by: java.io.IOException: Premature stream end
        at org.biojavax.bio.seq.io.FastaFormat.readRichSequence(FastaFormat.java:178)
        at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(RichStreamReader.java:110)

infinite loop....


_______________________________________________
Biojava-l mailing list  -  [email protected]
http://lists.open-bio.org/mailman/listinfo/biojava-l
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.