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) WrapSeekableStreamto 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
WrapSeekableStreamto 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:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
available
Returns how many bytes are left in the current chunk.- Overrides:
availablein classInputStream- Returns:
- number of unread bytes in the current chunk.
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-