public static final class Volume.ByteArrayVol 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 |
|---|---|
static Volume.VolumeFactory |
FACTORY |
protected ReentrantLock |
growLock |
protected byte[][] |
slices |
protected int |
sliceShift |
protected int |
sliceSize |
protected int |
sliceSizeModMask |
closed, LOG, UNSAFE_VOL_FACTORY| Modifier | Constructor and Description |
|---|---|
protected |
Volume.ByteArrayVol() |
protected |
Volume.ByteArrayVol(int sliceShift,
long initSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear(long startOffset,
long endOffset)
Set all bytes between
startOffset and endOffset to zero. |
void |
close() |
void |
ensureAvailable(long offset)
Check space allocated by Volume is bigger or equal to given offset.
|
byte |
getByte(long offset) |
void |
getData(long offset,
byte[] bytes,
int bytesPos,
int length) |
DataInput |
getDataInput(long offset,
int size) |
DataInput |
getDataInputOverlap(long offset,
int size) |
File |
getFile()
returns underlying file if it exists
|
boolean |
getFileLocked()
return true if this Volume holds exclusive lock over its file
|
int |
getInt(long offset) |
long |
getLong(long offset) |
protected byte[] |
getSlice(long offset) |
boolean |
isSliced() |
long |
length() |
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 v) |
int |
sliceSize() |
void |
sync() |
void |
transferInto(long inputOffset,
Volume target,
long targetOffset,
long size)
Transfers data from this Volume into target volume.
|
void |
truncate(long size) |
assertZeroes, copyEntireVolumeTo, deleteFile, fileLoad, finalize, getLongPackBidi, getLongPackBidiReverse, getPackedLong, getSixLong, getUnsignedByte, getUnsignedShort, hash, isClosed, putLongPackBidi, putPackedLong, putSixLong, putUnsignedByte, putUnsignedShort, volumeTransferpublic static final Volume.VolumeFactory FACTORY
protected final ReentrantLock growLock
protected final int sliceShift
protected final int sliceSizeModMask
protected final int sliceSize
protected volatile byte[][] slices
protected Volume.ByteArrayVol()
protected Volume.ByteArrayVol(int sliceShift,
long initSize)
protected final byte[] getSlice(long offset)
public final void ensureAvailable(long offset)
VolumeensureAvailable in class Volumepublic void putData(long offset,
byte[] src,
int srcPos,
int srcSize)
public 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 putDataOverlap(long offset,
byte[] data,
int pos,
int len)
putDataOverlap in class Volumepublic DataInput getDataInputOverlap(long offset, int size)
getDataInputOverlap in class Volumepublic void clear(long startOffset,
long endOffset)
VolumestartOffset and endOffset to zero.
Area between offsets must be ready for write once clear finishes.public DataInput getDataInput(long offset, int size)
getDataInput in class Volumepublic void getData(long offset,
byte[] bytes,
int bytesPos,
int length)
public void close()
public int sliceSize()
public File getFile()
Volumepublic boolean getFileLocked()
VolumegetFileLocked in class VolumeCopyright © 2015. All Rights Reserved.