FileNioMemData

This class contains the data of an in-memory random access file. Data compression using the LZF algorithm is supported as well.

Methods
boolean canWrite()
Check whether writing is allowed.
boolean canWrite()
Check whether writing is allowed.
Returns:
true if it is
void compressPage(int page)
Compress the data in a byte array.
void compressPage(int page)
Compress the data in a byte array.
Parameters:
page - which page to compress
long getLastModified()
Get the last modified time.
long getLastModified()
Get the last modified time.
Returns:
the time
String getName()
Get the file name
String getName()
Get the file name
Returns:
the name
long length()
Get the file length.
long length()
Get the file length.
Returns:
the length
boolean lockExclusive()
Lock the file in exclusive mode if possible.
boolean lockExclusive()
Lock the file in exclusive mode if possible.
Returns:
if locking was successful
boolean lockShared()
Lock the file in shared mode if possible.
boolean lockShared()
Lock the file in shared mode if possible.
Returns:
if locking was successful
long readWrite(long pos, ByteBuffer b, int off, int len, boolean write)
Read or write.
long readWrite(long pos, ByteBuffer b, int off, int len, boolean write)
Read or write.
Parameters:
pos - the position
b - the byte array
off - the offset within the byte array
len - the number of bytes
write - true for writing
Returns:
the new position
void setName(String name)
Set the file name.
void setName(String name)
Set the file name.
Parameters:
name - the name
boolean setReadOnly()
Set the read-only flag.
boolean setReadOnly()
Set the read-only flag.
Returns:
true
void touch(boolean openReadOnly)
Update the last modified time.
void touch(boolean openReadOnly) throws IOException
Update the last modified time.
Parameters:
openReadOnly - if the file was opened in read-only mode
void truncate(long newLength)
Truncate the file.
void truncate(long newLength)
Truncate the file.
Parameters:
newLength - the new length
void unlock()
Unlock the file.
void unlock()
Unlock the file.

Fields
static int nameHashCode

nameHashCode

The hash code of the name.