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, putUnsignedShort
public 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)
Volume
ensureAvailable
in class Volume
public 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)
Volume
public void putDataOverlap(long offset, byte[] data, int pos, int len)
putDataOverlap
in class Volume
public DataInput2 getDataInputOverlap(long offset, int size)
getDataInputOverlap
in class Volume
public void clear(long startOffset, long endOffset)
Volume
startOffset
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 Volume
public void getData(long offset, byte[] bytes, int bytesPos, int length)
public void close()
public int sliceSize()
public boolean isReadOnly()
isReadOnly
in class Volume
public java.io.File getFile()
Volume
public boolean getFileLocked()
Volume
getFileLocked
in class Volume
Copyright © 2018. All Rights Reserved.