public class NIOFileAdapter extends IoAdapter
| Constructor and Description |
|---|
NIOFileAdapter(int pageSize,
int lruLimit) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
implement to close the adapter
|
void |
delete(java.lang.String path)
deletes the given path from whatever 'file system' is addressed
|
boolean |
exists(java.lang.String path)
checks whether a file exists
|
long |
getLength()
implement to return the absolute length of the file
|
void |
lock() |
IoAdapter |
open(java.lang.String path,
boolean lockFile,
long initialLength,
boolean readOnly)
implement to open the file
|
int |
read(byte[] bytes,
int length)
implement to read a buffer at the seeked address
|
void |
seek(long position)
implement to set the read/write pointer in the file, absolute mode
|
void |
sync()
implement to flush the file contents to storage
|
void |
unlock() |
void |
write(byte[] bytes,
int length)
implement to write a buffer at the seeked address
|
public void seek(long position)
throws Db4oIOException
IoAdapterseek in class IoAdapterDb4oIOExceptionpublic void close()
throws Db4oIOException
IoAdapterclose in class IoAdapterDb4oIOExceptionpublic void delete(java.lang.String path)
IoAdapterpublic boolean exists(java.lang.String path)
IoAdapterpublic long getLength()
throws Db4oIOException
IoAdaptergetLength in class IoAdapterDb4oIOExceptionpublic int read(byte[] bytes,
int length)
throws Db4oIOException
IoAdapterread in class IoAdapterDb4oIOExceptionpublic void write(byte[] bytes,
int length)
throws Db4oIOException
IoAdapterwrite in class IoAdapterDb4oIOExceptionpublic void sync()
throws Db4oIOException
IoAdaptersync in class IoAdapterDb4oIOExceptionpublic void unlock()
public void lock()
public IoAdapter open(java.lang.String path, boolean lockFile, long initialLength, boolean readOnly) throws Db4oIOException
IoAdapteropen in class IoAdapterDb4oIOException