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 void
blockCopy(int oldAddress, int oldAddressOffset, int newAddress, int newAddressOffset, int length)
copies a block within a file in block modeint
blockRead(int address, byte[] buffer)
reads a buffer at the seeked addressint
blockRead(int address, byte[] bytes, int length)
implement to read a buffer at the seeked addressint
blockRead(int address, int offset, byte[] buffer)
reads a buffer at the seeked addressint
blockRead(int address, int offset, byte[] bytes, int length)
implement to read a buffer at the seeked addressint
blockSize()
returns the block size currently usedvoid
blockSize(int blockSize)
outside call to set the block size of this adaptervoid
blockWrite(int address, byte[] buffer)
reads a buffer at the seeked addressvoid
blockWrite(int address, byte[] bytes, int length)
implement to read a buffer at the seeked addressvoid
blockWrite(int address, int offset, byte[] buffer)
reads a buffer at the seeked addressvoid
blockWrite(int address, int offset, byte[] bytes, int length)
implement to read a buffer at the seeked addressvoid
copy(long oldAddress, long newAddress, int length)
copies a block within a file in absolute modeint
read(long pos, byte[] buffer)
reads a buffer at the seeked addressprotected long
regularAddress(int blockAddress, int blockAddressOffset)
converts address and address offset to an absolute addressvoid
sync()
flushes the buffer content to the physical storage media.void
sync(java.lang.Runnable runnable)
runs the Runnable between two calls to sync();void
write(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 Db4oIOException
copies a block within a file in block mode- Throws:
Db4oIOException
-
copy
public void copy(long oldAddress, long newAddress, int length) throws Db4oIOException
copies a block within a file in absolute mode- Throws:
Db4oIOException
-
blockRead
public int blockRead(int address, int offset, byte[] buffer) throws Db4oIOException
reads 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 Db4oIOException
implement to read a buffer at the seeked address- Throws:
Db4oIOException
-
blockRead
public int blockRead(int address, byte[] buffer) throws Db4oIOException
reads 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 Db4oIOException
implement to read a buffer at the seeked address- Throws:
Db4oIOException
-
read
public int read(long pos, byte[] buffer) throws Db4oIOException
reads 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 Db4oIOException
reads a buffer at the seeked address- Throws:
Db4oIOException
-
blockWrite
public void blockWrite(int address, int offset, byte[] bytes, int length) throws Db4oIOException
implement to read a buffer at the seeked address- Throws:
Db4oIOException
-
blockWrite
public void blockWrite(int address, byte[] buffer) throws Db4oIOException
reads a buffer at the seeked address- Throws:
Db4oIOException
-
blockWrite
public void blockWrite(int address, byte[] bytes, int length) throws Db4oIOException
implement to read a buffer at the seeked address- Throws:
Db4oIOException
-
sync
public void sync()
Description copied from interface:Bin
flushes the buffer content to the physical storage media.- Specified by:
sync
in interfaceBin
- Overrides:
sync
in classBinDecorator
- See Also:
Bin.sync()
-
sync
public void sync(java.lang.Runnable runnable)
Description copied from interface:Bin
runs the Runnable between two calls to sync();- Specified by:
sync
in interfaceBin
- Overrides:
sync
in classBinDecorator
-
write
public void write(long pos, byte[] bytes) throws Db4oIOException
writes 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
-
-