public static class FileStorage.FileBin extends java.lang.Object implements Bin
| Constructor and Description |
|---|
FileStorage.FileBin(BinConfiguration config) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
closes the Bin.
|
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)
writes a given number of bytes from an array of bytes at
an offset position
|
public FileStorage.FileBin(BinConfiguration config) throws Db4oIOException
Db4oIOExceptionpublic void close()
throws Db4oIOException
Binclose in interface BinDb4oIOExceptionpublic long length()
throws Db4oIOException
Binlength in interface BinDb4oIOExceptionpublic 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 write(long pos,
byte[] buffer,
int length)
throws Db4oIOException
Binwrite in interface Binpos - the offset position to write atbuffer - the array of bytes to writelength - the number of bytes to writeDb4oIOException