Package htsjdk.samtools.util
Class IntervalCodec
java.lang.Object
htsjdk.samtools.util.IntervalCodec
- All Implemented Interfaces:
SortingCollection.Codec<Interval>,Cloneable
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new binary codec to read or write. -
Method Summary
Modifier and TypeMethodDescriptionclone()Must return a cloned copy of the codec that can be used independently of the original instance.decode()Reads an interval from the input stream.voidWrites the interval to the output stream.voidSets the input stream that records will be read from.voidsetInputStream(InputStream is, String filename) Sets the input stream that records will be read from.voidSets the output stream that records will be written to.voidsetOutputStream(OutputStream os, String filename) Sets the output stream that records will be written to.
-
Constructor Details
-
IntervalCodec
Creates a new binary codec to read or write.- Parameters:
dict- the sequence dictionary associated with the intervals.
-
-
Method Details
-
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<Interval>- Overrides:
clonein classObject
-
setOutputStream
Sets the output stream that records will be written to.- Specified by:
setOutputStreamin interfaceSortingCollection.Codec<Interval>
-
setOutputStream
Sets the output stream that records will be written to. -
setInputStream
Sets the input stream that records will be read from.- Specified by:
setInputStreamin interfaceSortingCollection.Codec<Interval>
-
setInputStream
Sets the input stream that records will be read from. -
encode
Writes the interval to the output stream.- Specified by:
encodein interfaceSortingCollection.Codec<Interval>- Parameters:
interval- the interval to write.
-
decode
Reads an interval from the input stream.- Specified by:
decodein interfaceSortingCollection.Codec<Interval>- Returns:
- null if no more intervals, otherwise the next interval.
-