Package htsjdk.samtools.util
Interface SortingCollection.Codec<T>
-
- All Superinterfaces:
Cloneable
- All Known Implementing Classes:
BAMRecordCodec,VCFRecordCodec
- Enclosing class:
- SortingCollection<T>
public static interface SortingCollection.Codec<T> extends Cloneable
Client must implement this class, which defines the way in which records are written to and read from file.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SortingCollection.Codec<T>clone()Must return a cloned copy of the codec that can be used independently of the original instance.Tdecode()Read the next record from the input stream and convert into a java object.voidencode(T val)Write object to output streamvoidsetInputStream(InputStream is)Where to read encoded input fromvoidsetOutputStream(OutputStream os)Where to write encoded output
-
-
-
Method Detail
-
setOutputStream
void setOutputStream(OutputStream os)
Where to write encoded output
-
setInputStream
void setInputStream(InputStream is)
Where to read encoded input from
-
encode
void encode(T val)
Write object to output stream- Parameters:
val- what to write
-
decode
T decode()
Read the next record from the input stream and convert into a java object.- Returns:
- null if no more records. Should throw exception if EOF is encountered in the middle of a record.
-
clone
SortingCollection.Codec<T> clone()
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.
-
-