DataBlock.WriteResult| Modifier and Type | Field and Description |
|---|---|
static int |
STREAM_HEADER_SPACE |
| Constructor and Description |
|---|
DataBlockImpl(long position,
DataBlockFactory dataBlockFactory,
MappedByteBuffer mappedByteBuffer) |
| 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 |
close() |
void |
flush() |
MappedByteBuffer |
getBuffer() |
DataBlockHeader |
getHeader() |
ReadWriteLock |
getLockManager() |
long |
getPosition() |
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.
|
String |
toString() |
DataBlock.WriteResult |
writeBytes(byte[] bytes) |
DataBlock.WriteResult |
writeDataStream(InputStream stream,
boolean isDelegate) |
DataBlock.WriteResult |
writeLong(long value) |
DataBlock.WriteResult |
writeStream(InputStream stream) |
public static final int STREAM_HEADER_SPACE
public DataBlockImpl(long position,
DataBlockFactory dataBlockFactory,
MappedByteBuffer mappedByteBuffer)
public DataBlock loadNext() throws JasDBStorageException
loadNext in interface DataBlockJasDBStorageExceptionpublic long getPosition()
getPosition in interface Blockpublic DataBlockHeader getHeader()
public DataBlockResult<byte[]> loadBytes(int offset) throws JasDBStorageException
DataBlockloadBytes in interface DataBlockoffset - The offset to start loading the data fromJasDBStorageException - If unable to load the bytes from the blockpublic DataBlockResult<byte[]> loadBytes(long absolutePosition) throws JasDBStorageException
loadBytes in interface DataBlockJasDBStorageExceptionpublic DataBlockResult<BlockDataInputStream> loadStream(long absolutePosition) throws JasDBStorageException
loadStream in interface DataBlockJasDBStorageExceptionpublic MappedByteBuffer getBuffer()
public ReadWriteLock getLockManager()
getLockManager in interface DataBlockpublic int capacity()
DataBlockpublic int size()
DataBlockpublic DataBlockResult<BlockDataInputStream> loadStream(int offset) throws JasDBStorageException
loadStream in interface DataBlockJasDBStorageExceptionpublic DataBlockResult<Long> loadLong(int offset) throws JasDBStorageException
loadLong in interface DataBlockJasDBStorageExceptionpublic DataBlockResult<Long> loadLong(long absolutePosition) throws JasDBStorageException
loadLong in interface DataBlockJasDBStorageExceptionpublic DataBlock.WriteResult writeBytes(byte[] bytes) throws JasDBStorageException
writeBytes in interface DataBlockJasDBStorageExceptionpublic DataBlock.WriteResult writeStream(InputStream stream) throws JasDBStorageException
writeStream in interface DataBlockJasDBStorageExceptionpublic DataBlock.WriteResult writeDataStream(InputStream stream, boolean isDelegate) throws JasDBStorageException
JasDBStorageExceptionpublic DataBlock.WriteResult writeLong(long value) throws JasDBStorageException
writeLong in interface DataBlockJasDBStorageExceptionpublic void close()
throws JasDBStorageException
close in interface BlockJasDBStorageExceptionpublic void flush()
throws JasDBStorageException
flush in interface DataBlockJasDBStorageExceptionCopyright © 2015. All rights reserved.