public final class SingleByteArrayVol extends Volume
Modifier and Type | Field and Description |
---|---|
protected byte[] |
data |
protected static VolumeFactory |
FACTORY |
closed, LOG, UNSAFE_VOL_FACTORY
Constructor and Description |
---|
SingleByteArrayVol(byte[] data) |
SingleByteArrayVol(int size) |
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) |
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) |
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 |
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, getDataInputOverlap, getPackedLong, getSixLong, getUnsignedByte, getUnsignedShort, hash, isClosed, putDataOverlap, putPackedLong, putSixLong, putUnsignedByte, putUnsignedShort
protected static final VolumeFactory FACTORY
protected final byte[] data
public SingleByteArrayVol(int size)
public SingleByteArrayVol(byte[] data)
public 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 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.