| java.lang.Object jdbm.recman.BlockIo
BlockIo | final public class BlockIo implements java.io.Externalizable(Code) | | This class wraps a page-sized byte array and provides methods
to read and write data to and from it. The readers and writers
are just the ones that the rest of the toolkit needs, nothing else.
Values written are compatible with java.io routines.
See Also: java.io.DataInput See Also: java.io.DataOutput |
Constructor Summary | |
public | BlockIo() | | BlockIo(long blockId, byte[] data) Constructs a new BlockIo instance working on the indicated
buffer. |
serialVersionUID | final public static long serialVersionUID(Code) | | |
BlockIo | public BlockIo()(Code) | | Default constructor for serialization
|
BlockIo | BlockIo(long blockId, byte[] data)(Code) | | Constructs a new BlockIo instance working on the indicated
buffer.
|
decrementTransactionCount | synchronized void decrementTransactionCount()(Code) | | Decrements transaction count for this block, to signal that this
block has been written from the log to the data file.
|
getBlockId | long getBlockId()(Code) | | Returns the block number.
|
getData | byte[] getData()(Code) | | Returns the underlying array
|
getView | public BlockView getView()(Code) | | Returns the current view of the block.
|
incrementTransactionCount | synchronized void incrementTransactionCount()(Code) | | Increments transaction count for this block, to signal that this
block is in the log but not yet in the data file. The method also
takes a snapshot so that the data may be modified in new transactions.
|
isDirty | boolean isDirty()(Code) | | Returns true if the dirty flag is set.
|
isInTransaction | boolean isInTransaction()(Code) | | Returns true if the block is still dirty with respect to the
transaction log.
|
readByte | public byte readByte(int pos)(Code) | | Reads a byte from the indicated position
|
readInt | public int readInt(int pos)(Code) | | Reads an int from the indicated position
|
readLong | public long readLong(int pos)(Code) | | Reads a long from the indicated position
|
readShort | public short readShort(int pos)(Code) | | Reads a short from the indicated position
|
setBlockId | void setBlockId(long id)(Code) | | Sets the block number. Should only be called by RecordFile.
|
setClean | void setClean()(Code) | | Clears the dirty flag
|
setDirty | void setDirty()(Code) | | Sets the dirty flag
|
setView | public void setView(BlockView view)(Code) | | Sets the current view of the block.
|
writeByte | public void writeByte(int pos, byte value)(Code) | | Writes a byte to the indicated position
|
writeInt | public void writeInt(int pos, int value)(Code) | | Writes an int to the indicated position
|
writeLong | public void writeLong(int pos, long value)(Code) | | Writes a long to the indicated position
|
writeShort | public void writeShort(int pos, short value)(Code) | | Writes a short to the indicated position
|
|
|