Package htsjdk.variant.vcf
Class VCFRecordCodec
- java.lang.Object
-
- htsjdk.variant.vcf.VCFRecordCodec
-
- All Implemented Interfaces:
SortingCollection.Codec<VariantContext>,Cloneable
public class VCFRecordCodec extends Object implements SortingCollection.Codec<VariantContext>
Writes VariantContext instances to an OutputStream without headers or metadata. For use with SortingCollection ONLY.
-
-
Constructor Summary
Constructors Constructor Description VCFRecordCodec(VCFHeader header)VCFRecordCodec(VCFHeader header, boolean allowMissingFieldsInHeader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VCFRecordCodecclone()Must return a cloned copy of the codec that can be used independently of the original instance.VariantContextdecode()Read the next record from the input stream and convert into a java object.voidencode(VariantContext context)Write object to output streamvoidsetInputStream(InputStream stream)Where to read encoded input fromvoidsetOutputStream(OutputStream stream)Where to write encoded output
-
-
-
Method Detail
-
setOutputStream
public void setOutputStream(OutputStream stream)
Description copied from interface:SortingCollection.CodecWhere to write encoded output- Specified by:
setOutputStreamin interfaceSortingCollection.Codec<VariantContext>
-
setInputStream
public void setInputStream(InputStream stream)
Description copied from interface:SortingCollection.CodecWhere to read encoded input from- Specified by:
setInputStreamin interfaceSortingCollection.Codec<VariantContext>
-
encode
public void encode(VariantContext context)
Description copied from interface:SortingCollection.CodecWrite object to output stream- Specified by:
encodein interfaceSortingCollection.Codec<VariantContext>- Parameters:
context- what to write
-
decode
public VariantContext decode()
Description copied from interface:SortingCollection.CodecRead the next record from the input stream and convert into a java object.- Specified by:
decodein interfaceSortingCollection.Codec<VariantContext>- Returns:
- null if no more records. Should throw exception if EOF is encountered in the middle of a record.
-
clone
public VCFRecordCodec clone()
Description copied from interface:SortingCollection.CodecMust 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:
clonein interfaceSortingCollection.Codec<VariantContext>- Overrides:
clonein classObject
-
-