Package htsjdk.samtools.seekablestream
Class SeekablePathStream
java.lang.Object
java.io.InputStream
htsjdk.samtools.seekablestream.SeekableStream
htsjdk.samtools.seekablestream.SeekablePathStream
- All Implemented Interfaces:
Closeable,AutoCloseable
An implementation of
SeekableStream for Path.-
Field Summary
Fields inherited from class htsjdk.samtools.seekablestream.SeekableStream
mark -
Constructor Summary
ConstructorsConstructorDescriptionSeekablePathStream(Path path) SeekablePathStream(Path path, Function<SeekableByteChannel, SeekableByteChannel> wrapper) -
Method Summary
Methods inherited from class htsjdk.samtools.seekablestream.SeekableStream
available, mark, markSupported, readFully, resetMethods inherited from class java.io.InputStream
nullInputStream, read, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
SeekablePathStream
- Throws:
IOException
-
SeekablePathStream
public SeekablePathStream(Path path, Function<SeekableByteChannel, SeekableByteChannel> wrapper) throws IOException- Throws:
IOException
-
-
Method Details
-
length
public long length()- Specified by:
lengthin classSeekableStream- Returns:
- the length of the stream; 0 if not available or empty.
-
eof
- Specified by:
eofin classSeekableStream- Returns:
trueif the stream is already consumed;falseotherwise.- Throws:
IOException
-
seek
Description copied from class:SeekableStreamSeeks the stream to the provided position.- Specified by:
seekin classSeekableStream- Throws:
IOException
-
position
- Specified by:
positionin classSeekableStream- Returns:
- the current byte position of the stream.
- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
read
- Specified by:
readin classSeekableStream- Throws:
IOException
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
getSource
- Specified by:
getSourcein classSeekableStream- Returns:
- String representation of source (e.g. URL, file path, etc.), or null if not available.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classSeekableStream- Throws:
IOException
-
closeAllInstances
public static void closeAllInstances()
-