| java.lang.Object com.db4o.io.IoAdapter com.db4o.io.CachedIoAdapter
CachedIoAdapter | public class CachedIoAdapter extends IoAdapter (Code) | | CachedIoAdapter is an IOAdapter for random access files, which caches data
for IO access. Its functionality is similar to OS cache.
Example:
delegateAdapter = new RandomAccessFileAdapter();
Db4o.configure().io(new CachedIoAdapter(delegateAdapter));
|
CachedIoAdapter | public CachedIoAdapter(IoAdapter ioAdapter)(Code) | | Creates an instance of CachedIoAdapter with the default page size and
page count.
Parameters: ioAdapter - delegate IO adapter (RandomAccessFileAdapter by default) |
CachedIoAdapter | public CachedIoAdapter(IoAdapter ioAdapter, int pageSize, int pageCount)(Code) | | Creates an instance of CachedIoAdapter with a custom page size and page
count.
Parameters: ioAdapter - delegate IO adapter (RandomAccessFileAdapter by default) Parameters: pageSize - cache page size Parameters: pageCount - allocated amount of pages |
CachedIoAdapter | public CachedIoAdapter(String path, boolean lockFile, long initialLength, boolean readOnly, IoAdapter io, int pageSize, int pageCount) throws Db4oIOException(Code) | | Creates an instance of CachedIoAdapter with extended parameters.
Parameters: path - database file path Parameters: lockFile - determines if the file should be locked Parameters: initialLength - initial file length, new writes will start from this point Parameters: readOnly - if the file should be used in read-onlyt mode. Parameters: io - delegate IO adapter (RandomAccessFileAdapter by default) Parameters: pageSize - cache page size Parameters: pageCount - allocated amount of pages |
delete | public void delete(String path)(Code) | | Deletes the database file
Parameters: path - file path |
exists | public boolean exists(String path)(Code) | | Checks if the file exists
Parameters: path - file path |
open | public IoAdapter open(String path, boolean lockFile, long initialLength, boolean readOnly) throws Db4oIOException(Code) | | Creates and returns a new CachedIoAdapter
Parameters: path - database file path Parameters: lockFile - determines if the file should be locked Parameters: initialLength - initial file length, new writes will start from this point |
read | public int read(byte[] buffer, int length) throws Db4oIOException(Code) | | Reads the file into the buffer using pages from cache. If the next page
is not cached it will be read from the file.
Parameters: buffer - destination buffer Parameters: length - how many bytes to read |
seek | public void seek(long pos) throws Db4oIOException(Code) | | Moves the pointer to the specified file position
Parameters: pos - position within the file |
write | public void write(byte[] buffer, int length) throws Db4oIOException(Code) | | Writes the buffer to cache using pages
Parameters: buffer - source buffer Parameters: length - how many bytes to write |
Methods inherited from com.db4o.io.IoAdapter | public void blockCopy(int oldAddress, int oldAddressOffset, int newAddress, int newAddressOffset, int length) throws Db4oIOException(Code)(Java Doc) public void blockSeek(int address) throws Db4oIOException(Code)(Java Doc) public void blockSeek(int address, int offset) throws Db4oIOException(Code)(Java Doc) public void blockSize(int blockSize)(Code)(Java Doc) public int blockSize()(Code)(Java Doc) abstract public void close() throws Db4oIOException(Code)(Java Doc) public void copy(long oldAddress, long newAddress, int length) throws Db4oIOException(Code)(Java Doc) public IoAdapter delegatedIoAdapter()(Code)(Java Doc) abstract public void delete(String path)(Code)(Java Doc) abstract public boolean exists(String path)(Code)(Java Doc) abstract public long getLength() throws Db4oIOException(Code)(Java Doc) abstract public IoAdapter open(String path, boolean lockFile, long initialLength, boolean readOnly) throws Db4oIOException(Code)(Java Doc) public int read(byte[] buffer) throws Db4oIOException(Code)(Java Doc) abstract public int read(byte[] bytes, int length) throws Db4oIOException(Code)(Java Doc) final protected long regularAddress(int blockAddress, int blockAddressOffset)(Code)(Java Doc) abstract public void seek(long pos) throws Db4oIOException(Code)(Java Doc) abstract public void sync() throws Db4oIOException(Code)(Java Doc) public void write(byte[] bytes) throws Db4oIOException(Code)(Java Doc) abstract public void write(byte[] buffer, int length) throws Db4oIOException(Code)(Java Doc)
|
|
|