Package htsjdk.samtools.util
Class CoordSpanInputSteam
java.lang.Object
java.io.InputStream
htsjdk.samtools.util.CoordSpanInputSteam
- All Implemented Interfaces:
Closeable
,AutoCloseable
An input stream that wraps a
SeekableStream
to produce only bytes specified within coordinates.
Created by vadim on 25/03/2015.-
Constructor Summary
ConstructorsConstructorDescriptionCoordSpanInputSteam
(SeekableStream delegate, long[] coords) WrapSeekableStream
to read only bytes within boundaries specified in the coords array. -
Method Summary
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
CoordSpanInputSteam
WrapSeekableStream
to read only bytes within boundaries specified in the coords array. The coords array consists of [inclusive; exclusive) pairs of long coordinates. This constructor will throw exception if a start coordinate is beyond stream length. End coordinates are capped at the stream length.- Throws:
IOException
-
-
Method Details
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
available
Returns how many bytes are left in the current chunk.- Overrides:
available
in classInputStream
- Returns:
- number of unread bytes in the current chunk.
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-