# Interface VCFIterator

All Superinterfaces:
  `AutoCloseable, Closeable, CloseableIterator<VariantContext>, Iterator<VariantContext>`

public interface VCFIterator extends CloseableIterator<VariantContext>
An iterator of `VariantContext`. This iterator can be used to decode VCF data on the fly . Example:

    VCFIterator r = new VCFIteratorBuilder().open(System.in);
    while (r.hasNext()) {
        System.out.println(r.next());
    }
    r.close();

See Also:
  - `VCFIteratorBuilder`

## Method Summary

Modifier and Type
Method
Description
`VCFHeader`
`getHeader()`
Returns the VCFHeader associated with this VCF/BCF file.
`VariantContext`
`peek()`
Returns the next object but does not advance the iterator.

### Methods inherited from interface CloseableIterator

`close, stream, toList`

### Methods inherited from interface Iterator

`forEachRemaining, hasNext, next, remove`

## Method Details

### getHeader

VCFHeader getHeader()
Returns the VCFHeader associated with this VCF/BCF file.

### peek

VariantContext peek()
Returns the next object but does not advance the iterator. Subsequent calls to peek() and next() will return the same object.