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, getPosition
DataBlockHeader getHeader()
DataBlock loadNext() throws JasDBStorageException
JasDBStorageException
void flush() throws JasDBStorageException
JasDBStorageException
int 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
JasDBStorageException
DataBlockResult<BlockDataInputStream> loadStream(int offset) throws JasDBStorageException
JasDBStorageException
DataBlockResult<BlockDataInputStream> loadStream(long absolutePosition) throws JasDBStorageException
JasDBStorageException
DataBlockResult<Long> loadLong(int offset) throws JasDBStorageException
JasDBStorageException
DataBlockResult<Long> loadLong(long absolutePosition) throws JasDBStorageException
JasDBStorageException
DataBlock.WriteResult writeBytes(byte[] bytes) throws JasDBStorageException
JasDBStorageException
DataBlock.WriteResult writeStream(InputStream stream) throws JasDBStorageException
JasDBStorageException
DataBlock.WriteResult writeLong(long value) throws JasDBStorageException
JasDBStorageException
Copyright © 2015. All rights reserved.