public interface BlockReader extends Closeable
This class does not provide thread-safety.
Modifier and Type | Method and Description |
---|---|
ReadableByteChannel |
getChannel()
Returns a readable byte channel of the block.
|
long |
getLength()
Gets the length of the block in bytes.
|
boolean |
isClosed() |
ByteBuffer |
read(long offset,
long length)
Reads data from the block.
|
int |
transferTo(io.netty.buffer.ByteBuf buf)
Transfers data (up to buf.writableBytes()) from this reader to the buffer.
|
ByteBuffer read(long offset, long length) throws IOException
offset
- the offset from starting of the block file in byteslength
- the length of data to read in bytes, -1 for the rest of the blockByteBuffer
the data that was readIOException
long getLength()
ReadableByteChannel getChannel()
int transferTo(io.netty.buffer.ByteBuf buf) throws IOException
buf
- the byte bufferIOException
boolean isClosed()
Copyright © 2023. All Rights Reserved.