| Constructor and Description |
|---|
MemoryBin(byte[] bytes,
GrowthStrategy growthStrategy) |
MemoryBin(int initialSize,
GrowthStrategy growthStrategy) |
| Modifier and Type | Method and Description |
|---|---|
long |
bufferSize() |
void |
close()
closes the Bin.
|
byte[] |
data()
Returns a copy of the raw data contained in this bin for external processing.
|
long |
length()
returns the length of the Bin (on disc, in memory).
|
int |
read(long pos,
byte[] bytes,
int length)
reads a given number of bytes into an array of bytes at an
offset position.
|
void |
sync()
flushes the buffer content to the physical storage
media.
|
void |
sync(java.lang.Runnable runnable)
runs the Runnable between two calls to sync();
|
int |
syncRead(long position,
byte[] bytes,
int bytesToRead)
reads a given number of bytes into an array of bytes at an
offset position.
|
void |
write(long pos,
byte[] buffer,
int length)
for internal processing only.
|
public MemoryBin(int initialSize,
GrowthStrategy growthStrategy)
public MemoryBin(byte[] bytes,
GrowthStrategy growthStrategy)
public long length()
Binpublic long bufferSize()
public int read(long pos,
byte[] bytes,
int length)
throws Db4oIOException
Binread in interface Binpos - the offset position to read atbytes - the byte array to read bytes intolength - the number of bytes to be readDb4oIOExceptionpublic void sync()
throws Db4oIOException
Binsync in interface BinDb4oIOExceptionpublic int syncRead(long position,
byte[] bytes,
int bytesToRead)
BinBin.read(long, byte[], int)
method, the Bin should ensure direct access to the raw storage medium.
No caching should take place.public void close()
Binpublic byte[] data()
public void write(long pos,
byte[] buffer,
int length)
throws Db4oIOException
write in interface Binpos - the offset position to write atbuffer - the array of bytes to writelength - the number of bytes to writeDb4oIOException