public abstract static class Volume.ByteBufferVol extends Volume
Volume.ByteArrayVol, Volume.ByteBufferVol, Volume.ByteBufferVolSingle, Volume.FileChannelVol, Volume.MappedFileVol, Volume.MappedFileVolSingle, Volume.MemoryVol, Volume.MemoryVolSingle, Volume.RandomAccessFileVol, Volume.ReadOnly, Volume.SingleByteArrayVol, Volume.VolumeFactory| Modifier and Type | Field and Description |
|---|---|
protected boolean |
cleanerHackEnabled |
protected ReentrantLock |
growLock |
protected boolean |
readOnly |
protected ByteBuffer[] |
slices |
protected int |
sliceShift |
protected int |
sliceSize |
protected int |
sliceSizeModMask |
closed, LOG, UNSAFE_VOL_FACTORY| Modifier | Constructor and Description |
|---|---|
protected |
Volume.ByteBufferVol(boolean readOnly,
int sliceShift,
boolean cleanerHackEnabled) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear(long startOffset,
long endOffset)
Set all bytes between
startOffset and endOffset to zero. |
byte |
getByte(long offset) |
void |
getData(long offset,
byte[] src,
int srcPos,
int srcSize) |
DataIO.DataInputByteBuffer |
getDataInput(long offset,
int size) |
DataInput |
getDataInputOverlap(long offset,
int size) |
int |
getInt(long offset) |
long |
getLong(long offset) |
long |
getPackedLong(long position)
Unpack long value from the Volume.
|
long |
getSixLong(long pos) |
protected ByteBuffer |
getSlice(long offset) |
int |
getUnsignedByte(long offset) |
int |
getUnsignedShort(long offset) |
boolean |
isSliced() |
void |
putByte(long offset,
byte value) |
void |
putData(long offset,
byte[] src,
int srcPos,
int srcSize) |
void |
putData(long offset,
ByteBuffer buf) |
void |
putDataOverlap(long offset,
byte[] data,
int pos,
int len) |
void |
putInt(long offset,
int value) |
void |
putLong(long offset,
long value) |
int |
putPackedLong(long pos,
long value)
Put packed long at given position.
|
void |
putSixLong(long pos,
long value) |
void |
putUnsignedByte(long offset,
int byt) |
void |
putUnsignedShort(long offset,
int value) |
int |
sliceSize() |
protected static byte |
toByte(int byt) |
protected static byte |
toByte(long l) |
void |
transferInto(long inputOffset,
Volume target,
long targetOffset,
long size)
Transfers data from this Volume into target volume.
|
protected static boolean |
unmap(MappedByteBuffer b)
Hack to unmap MappedByteBuffer.
|
assertZeroes, close, copyEntireVolumeTo, deleteFile, ensureAvailable, fileLoad, finalize, getFile, getFileLocked, getLongPackBidi, getLongPackBidiReverse, hash, isClosed, length, putLongPackBidi, sync, truncate, volumeTransferprotected final boolean cleanerHackEnabled
protected final ReentrantLock growLock
protected final int sliceShift
protected final int sliceSizeModMask
protected final int sliceSize
protected volatile ByteBuffer[] slices
protected final boolean readOnly
protected Volume.ByteBufferVol(boolean readOnly,
int sliceShift,
boolean cleanerHackEnabled)
protected final ByteBuffer getSlice(long offset)
public void putData(long offset,
byte[] src,
int srcPos,
int srcSize)
public final void putData(long offset,
ByteBuffer buf)
public void transferInto(long inputOffset,
Volume target,
long targetOffset,
long size)
VolumetransferInto in class VolumeinputOffset - offset inside this Volume, ie data will be read from this offsettarget - Volume to copy data intotargetOffset - position in target volume where data will be copied intosize - size of data to copypublic void getData(long offset,
byte[] src,
int srcPos,
int srcSize)
public final DataIO.DataInputByteBuffer getDataInput(long offset, int size)
getDataInput in class Volumepublic void putDataOverlap(long offset,
byte[] data,
int pos,
int len)
putDataOverlap in class Volumepublic DataInput getDataInputOverlap(long offset, int size)
getDataInputOverlap in class Volumepublic void putUnsignedShort(long offset,
int value)
putUnsignedShort in class Volumepublic int getUnsignedShort(long offset)
getUnsignedShort in class Volumepublic int getUnsignedByte(long offset)
getUnsignedByte in class Volumepublic void putUnsignedByte(long offset,
int byt)
putUnsignedByte in class Volumeprotected static byte toByte(int byt)
protected static byte toByte(long l)
public long getSixLong(long pos)
getSixLong in class Volumepublic void putSixLong(long pos,
long value)
putSixLong in class Volumepublic int putPackedLong(long pos,
long value)
VolumeputPackedLong in class Volumevalue - to be writtenpublic long getPackedLong(long position)
Volumeresult & DataIO.PACK_LONG_RESULT_MASK to remove size;getPackedLong in class Volumeposition - to read value frompublic void clear(long startOffset,
long endOffset)
VolumestartOffset and endOffset to zero.
Area between offsets must be ready for write once clear finishes.public int sliceSize()
protected static boolean unmap(MappedByteBuffer b)
Copyright © 2015. All Rights Reserved.