public final class BlockHandlerLocal extends BlockHandler
| Modifier and Type | Method and Description |
|---|---|
int |
append(long offset,
ByteBuffer buf)
Appends data to the block from a ByteBuffer
|
void |
close() |
boolean |
delete()
Deletes the block
|
ByteChannel |
getChannel()
Gets channel used to access block
|
long |
getLength()
Gets the length of the block
|
ByteBuffer |
read(long offset,
int length)
Reads data from block
|
append, getpublic int append(long offset,
ByteBuffer buf)
throws IOException
BlockHandlerappend in class BlockHandleroffset - starting position of the block filebuf - ByteBuffer that data is stored inIOExceptionpublic void close()
throws IOException
IOExceptionpublic boolean delete()
throws IOException
BlockHandlerdelete in class BlockHandlerIOExceptionpublic ByteChannel getChannel()
BlockHandlergetChannel in class BlockHandlerpublic long getLength()
throws IOException
BlockHandlergetLength in class BlockHandlerIOExceptionpublic ByteBuffer read(long offset, int length) throws IOException
BlockHandlerread in class BlockHandleroffset - the offset from starting of the block filelength - the length of data to read, -1 represents reading the rest of the blockIOExceptionCopyright © 2015. All Rights Reserved.