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.void
Writes the interval to the output stream.void
Sets the input stream that records will be read from.void
setInputStream
(InputStream is, String filename) Sets the input stream that records will be read from.void
Sets the output stream that records will be written to.void
setOutputStream
(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.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<Interval>
- Overrides:
clone
in classObject
-
setOutputStream
Sets the output stream that records will be written to.- Specified by:
setOutputStream
in 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:
setInputStream
in interfaceSortingCollection.Codec<Interval>
-
setInputStream
Sets the input stream that records will be read from. -
encode
Writes the interval to the output stream.- Specified by:
encode
in interfaceSortingCollection.Codec<Interval>
- Parameters:
interval
- the interval to write.
-
decode
Reads an interval from the input stream.- Specified by:
decode
in interfaceSortingCollection.Codec<Interval>
- Returns:
- null if no more intervals, otherwise the next interval.
-