# Class VCFHeaderReader

java.lang.Object
htsjdk.variant.utils.VCFHeaderReader

public final class VCFHeaderReader extends Object
Utility class to read a VCF header without being told beforehand whether the input is VCF or BCF.

## Method Summary

Modifier and Type
Method
Description
`static VCFHeader`
`readHeaderFrom(SeekableStream in)`
Read a VCF header from a stream that may be a VCF file (possibly gzip or block compressed) or a BCF file.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### readHeaderFrom

public static VCFHeader readHeaderFrom(SeekableStream in) throws IOException
Read a VCF header from a stream that may be a VCF file (possibly gzip or block compressed) or a BCF file. After successfully reading a header the stream is positioned immediately after the header, otherwise, if an exception is thrown, the state of the stream is undefined.

Parameters:
  `in` - the stream to read the header from
Returns:
  the VCF header read from the stream
Throws:
  `TribbleException.InvalidHeader` - if the header in the file is invalid
  `IOException` - if an IOException occurs while reading the header