Package com.db4o.io
Interface Bin
- 
- All Known Implementing Classes:
- BinDecorator,- BlockAwareBin,- FileStorage.FileBin,- MemoryBin,- PagingMemoryBin,- ReadOnlyBin,- SynchronizedBin,- ThreadedSyncBin
 
 public interface BinRepresentation of a container for storage of db4o database data (to file, to memory).
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()closes the Bin.longlength()returns the length of the Bin (on disc, in memory).intread(long position, byte[] bytes, int bytesToRead)reads a given number of bytes into an array of bytes at an offset position.voidsync()flushes the buffer content to the physical storage media.voidsync(java.lang.Runnable runnable)runs the Runnable between two calls to sync();intsyncRead(long position, byte[] bytes, int bytesToRead)reads a given number of bytes into an array of bytes at an offset position.voidwrite(long position, byte[] bytes, int bytesToWrite)writes a given number of bytes from an array of bytes at an offset position
 
- 
- 
- 
Method Detail- 
lengthlong length() returns the length of the Bin (on disc, in memory).
 - 
readint read(long position, byte[] bytes, int bytesToRead)reads a given number of bytes into an array of bytes at an offset position.- Parameters:
- position- the offset position to read at
- bytes- the byte array to read bytes into
- bytesToRead- the number of bytes to be read
- Returns:
- The number of bytes actually read (<= bytesToRead) or -1 if position already points to/exceeds the end of the bin
 
 - 
writevoid write(long position, byte[] bytes, int bytesToWrite)writes a given number of bytes from an array of bytes at an offset position- Parameters:
- position- the offset position to write at
- bytes- the array of bytes to write
- bytesToWrite- the number of bytes to write
 
 - 
syncvoid sync() flushes the buffer content to the physical storage media.
 - 
syncvoid sync(java.lang.Runnable runnable) runs the Runnable between two calls to sync();
 - 
syncReadint syncRead(long position, byte[] bytes, int bytesToRead)reads a given number of bytes into an array of bytes at an offset position. In contrast to the normalread(long, byte[], int)method, the Bin should ensure direct access to the raw storage medium. No caching should take place.- Parameters:
- position- the offset position to read at
- bytes- the byte array to read bytes into
- bytesToRead- the number of bytes to be read
- Returns:
 
 - 
closevoid close() closes the Bin.
 
- 
 
-