CachingStorage instead.public class CachedIoAdapter extends IoAdapter
delegateAdapter = new RandomAccessFileAdapter();Db4o.configure().io(new CachedIoAdapter(delegateAdapter));| Constructor and Description |
|---|
CachedIoAdapter(IoAdapter ioAdapter)
Deprecated.
Creates an instance of CachedIoAdapter with the default page size and
page count.
|
CachedIoAdapter(IoAdapter ioAdapter,
int pageSize,
int pageCount)
Deprecated.
Creates an instance of CachedIoAdapter with a custom page size and page
count.
|
CachedIoAdapter(java.lang.String path,
boolean lockFile,
long initialLength,
boolean readOnly,
IoAdapter io,
int pageSize,
int pageCount)
Deprecated.
Creates an instance of CachedIoAdapter with extended parameters.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Deprecated.
Flushes and closes the file
|
IoAdapter |
delegatedIoAdapter()
Deprecated.
Delegated IO Adapter
|
void |
delete(java.lang.String path)
Deprecated.
Deletes the database file
|
boolean |
exists(java.lang.String path)
Deprecated.
Checks if the file exists
|
long |
getLength()
Deprecated.
Returns the file length
|
IoAdapter |
open(java.lang.String path,
boolean lockFile,
long initialLength,
boolean readOnly)
Deprecated.
Creates and returns a new CachedIoAdapter
|
int |
read(byte[] buffer,
int length)
Deprecated.
Reads the file into the buffer using pages from cache.
|
void |
seek(long pos)
Deprecated.
Moves the pointer to the specified file position
|
void |
sync()
Deprecated.
Flushes cache to a physical storage
|
void |
write(byte[] buffer,
int length)
Deprecated.
Writes the buffer to cache using pages
|
public CachedIoAdapter(IoAdapter ioAdapter)
ioAdapter - delegate IO adapter (RandomAccessFileAdapter by default)public CachedIoAdapter(IoAdapter ioAdapter, int pageSize, int pageCount)
ioAdapter - delegate IO adapter (RandomAccessFileAdapter by default)pageSize - cache page sizepageCount - allocated amount of pagespublic CachedIoAdapter(java.lang.String path,
boolean lockFile,
long initialLength,
boolean readOnly,
IoAdapter io,
int pageSize,
int pageCount)
throws Db4oIOException
path - database file pathlockFile - determines if the file should be lockedinitialLength - initial file length, new writes will start from this pointreadOnly - if the file should be used in read-onlyt mode.io - delegate IO adapter (RandomAccessFileAdapter by default)pageSize - cache page sizepageCount - allocated amount of pagesDb4oIOExceptionpublic IoAdapter open(java.lang.String path, boolean lockFile, long initialLength, boolean readOnly) throws Db4oIOException
open in class IoAdapterpath - database file pathlockFile - determines if the file should be lockedinitialLength - initial file length, new writes will start from this pointDb4oIOExceptionpublic void delete(java.lang.String path)
public boolean exists(java.lang.String path)
public int read(byte[] buffer,
int length)
throws Db4oIOException
read in class IoAdapterbuffer - destination bufferlength - how many bytes to readDb4oIOExceptionpublic void write(byte[] buffer,
int length)
throws Db4oIOException
write in class IoAdapterbuffer - source bufferlength - how many bytes to writeDb4oIOExceptionpublic void sync()
throws Db4oIOException
sync in class IoAdapterDb4oIOExceptionpublic long getLength()
throws Db4oIOException
getLength in class IoAdapterDb4oIOExceptionpublic void close()
throws Db4oIOException
close in class IoAdapterDb4oIOExceptionpublic IoAdapter delegatedIoAdapter()
IoAdapterdelegatedIoAdapter in class IoAdapterpublic void seek(long pos)
throws Db4oIOException
seek in class IoAdapterpos - position within the fileDb4oIOException