public class ChannelAsSeekableStream
extends htsjdk.samtools.seekablestream.SeekableStream
Constructor and Description |
---|
ChannelAsSeekableStream(java.nio.channels.SeekableByteChannel chan) |
ChannelAsSeekableStream(java.nio.channels.SeekableByteChannel chan,
java.lang.String source) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
eof() |
java.lang.String |
getSource() |
long |
length() |
long |
position() |
int |
read()
Reads the next byte of data from the input stream.
|
int |
read(byte[] buffer,
int offset,
int length) |
void |
seek(long position) |
public ChannelAsSeekableStream(java.nio.channels.SeekableByteChannel chan)
public ChannelAsSeekableStream(java.nio.channels.SeekableByteChannel chan, java.lang.String source)
public long length()
length
in class htsjdk.samtools.seekablestream.SeekableStream
public long position() throws java.io.IOException
position
in class htsjdk.samtools.seekablestream.SeekableStream
java.io.IOException
public void seek(long position) throws java.io.IOException
seek
in class htsjdk.samtools.seekablestream.SeekableStream
java.io.IOException
public int read() throws java.io.IOException
int
in the range 0
to
255
. If no byte is available because the end of the stream
has been reached, the value -1
is returned. This method
blocks until input data is available, the end of the stream is detected,
or an exception is thrown.read
in class java.io.InputStream
-1
if the end of the
stream is reached.java.io.IOException
- if an I/O error occurs.public int read(byte[] buffer, int offset, int length) throws java.io.IOException
read
in class htsjdk.samtools.seekablestream.SeekableStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class htsjdk.samtools.seekablestream.SeekableStream
java.io.IOException
public boolean eof() throws java.io.IOException
eof
in class htsjdk.samtools.seekablestream.SeekableStream
java.io.IOException
public java.lang.String getSource()
getSource
in class htsjdk.samtools.seekablestream.SeekableStream