|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectorg.garret.perst.MappedFile
public class MappedFile
Class using NIO mapping file on virtual mapping. Useing this class instead standard OSFile can significantly increase speed of application in some cases.
| Constructor Summary | |
|---|---|
MappedFile(java.lang.String filePath,
long initialSize,
boolean readOnly)
|
|
| Method Summary | |
|---|---|
void |
close()
Close file |
long |
length()
Length of the file |
void |
lock(boolean shared)
Lock file |
int |
read(long pos,
byte[] buf)
Read data from the file |
void |
sync()
Flush all fiels changes to the disk |
boolean |
tryLock(boolean shared)
Try lock file |
void |
unlock()
Unlock file |
void |
write(long pos,
byte[] buf)
Write data to the file |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MappedFile(java.lang.String filePath,
long initialSize,
boolean readOnly)
| Method Detail |
|---|
public void close()
IFile
close in interface IFilepublic long length()
IFile
length in interface IFilepublic void lock(boolean shared)
IFile
lock in interface IFileshared - if lock is shared
public int read(long pos,
byte[] buf)
IFile
read in interface IFilepos - offset in the filebuf - array to receive readen data (size is always equal to database page size)
public void sync()
IFile
sync in interface IFilepublic boolean tryLock(boolean shared)
IFile
tryLock in interface IFileshared - if lock is shared
true if file was successfully locked or locking in not implemented,
false if file is locked by some other applciationpublic void unlock()
IFile
unlock in interface IFile
public void write(long pos,
byte[] buf)
IFile
write in interface IFilepos - offset in the filebuf - array with data to be writter (size is always equal to database page size)
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||