Class 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 Detail

      • 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