Volume.ByteBufferVol, Volume.Factory, Volume.FileChannelVol, Volume.MappedFileVol, Volume.MemoryVol
Modifier and Type | Field and Description |
---|---|
protected FileChannel |
channel |
protected int |
chunkSize |
protected File |
file |
protected Object |
growLock |
protected boolean |
hasLimit |
protected RandomAccessFile |
raf |
protected boolean |
readOnly |
protected long |
size |
protected long |
sizeLimit |
Constructor and Description |
---|
Volume.FileChannelVol(File file,
boolean readOnly,
long sizeLimit,
int chunkShift,
int sizeIncrement) |
Modifier and Type | Method and Description |
---|---|
protected static void |
checkFolder(File file,
boolean readOnly) |
void |
close() |
void |
deleteFile() |
byte |
getByte(long offset) |
DataInput2 |
getDataInput(long offset,
int size) |
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,
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,
ByteBuffer buf) |
void |
sync() |
void |
truncate(long size) |
boolean |
tryAvailable(long offset) |
protected void |
writeFully(long offset,
ByteBuffer buf) |
ensureAvailable, fileFactory, fileFactory, getPackedLong, getUnsignedByte, getUnsignedShort, memoryFactory, putPackedLong, putUnsignedByte, putUnsignedShort, volumeForFile, volumeTransfer
protected final File file
protected final int chunkSize
protected RandomAccessFile raf
protected FileChannel channel
protected final boolean readOnly
protected final long sizeLimit
protected final boolean hasLimit
protected volatile long size
protected final Object growLock
public Volume.FileChannelVol(File file, boolean readOnly, long sizeLimit, int chunkShift, int sizeIncrement)
protected static void checkFolder(File file, boolean readOnly) throws IOException
IOException
public boolean tryAvailable(long offset)
tryAvailable
in class Volume
protected void writeFully(long offset, ByteBuffer buf) throws IOException
IOException
public final void putSixLong(long offset, long value)
Volume
putSixLong
in class Volume
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) throws IOException
IOException
public final long getSixLong(long offset)
Volume
getSixLong
in class Volume
public DataInput2 getDataInput(long offset, int size)
getDataInput
in class Volume
public void deleteFile()
deleteFile
in class Volume
Copyright © 2014. All Rights Reserved.