Package htsjdk.tribble
Class FeatureCodecHeader
java.lang.Object
htsjdk.tribble.FeatureCodecHeader
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 Summary
Modifier and TypeFieldDescriptionstatic final FeatureCodecHeader
A public instance representing no headerstatic final long
The value of the headerEnd field when there's no header -
Constructor Summary
ConstructorDescriptionFeatureCodecHeader
(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). -
Method Summary
Modifier and TypeMethodDescriptionlong
boolean
-
Field Details
-
NO_HEADER_END
public static final long NO_HEADER_ENDThe value of the headerEnd field when there's no header- See Also:
-
EMPTY_HEADER
A public instance representing no header
-
-
Constructor Details
-
FeatureCodecHeader
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 codecheaderEnd
- 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
- 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
-