jdbm.recman
Class BlockIo

java.lang.Object
  extended by jdbm.recman.BlockIo

public final class BlockIo
extends java.lang.Object

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:
DataInput, DataOutput

Constructor Summary
BlockIo()
          Default constructor for serialization
 
Method Summary
 jdbm.recman.BlockView getView()
          Returns the current view of the block.
 byte readByte(int pos)
          Reads a byte from the indicated position
 void readExternal(java.io.DataInputStream in)
           
 int readInt(int pos)
          Reads an int from the indicated position
 long readLong(int pos)
          Reads a long from the indicated position
 short readShort(int pos)
          Reads a short from the indicated position
 long readSixByteLong(int pos)
          Reads a long from the indicated position
 int readThreeByteInt(int pos)
          Reads an int from the indicated position
 int readUnsignedshort(int pos)
           
 void setView(jdbm.recman.BlockView view)
          Sets the current view of the block.
 java.lang.String toString()
           
 void writeByte(int pos, byte value)
          Writes a byte to the indicated position
 void writeExternal(java.io.DataOutputStream out)
           
 void writeInt(int pos, int value)
          Writes an int to the indicated position
 void writeLong(int pos, long value)
          Writes a long to the indicated position
 void writeShort(int pos, short value)
          Writes a short to the indicated position
 void writeSixByteLong(int pos, long value)
          Writes a long to the indicated position
 void writeThreeByteInt(int pos, int value)
          Writes an int to the indicated position
 void writeUnsignedShort(int pos, int value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BlockIo

public BlockIo()
Default constructor for serialization

Method Detail

getView

public jdbm.recman.BlockView getView()
Returns the current view of the block.


setView

public void setView(jdbm.recman.BlockView view)
Sets the current view of the block.


readByte

public byte readByte(int pos)
Reads a byte from the indicated position


writeByte

public void writeByte(int pos,
                      byte value)
Writes a byte to the indicated position


readShort

public short readShort(int pos)
Reads a short from the indicated position


writeShort

public void writeShort(int pos,
                       short value)
Writes a short to the indicated position


readInt

public int readInt(int pos)
Reads an int from the indicated position


writeInt

public void writeInt(int pos,
                     int value)
Writes an int to the indicated position


readThreeByteInt

public int readThreeByteInt(int pos)
Reads an int from the indicated position


writeThreeByteInt

public void writeThreeByteInt(int pos,
                              int value)
Writes an int to the indicated position


readLong

public long readLong(int pos)
Reads a long from the indicated position


writeLong

public void writeLong(int pos,
                      long value)
Writes a long to the indicated position


readSixByteLong

public long readSixByteLong(int pos)
Reads a long from the indicated position


writeSixByteLong

public void writeSixByteLong(int pos,
                             long value)
Writes a long to the indicated position


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

readExternal

public void readExternal(java.io.DataInputStream in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.DataOutputStream out)
                   throws java.io.IOException
Throws:
java.io.IOException

writeUnsignedShort

public void writeUnsignedShort(int pos,
                               int value)

readUnsignedshort

public int readUnsignedshort(int pos)


Cees de Groot (C) 2000. All rights reserved http://jdbm.sourceforge.net