Package com.db4o.io
Class BlockAwareBin
- java.lang.Object
- 
- com.db4o.io.BinDecorator
- 
- com.db4o.io.BlockAwareBin
 
 
- 
- All Implemented Interfaces:
- Bin
 
 public class BlockAwareBin extends BinDecorator 
- 
- 
Field Summary- 
Fields inherited from class com.db4o.io.BinDecorator_bin
 
- 
 - 
Constructor SummaryConstructors Constructor Description BlockAwareBin(Bin bin)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidblockCopy(int oldAddress, int oldAddressOffset, int newAddress, int newAddressOffset, int length)copies a block within a file in block modeintblockRead(int address, byte[] buffer)reads a buffer at the seeked addressintblockRead(int address, byte[] bytes, int length)implement to read a buffer at the seeked addressintblockRead(int address, int offset, byte[] buffer)reads a buffer at the seeked addressintblockRead(int address, int offset, byte[] bytes, int length)implement to read a buffer at the seeked addressintblockSize()returns the block size currently usedvoidblockSize(int blockSize)outside call to set the block size of this adaptervoidblockWrite(int address, byte[] buffer)reads a buffer at the seeked addressvoidblockWrite(int address, byte[] bytes, int length)implement to read a buffer at the seeked addressvoidblockWrite(int address, int offset, byte[] buffer)reads a buffer at the seeked addressvoidblockWrite(int address, int offset, byte[] bytes, int length)implement to read a buffer at the seeked addressvoidcopy(long oldAddress, long newAddress, int length)copies a block within a file in absolute modeintread(long pos, byte[] buffer)reads a buffer at the seeked addressprotected longregularAddress(int blockAddress, int blockAddressOffset)converts address and address offset to an absolute addressvoidsync()flushes the buffer content to the physical storage media.voidsync(java.lang.Runnable runnable)runs the Runnable between two calls to sync();voidwrite(long pos, byte[] bytes)writes a buffer to the seeked address
 
- 
- 
- 
Constructor Detail- 
BlockAwareBinpublic BlockAwareBin(Bin bin) 
 
- 
 - 
Method Detail- 
regularAddressprotected final long regularAddress(int blockAddress, int blockAddressOffset)converts address and address offset to an absolute address
 - 
blockCopypublic void blockCopy(int oldAddress, int oldAddressOffset, int newAddress, int newAddressOffset, int length) throws Db4oIOExceptioncopies a block within a file in block mode- Throws:
- Db4oIOException
 
 - 
copypublic void copy(long oldAddress, long newAddress, int length) throws Db4oIOExceptioncopies a block within a file in absolute mode- Throws:
- Db4oIOException
 
 - 
blockReadpublic int blockRead(int address, int offset, byte[] buffer) throws Db4oIOExceptionreads a buffer at the seeked address- Returns:
- the number of bytes read and returned
- Throws:
- Db4oIOException
 
 - 
blockReadpublic int blockRead(int address, int offset, byte[] bytes, int length) throws Db4oIOExceptionimplement to read a buffer at the seeked address- Throws:
- Db4oIOException
 
 - 
blockReadpublic int blockRead(int address, byte[] buffer) throws Db4oIOExceptionreads a buffer at the seeked address- Returns:
- the number of bytes read and returned
- Throws:
- Db4oIOException
 
 - 
blockReadpublic int blockRead(int address, byte[] bytes, int length) throws Db4oIOExceptionimplement to read a buffer at the seeked address- Throws:
- Db4oIOException
 
 - 
readpublic int read(long pos, byte[] buffer) throws Db4oIOExceptionreads a buffer at the seeked address- Returns:
- the number of bytes read and returned
- Throws:
- Db4oIOException
 
 - 
blockWritepublic void blockWrite(int address, int offset, byte[] buffer) throws Db4oIOExceptionreads a buffer at the seeked address- Throws:
- Db4oIOException
 
 - 
blockWritepublic void blockWrite(int address, int offset, byte[] bytes, int length) throws Db4oIOExceptionimplement to read a buffer at the seeked address- Throws:
- Db4oIOException
 
 - 
blockWritepublic void blockWrite(int address, byte[] buffer) throws Db4oIOExceptionreads a buffer at the seeked address- Throws:
- Db4oIOException
 
 - 
blockWritepublic void blockWrite(int address, byte[] bytes, int length) throws Db4oIOExceptionimplement to read a buffer at the seeked address- Throws:
- Db4oIOException
 
 - 
syncpublic void sync() Description copied from interface:Binflushes the buffer content to the physical storage media.- Specified by:
- syncin interface- Bin
- Overrides:
- syncin class- BinDecorator
- See Also:
- Bin.sync()
 
 - 
syncpublic void sync(java.lang.Runnable runnable) Description copied from interface:Binruns the Runnable between two calls to sync();- Specified by:
- syncin interface- Bin
- Overrides:
- syncin class- BinDecorator
 
 - 
writepublic void write(long pos, byte[] bytes) throws Db4oIOExceptionwrites a buffer to the seeked address- Throws:
- Db4oIOException
 
 - 
blockSizepublic int blockSize() returns the block size currently used
 - 
blockSizepublic void blockSize(int blockSize) outside call to set the block size of this adapter
 
- 
 
-