Package htsjdk.variant.vcf
Class VCFRecordCodec
java.lang.Object
htsjdk.variant.vcf.VCFRecordCodec
- All Implemented Interfaces:
SortingCollection.Codec<VariantContext>
,Cloneable
Writes VariantContext instances to an OutputStream without headers or metadata. For use
with SortingCollection ONLY.
-
Constructor Summary
ConstructorsConstructorDescriptionVCFRecordCodec
(VCFHeader header) VCFRecordCodec
(VCFHeader header, boolean allowMissingFieldsInHeader) -
Method Summary
Modifier and TypeMethodDescriptionclone()
Must return a cloned copy of the codec that can be used independently of the original instance.decode()
Read the next record from the input stream and convert into a java object.void
encode
(VariantContext context) Write object to output streamvoid
setInputStream
(InputStream stream) Where to read encoded input fromvoid
setOutputStream
(OutputStream stream) Where to write encoded output
-
Constructor Details
-
VCFRecordCodec
-
VCFRecordCodec
-
-
Method Details
-
setOutputStream
Description copied from interface:SortingCollection.Codec
Where to write encoded output- Specified by:
setOutputStream
in interfaceSortingCollection.Codec<VariantContext>
-
setInputStream
Description copied from interface:SortingCollection.Codec
Where to read encoded input from- Specified by:
setInputStream
in interfaceSortingCollection.Codec<VariantContext>
-
encode
Description copied from interface:SortingCollection.Codec
Write object to output stream- Specified by:
encode
in interfaceSortingCollection.Codec<VariantContext>
- Parameters:
context
- what to write
-
decode
Description copied from interface:SortingCollection.Codec
Read the next record from the input stream and convert into a java object.- Specified by:
decode
in interfaceSortingCollection.Codec<VariantContext>
- Returns:
- null if no more records. Should throw exception if EOF is encountered in the middle of a record.
-
clone
Description copied from interface:SortingCollection.Codec
Must return a cloned copy of the codec that can be used independently of the original instance. This is required so that multiple codecs can exist simultaneously that each is reading a separate file.- Specified by:
clone
in interfaceSortingCollection.Codec<VariantContext>
- Overrides:
clone
in classObject
-