Package htsjdk.samtools.seekablestream
Class ReadableSeekableStreamByteChannel
- java.lang.Object
-
- htsjdk.samtools.seekablestream.ReadableSeekableStreamByteChannel
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ByteChannel,Channel,ReadableByteChannel,SeekableByteChannel,WritableByteChannel
public class ReadableSeekableStreamByteChannel extends Object implements SeekableByteChannel
A class to wrap aSeekableStreamin a read-onlySeekableByteChannel.
-
-
Constructor Summary
Constructors Constructor Description ReadableSeekableStreamByteChannel(SeekableStream seekableStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanisOpen()longposition()SeekableByteChannelposition(long newPosition)intread(ByteBuffer dst)longsize()SeekableByteChanneltruncate(long size)intwrite(ByteBuffer src)
-
-
-
Constructor Detail
-
ReadableSeekableStreamByteChannel
public ReadableSeekableStreamByteChannel(SeekableStream seekableStream)
-
-
Method Detail
-
read
public int read(ByteBuffer dst) throws IOException
- Specified by:
readin interfaceReadableByteChannel- Specified by:
readin interfaceSeekableByteChannel- Throws:
IOException
-
write
public int write(ByteBuffer src) throws IOException
- Specified by:
writein interfaceSeekableByteChannel- Specified by:
writein interfaceWritableByteChannel- Throws:
IOException
-
position
public long position()
- Specified by:
positionin interfaceSeekableByteChannel
-
position
public SeekableByteChannel position(long newPosition) throws IOException
- Specified by:
positionin interfaceSeekableByteChannel- Throws:
IOException
-
size
public long size()
- Specified by:
sizein interfaceSeekableByteChannel
-
truncate
public SeekableByteChannel truncate(long size)
- Specified by:
truncatein interfaceSeekableByteChannel
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-