Class FeatureCodecHeader

java.lang.Object
htsjdk.tribble.FeatureCodecHeader

public class FeatureCodecHeader extends Object
A class to represent a header of a feature containing file. Specific to a codec. All codecs must return a non-null value now for their header, but the header can be the empty header object or the end case be set to NO_HEADER_END. Note that if the headerEnd value is > 0 the readers will skip the header for the codec upfront, so that decode() doesn't have to deal with potentially seeing header records in the inputstream.
Since:
5/2/12
  • Field Details

    • NO_HEADER_END

      public static final long NO_HEADER_END
      The value of the headerEnd field when there's no header
      See Also:
    • EMPTY_HEADER

      public static final FeatureCodecHeader EMPTY_HEADER
      A public instance representing no header
  • Constructor Details

    • FeatureCodecHeader

      public FeatureCodecHeader(Object headerValue, long headerEnd)
      Create a FeatureCodecHeader indicating the contents of the header (can be null) and the byte position in the file where the header ends (not inclusive). headerEnd should be NO_HEADER_END when no header is present.
      Parameters:
      headerValue - the header data read by the codec
      headerEnd - the position (not inclusive) of the end of the header. 1 would mean just the first byte of the file is the header. Zero indicates there's no header at all
  • Method Details

    • getHeaderValue

      public Object getHeaderValue()
      Returns:
      the header value provided by the codec for this file
    • getHeaderEnd

      public long getHeaderEnd()
      Returns:
      to position, not inclusive, where the header ends. Must be >= 0
    • skipHeaderBytes

      public boolean skipHeaderBytes()
      Returns:
      true if we should skip some bytes to skip this header