public interface DataBlock extends Block
| Modifier and Type | Interface and Description |
|---|---|
static interface |
DataBlock.WriteResult |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
int |
capacity()
The capacity of the block available for storage, this is excluding the
size of the header.
|
void |
flush() |
ByteBuffer |
getBuffer() |
DataBlockHeader |
getHeader() |
ReadWriteLock |
getLockManager() |
DataBlockResult<byte[]> |
loadBytes(int offset)
Load bytes from the datablock, providing an offset from the start of the block.
|
DataBlockResult<byte[]> |
loadBytes(long absolutePosition) |
DataBlockResult<Long> |
loadLong(int offset) |
DataBlockResult<Long> |
loadLong(long absolutePosition) |
DataBlock |
loadNext() |
DataBlockResult<BlockDataInputStream> |
loadStream(int offset) |
DataBlockResult<BlockDataInputStream> |
loadStream(long absolutePosition) |
void |
reset() |
int |
size()
Returns the data size of the block on the disk including the size of the
header.
|
DataBlock.WriteResult |
writeBytes(byte[] bytes) |
DataBlock.WriteResult |
writeLong(long value) |
DataBlock.WriteResult |
writeStream(InputStream stream) |
close, getPositionDataBlockHeader getHeader()
DataBlock loadNext() throws JasDBStorageException
JasDBStorageExceptionvoid flush()
throws JasDBStorageException
JasDBStorageExceptionint size()
int capacity()
int available()
void reset()
ByteBuffer getBuffer()
ReadWriteLock getLockManager()
DataBlockResult<byte[]> loadBytes(int offset) throws JasDBStorageException
offset - The offset to start loading the data fromJasDBStorageException - If unable to load the bytes from the blockDataBlockResult<byte[]> loadBytes(long absolutePosition) throws JasDBStorageException
JasDBStorageExceptionDataBlockResult<BlockDataInputStream> loadStream(int offset) throws JasDBStorageException
JasDBStorageExceptionDataBlockResult<BlockDataInputStream> loadStream(long absolutePosition) throws JasDBStorageException
JasDBStorageExceptionDataBlockResult<Long> loadLong(int offset) throws JasDBStorageException
JasDBStorageExceptionDataBlockResult<Long> loadLong(long absolutePosition) throws JasDBStorageException
JasDBStorageExceptionDataBlock.WriteResult writeBytes(byte[] bytes) throws JasDBStorageException
JasDBStorageExceptionDataBlock.WriteResult writeStream(InputStream stream) throws JasDBStorageException
JasDBStorageExceptionDataBlock.WriteResult writeLong(long value) throws JasDBStorageException
JasDBStorageExceptionCopyright © 2015. All rights reserved.