public static final class Volume.FileChannelVol 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 FileChannel |
channel |
static Volume.VolumeFactory |
FACTORY |
protected File |
file |
protected FileLock |
fileLock |
protected Lock |
growLock |
protected RandomAccessFile |
raf |
protected boolean |
readOnly |
protected long |
size |
protected int |
sliceSize |
closed, LOG, UNSAFE_VOL_FACTORY| Constructor and Description |
|---|
Volume.FileChannelVol(File file) |
Volume.FileChannelVol(File file,
boolean readOnly,
boolean fileLockDisabled,
int sliceShift,
long initSize) |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
checkFolder(File file,
boolean readOnly) |
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 size) |
DataIO.DataInputByteBuffer |
getDataInput(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) |
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 |
putInt(long offset,
int value) |
void |
putLong(long offset,
long value) |
protected void |
readFully(long offset,
ByteBuffer buf) |
int |
sliceSize() |
void |
sync() |
void |
truncate(long size) |
protected void |
writeFully(long offset,
ByteBuffer buf) |
assertZeroes, copyEntireVolumeTo, deleteFile, fileLoad, finalize, getDataInputOverlap, getLongPackBidi, getLongPackBidiReverse, getPackedLong, getSixLong, getUnsignedByte, getUnsignedShort, hash, isClosed, putDataOverlap, putLongPackBidi, putPackedLong, putSixLong, putUnsignedByte, putUnsignedShort, transferInto, volumeTransferpublic static final Volume.VolumeFactory FACTORY
protected final File file
protected final int sliceSize
protected RandomAccessFile raf
protected FileChannel channel
protected final boolean readOnly
protected final FileLock fileLock
protected volatile long size
protected final Lock growLock
public Volume.FileChannelVol(File file, boolean readOnly, boolean fileLockDisabled, int sliceShift, long initSize)
public Volume.FileChannelVol(File file)
protected static void checkFolder(File file, boolean readOnly) throws IOException
IOExceptionpublic void ensureAvailable(long offset)
VolumeensureAvailable in class Volumeprotected void writeFully(long offset,
ByteBuffer buf)
public void putData(long offset,
byte[] src,
int srcPos,
int srcSize)
public void putData(long offset,
ByteBuffer buf)
protected void readFully(long offset,
ByteBuffer buf)
public DataIO.DataInputByteBuffer getDataInput(long offset, int size)
getDataInput in class Volumepublic void getData(long offset,
byte[] bytes,
int bytesPos,
int size)
public void close()
public int sliceSize()
public File getFile()
Volumepublic boolean getFileLocked()
VolumegetFileLocked in class VolumeCopyright © 2015. All Rights Reserved.