Package htsjdk.samtools.cram.build

# Class CramContainerIterator

java.lang.Object
htsjdk.samtools.cram.build.CramContainerIterator

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`, `Iterator<Container>`

Direct Known Subclasses:
  `CramContainerHeaderIterator`, `CramSpanContainerIterator`

public class CramContainerIterator extends Object implements Iterator<Container>, Closeable
An iterator of CRAM containers read from an `InputStream`.

## Constructor Summary

Constructors
Constructor
Description
`CramContainerIterator(InputStream inputStream)`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`protected Container`
`containerFromStream(CountingInputStream countingStream)`
Consume the entirety of the next container from the stream.
`CramHeader`
`getCramHeader()`
`SAMFileHeader`
`getSamFileHeader()`
`boolean`
`hasNext()`
`Container`
`next()`
`void`
`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 Details

### CramContainerIterator

public CramContainerIterator(InputStream inputStream)

## Method Details

### containerFromStream

protected Container containerFromStream(CountingInputStream countingStream)
Consume the entirety of the next container from the stream.

Parameters:
  `countingStream` - the `CountingInputStream` to read from
Returns:
  The next Container from the stream.
See Also:
  - `containerFromStream(CountingInputStream)`

### hasNext

public boolean hasNext()

Specified by:
  `hasNext` in interface `Iterator<Container>`

### next

public Container next()

Specified by:
  `next` in interface `Iterator<Container>`

### remove

public void remove()

Specified by:
  `remove` in interface `Iterator<Container>`

### getCramHeader

public CramHeader getCramHeader()

### getSamFileHeader

public SAMFileHeader getSamFileHeader()

### close

public void close()

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`