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 aSeekableStream
in a read-onlySeekableByteChannel
.
-
-
Constructor Summary
Constructors Constructor Description ReadableSeekableStreamByteChannel(SeekableStream seekableStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
boolean
isOpen()
long
position()
SeekableByteChannel
position(long newPosition)
int
read(ByteBuffer dst)
long
size()
SeekableByteChannel
truncate(long size)
int
write(ByteBuffer src)
-
-
-
Constructor Detail
-
ReadableSeekableStreamByteChannel
public ReadableSeekableStreamByteChannel(SeekableStream seekableStream)
-
-
Method Detail
-
read
public int read(ByteBuffer dst) throws IOException
- Specified by:
read
in interfaceReadableByteChannel
- Specified by:
read
in interfaceSeekableByteChannel
- Throws:
IOException
-
write
public int write(ByteBuffer src) throws IOException
- Specified by:
write
in interfaceSeekableByteChannel
- Specified by:
write
in interfaceWritableByteChannel
- Throws:
IOException
-
position
public long position()
- Specified by:
position
in interfaceSeekableByteChannel
-
position
public SeekableByteChannel position(long newPosition) throws IOException
- Specified by:
position
in interfaceSeekableByteChannel
- Throws:
IOException
-
size
public long size()
- Specified by:
size
in interfaceSeekableByteChannel
-
truncate
public SeekableByteChannel truncate(long size)
- Specified by:
truncate
in interfaceSeekableByteChannel
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-