|
db4o 8.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.db4o.io.BinDecorator
public class BinDecorator
Wrapper baseclass for all classes that wrap Bin.
Each class that adds functionality to a Bin must
extend this class to allow db4o to access the
delegate instance with StorageDecorator.decorate(BinConfiguration, Bin)
.
Constructor Summary | |
---|---|
BinDecorator(Bin bin)
Default constructor. |
Method Summary | |
---|---|
void |
close()
closes the BinDecorator and the underlying Bin . |
long |
length()
returns the length of the Bin (on disc, in memory). |
int |
read(long position,
byte[] bytes,
int bytesToRead)
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 position,
byte[] bytes,
int bytesToWrite)
writes a given number of bytes from an array of bytes at an offset position |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BinDecorator(Bin bin)
bin
- the Bin
that is to be wrapped.Method Detail |
---|
public void close()
Bin
.
close
in interface Bin
public long length()
Bin
length
in interface Bin
Bin.length()
public int read(long position, byte[] bytes, int bytesToRead)
Bin
read
in interface Bin
position
- the offset position to read atbytes
- the byte array to read bytes intobytesToRead
- the number of bytes to be read
Bin.read(long, byte[], int)
public void sync()
Bin
sync
in interface Bin
Bin.sync()
public int syncRead(long position, byte[] bytes, int bytesToRead)
Bin
Bin.read(long, byte[], int)
method, the Bin should ensure direct access to the raw storage medium.
No caching should take place.
syncRead
in interface Bin
position
- the offset position to read atbytes
- the byte array to read bytes intobytesToRead
- the number of bytes to be read
Bin.syncRead(long, byte[], int)
public void write(long position, byte[] bytes, int bytesToWrite)
Bin
write
in interface Bin
position
- the offset position to write atbytes
- the array of bytes to writebytesToWrite
- the number of bytes to writeBin.write(long, byte[], int)
public void sync(java.lang.Runnable runnable)
Bin
sync
in interface Bin
|
db4o 8.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |