| java.lang.Object com.db4o.ext.MemoryFile
MemoryFile | public class MemoryFile (Code) | | carries in-memory data for db4o in-memory operation.
In-memory ObjectContainers are useful for maximum performance
on small databases, for swapping objects or for storing db4o format data
to other media or other databases.
Be aware of the danger of running
into OutOfMemory problems or complete loss of all data, in case of hardware
or JVM failures.
See Also: ExtDb4o.openMemoryFile |
Constructor Summary | |
public | MemoryFile() constructs a new MemoryFile without any data. | public | MemoryFile(byte[] bytes) constructs a MemoryFile to use the byte data from a previous
MemoryFile. |
Method Summary | |
public byte[] | getBytes() returns the raw byte data. | public int | getIncrementSizeBy() returns the size the MemoryFile is to be enlarged, if it grows beyond
the current size. | public int | getInitialSize() returns the initial size of the MemoryFile. | public void | setBytes(byte[] bytes) sets the raw byte data. | public void | setIncrementSizeBy(int byteCount) configures the size the MemoryFile is to be enlarged by, if it grows
beyond the current size.
Call this method before passing the MemoryFile to
com.db4o.ext.ExtDb4o.openMemoryFile(MemoryFile) .
This parameter can be modified to tune the maximum performance of
a MemoryFile for a specific usecase. | public void | setInitialSize(int byteCount) configures the initial size of the MemoryFile.
Call this method before passing the MemoryFile to
com.db4o.ext.ExtDb4o.openMemoryFile(MemoryFile) .
This parameter can be modified to tune the maximum performance of
a MemoryFile for a specific usecase. |
MemoryFile | public MemoryFile(byte[] bytes)(Code) | | constructs a MemoryFile to use the byte data from a previous
MemoryFile.
Parameters: bytes - the raw byte data. See Also: ExtDb4o.openMemoryFile |
getBytes | public byte[] getBytes()(Code) | | returns the raw byte data.
Use this method to get the byte data from the MemoryFile
to store it to other media or databases, for backup purposes or
to create other MemoryFile sessions.
The byte data from a MemoryFile should only be used
after it is closed.
bytes the raw byte data. |
getIncrementSizeBy | public int getIncrementSizeBy()(Code) | | returns the size the MemoryFile is to be enlarged, if it grows beyond
the current size.
size in bytes |
getInitialSize | public int getInitialSize()(Code) | | returns the initial size of the MemoryFile.
size in bytes |
setBytes | public void setBytes(byte[] bytes)(Code) | | sets the raw byte data.
Caution! Calling this method during a running
Memory File session may produce unpreditable results.
Parameters: bytes - the raw byte data. |
setIncrementSizeBy | public void setIncrementSizeBy(int byteCount)(Code) | | configures the size the MemoryFile is to be enlarged by, if it grows
beyond the current size.
Call this method before passing the MemoryFile to
com.db4o.ext.ExtDb4o.openMemoryFile(MemoryFile) .
This parameter can be modified to tune the maximum performance of
a MemoryFile for a specific usecase. To produce the best results,
test the speed of your application with real data.
Parameters: byteCount - the desired size in bytes |
setInitialSize | public void setInitialSize(int byteCount)(Code) | | configures the initial size of the MemoryFile.
Call this method before passing the MemoryFile to
com.db4o.ext.ExtDb4o.openMemoryFile(MemoryFile) .
This parameter can be modified to tune the maximum performance of
a MemoryFile for a specific usecase. To produce the best results,
test speed and memory consumption of your application with
real data.
Parameters: byteCount - the desired size in bytes |
|
|