Volume.ByteBufferVol, Volume.Factory, Volume.FileChannelVol, Volume.MappedFileVol, Volume.MemoryVol| Modifier and Type | Field and Description |
|---|---|
protected java.nio.channels.FileChannel |
channel |
protected int |
chunkSize |
protected java.io.File |
file |
protected java.lang.Object |
growLock |
protected boolean |
hasLimit |
protected java.io.RandomAccessFile |
raf |
protected boolean |
readOnly |
protected long |
size |
protected long |
sizeLimit |
| Constructor and Description |
|---|
FileChannelVol(java.io.File file,
boolean readOnly,
long sizeLimit,
int chunkShift,
int sizeIncrement) |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
checkFolder(java.io.File file,
boolean readOnly) |
void |
close() |
void |
deleteFile() |
byte |
getByte(long offset) |
DataInput2 |
getDataInput(long offset,
int size) |
java.io.File |
getFile()
returns underlying file if it exists
|
int |
getInt(long offset) |
long |
getLong(long offset) |
long |
getSixLong(long offset)
Reads a long from the indicated position
|
boolean |
isEmpty() |
boolean |
isSliced() |
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 value) |
void |
putSixLong(long offset,
long value)
Writes a long to the indicated position
|
protected void |
readFully(long offset,
java.nio.ByteBuffer buf) |
void |
sync() |
void |
truncate(long size) |
boolean |
tryAvailable(long offset) |
protected void |
writeFully(long offset,
java.nio.ByteBuffer buf) |
ensureAvailable, fileFactory, fileFactory, fileFactory, fileFactory, getPackedLong, getUnsignedByte, getUnsignedShort, memoryFactory, putPackedLong, putUnsignedByte, putUnsignedShort, volumeForFile, volumeForFile, volumeForFile, volumeTransferprotected final java.io.File file
protected final int chunkSize
protected java.io.RandomAccessFile raf
protected java.nio.channels.FileChannel channel
protected final boolean readOnly
protected final long sizeLimit
protected final boolean hasLimit
protected volatile long size
protected final java.lang.Object growLock
public FileChannelVol(java.io.File file,
boolean readOnly,
long sizeLimit,
int chunkShift,
int sizeIncrement)
protected static void checkFolder(java.io.File file,
boolean readOnly)
throws java.io.IOException
java.io.IOExceptionpublic boolean tryAvailable(long offset)
tryAvailable in class Volumeprotected void writeFully(long offset,
java.nio.ByteBuffer buf)
throws java.io.IOException
java.io.IOExceptionpublic final void putSixLong(long offset,
long value)
VolumeputSixLong in class Volumepublic void putData(long offset,
byte[] src,
int srcPos,
int srcSize)
public void putData(long offset,
java.nio.ByteBuffer buf)
protected void readFully(long offset,
java.nio.ByteBuffer buf)
throws java.io.IOException
java.io.IOExceptionpublic final long getSixLong(long offset)
VolumegetSixLong in class Volumepublic DataInput2 getDataInput(long offset, int size)
getDataInput in class Volumepublic void deleteFile()
deleteFile in class Volume