public class BoundedSeekableByteChannelInputStream extends BoundedArchiveInputStream
Constructor and Description |
---|
BoundedSeekableByteChannelInputStream(long start,
long remaining,
java.nio.channels.SeekableByteChannel channel)
Create a bounded stream on the underlying
SeekableByteChannel |
Modifier and Type | Method and Description |
---|---|
protected int |
read(long pos,
java.nio.ByteBuffer buf)
Read content of the stream into a
ByteBuffer . |
read, read
public BoundedSeekableByteChannelInputStream(long start, long remaining, java.nio.channels.SeekableByteChannel channel)
SeekableByteChannel
start
- Position in the stream from where the reading of this bounded stream startsremaining
- Amount of bytes which are allowed to read from the bounded streamchannel
- Channel which the reads will be delegated toprotected int read(long pos, java.nio.ByteBuffer buf) throws java.io.IOException
BoundedArchiveInputStream
ByteBuffer
.read
in class BoundedArchiveInputStream
pos
- position to start the read.buf
- buffer to add the read content.java.io.IOException
- if I/O fails.