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 Summary
Constructors Constructor Description BlockAwareBin(Bin bin)
-
Method Summary
All 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
-
BlockAwareBin
public BlockAwareBin(Bin bin)
-
-
Method Detail
-
regularAddress
protected final long regularAddress(int blockAddress, int blockAddressOffset)converts address and address offset to an absolute address
-
blockCopy
public void blockCopy(int oldAddress, int oldAddressOffset, int newAddress, int newAddressOffset, int length) throws Db4oIOExceptioncopies a block within a file in block mode- Throws:
Db4oIOException
-
copy
public void copy(long oldAddress, long newAddress, int length) throws Db4oIOExceptioncopies a block within a file in absolute mode- Throws:
Db4oIOException
-
blockRead
public 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
-
blockRead
public int blockRead(int address, int offset, byte[] bytes, int length) throws Db4oIOExceptionimplement to read a buffer at the seeked address- Throws:
Db4oIOException
-
blockRead
public int blockRead(int address, byte[] buffer) throws Db4oIOExceptionreads a buffer at the seeked address- Returns:
- the number of bytes read and returned
- Throws:
Db4oIOException
-
blockRead
public int blockRead(int address, byte[] bytes, int length) throws Db4oIOExceptionimplement to read a buffer at the seeked address- Throws:
Db4oIOException
-
read
public int read(long pos, byte[] buffer) throws Db4oIOExceptionreads a buffer at the seeked address- Returns:
- the number of bytes read and returned
- Throws:
Db4oIOException
-
blockWrite
public void blockWrite(int address, int offset, byte[] buffer) throws Db4oIOExceptionreads a buffer at the seeked address- Throws:
Db4oIOException
-
blockWrite
public void blockWrite(int address, int offset, byte[] bytes, int length) throws Db4oIOExceptionimplement to read a buffer at the seeked address- Throws:
Db4oIOException
-
blockWrite
public void blockWrite(int address, byte[] buffer) throws Db4oIOExceptionreads a buffer at the seeked address- Throws:
Db4oIOException
-
blockWrite
public void blockWrite(int address, byte[] bytes, int length) throws Db4oIOExceptionimplement to read a buffer at the seeked address- Throws:
Db4oIOException
-
sync
public void sync()
Description copied from interface:Binflushes the buffer content to the physical storage media.- Specified by:
syncin interfaceBin- Overrides:
syncin classBinDecorator- See Also:
Bin.sync()
-
sync
public void sync(java.lang.Runnable runnable)
Description copied from interface:Binruns the Runnable between two calls to sync();- Specified by:
syncin interfaceBin- Overrides:
syncin classBinDecorator
-
write
public void write(long pos, byte[] bytes) throws Db4oIOExceptionwrites a buffer to the seeked address- Throws:
Db4oIOException
-
blockSize
public int blockSize()
returns the block size currently used
-
blockSize
public void blockSize(int blockSize)
outside call to set the block size of this adapter
-
-