Class RichStreamReader

  • All Implemented Interfaces:
    SequenceIterator, BioEntryIterator, RichSequenceIterator

    public class RichStreamReader
    extends Object
    implements RichSequenceIterator
    Parses a stream into sequences. This object implements SequenceIterator, so you can loop over each sequence produced. It consumes a stream, and uses a SequenceFormat to extract each sequence from the stream. It is assumed that the stream contains sequences that can be handled by the one format, and that they are not seperated other than by delimiters that the format can handle. Sequences are instantiated when they are requested by nextSequence, not before, so it is safe to use this object to parse a gigabyte fasta file, and do sequence-by-sequence processing, while being guaranteed that RichStreamReader will not require you to keep any of the sequences in memory.
    Since:
    1.5
    Author:
    Matthew Pocock, Thomas Down, Richard Holland