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, get
public int append(long offset, ByteBuffer buf) throws IOException
BlockHandler
append
in class BlockHandler
offset
- starting position of the block filebuf
- ByteBuffer that data is stored inIOException
public void close() throws IOException
IOException
public boolean delete() throws IOException
BlockHandler
delete
in class BlockHandler
IOException
public ByteChannel getChannel()
BlockHandler
getChannel
in class BlockHandler
public long getLength() throws IOException
BlockHandler
getLength
in class BlockHandler
IOException
public ByteBuffer read(long offset, int length) throws IOException
BlockHandler
read
in class BlockHandler
offset
- the offset from starting of the block filelength
- the length of data to read, -1 represents reading the rest of the blockIOException
Copyright © 2015. All Rights Reserved.