public final class ByteArrayVol extends Volume
| Modifier and Type | Field and Description |
|---|---|
static VolumeFactory |
FACTORY |
protected java.util.concurrent.locks.ReentrantLock |
growLock |
protected byte[][] |
slices |
protected int |
sliceShift |
protected int |
sliceSize |
protected int |
sliceSizeModMask |
closed, LOG, UNSAFE_VOL_FACTORY| Constructor and Description |
|---|
ByteArrayVol() |
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 |
copyTo(long inputOffset,
Volume target,
long targetOffset,
long size)
Transfers data from this Volume into target volume.
|
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) |
DataInput2 |
getDataInput(long offset,
int size) |
DataInput2 |
getDataInputOverlap(long offset,
int size) |
java.io.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 |
isReadOnly() |
boolean |
isSliced() |
long |
length() |
void |
putByte(long offset,
byte value) |
void |
putData(long offset,
byte[] src,
int srcPos,
int srcSize) |
void |
putData(long offset,
java.nio.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 |
truncate(long size) |
assertZeroes, clearOverlap, copyFrom, copyTo, copyTo, deleteFile, fileLoad, finalize, getPackedLong, getSixLong, getUnsignedByte, getUnsignedShort, hash, isClosed, putPackedLong, putSixLong, putUnsignedByte, putUnsignedShortpublic static final VolumeFactory FACTORY
protected final java.util.concurrent.locks.ReentrantLock growLock
protected final int sliceShift
protected final int sliceSizeModMask
protected final int sliceSize
protected volatile byte[][] slices
public ByteArrayVol()
public 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,
java.nio.ByteBuffer buf)
public void copyTo(long inputOffset,
Volume target,
long targetOffset,
long size)
Volumepublic void putDataOverlap(long offset,
byte[] data,
int pos,
int len)
putDataOverlap in class Volumepublic DataInput2 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 DataInput2 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 boolean isReadOnly()
isReadOnly in class Volumepublic java.io.File getFile()
Volumepublic boolean getFileLocked()
VolumegetFileLocked in class VolumeCopyright © 2018. All Rights Reserved.