Storage-equivalent instead.public class MemoryIoAdapter extends IoAdapter
MemoryIoAdapter memoryIoAdapter = new MemoryIoAdapter();
Db4o.configure().io(memoryIoAdapter);byte[] content of the in-memory files in
the _memoryFiles Hashtable in the adapter. After working with an in-memory
ObjectContainer/ObjectServer the byte[] content is available
in the MemoryIoAdapter by using get(String). To add old existing
database byte[] content to a MemoryIoAdapter use
put(String, byte[]). To reduce memory consumption of memory file
names that will no longer be used call put(String, byte[]) and pass
an empty byte array.| Constructor and Description |
|---|
MemoryIoAdapter()
Deprecated.
|
MemoryIoAdapter(int initialLength)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Deprecated.
for internal processing only.
|
void |
delete(java.lang.String path)
Deprecated.
|
boolean |
exists(java.lang.String path)
Deprecated.
for internal processing only.
|
byte[] |
get(java.lang.String name)
Deprecated.
returns the content bytes for a database with the given name.
|
long |
getLength()
Deprecated.
for internal processing only.
|
void |
growBy(int length)
Deprecated.
configures the length a memory file should grow, if no more free slots
are found within.
|
IoAdapter |
open(java.lang.String path,
boolean lockFile,
long initialLength,
boolean readOnly)
Deprecated.
for internal processing only.
|
void |
put(java.lang.String name,
byte[] bytes)
Deprecated.
creates an in-memory database with the passed content bytes and adds it
to the adapter for the specified name.
|
int |
read(byte[] bytes,
int length)
Deprecated.
for internal processing only.
|
void |
seek(long pos)
Deprecated.
for internal processing only.
|
void |
sync()
Deprecated.
for internal processing only.
|
void |
write(byte[] buffer,
int length)
Deprecated.
for internal processing only.
|
public MemoryIoAdapter()
public MemoryIoAdapter(int initialLength)
public void put(java.lang.String name,
byte[] bytes)
name - the name to be use for #openFile() or #openServer() callsbytes - the database contentpublic byte[] get(java.lang.String name)
name - the name to be use for #openFile() or #openServer() callspublic void growBy(int length)
length - the length in bytespublic void close()
throws Db4oIOException
close in class IoAdapterDb4oIOExceptionpublic void delete(java.lang.String path)
public boolean exists(java.lang.String path)
public long getLength()
throws Db4oIOException
getLength in class IoAdapterDb4oIOExceptionpublic IoAdapter open(java.lang.String path, boolean lockFile, long initialLength, boolean readOnly) throws Db4oIOException
open in class IoAdapterDb4oIOExceptionpublic int read(byte[] bytes,
int length)
throws Db4oIOException
read in class IoAdapterDb4oIOExceptionpublic void seek(long pos)
throws Db4oIOException
seek in class IoAdapterDb4oIOExceptionpublic void sync()
throws Db4oIOException
sync in class IoAdapterDb4oIOExceptionpublic void write(byte[] buffer,
int length)
throws Db4oIOException
write in class IoAdapterDb4oIOException