Package htsjdk.samtools.cram.build
Class CramContainerHeaderIterator
- java.lang.Object
-
- htsjdk.samtools.cram.build.CramContainerIterator
-
- htsjdk.samtools.cram.build.CramContainerHeaderIterator
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterator<Container>
public final class CramContainerHeaderIterator extends CramContainerIterator
Iterate over CRAM containers from an input stream, and unlikeCramContainerIterator
only the header of each container is read, rather than the whole stream. As a result, the container block data is *not* populated, including the compression header block and slices. This class is useful when you are not interested in the contents of containers, for example when indexing container start positions.
-
-
Constructor Summary
Constructors Constructor Description CramContainerHeaderIterator(InputStream inputStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Container
containerFromStream(CountingInputStream countingStream)
Consume the entirety of the next container from the stream, but retain only the header.-
Methods inherited from class htsjdk.samtools.cram.build.CramContainerIterator
close, getCramHeader, getSamFileHeader, hasNext, next, remove
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
CramContainerHeaderIterator
public CramContainerHeaderIterator(InputStream inputStream)
-
-
Method Detail
-
containerFromStream
protected Container containerFromStream(CountingInputStream countingStream)
Consume the entirety of the next container from the stream, but retain only the header. This is intended as a performance optimization, because it does not decode block data.- Overrides:
containerFromStream
in classCramContainerIterator
- Parameters:
countingStream
- theCountingInputStream
to read from- Returns:
- The next Container's header from the stream, returned as a Container.
- See Also:
CramContainerIterator.containerFromStream(CountingInputStream)
-
-