rossi.fstools.fs.reiserfs
Class DiskChild

java.lang.Object
  extended byrossi.fstools.fs.reiserfs.DiskChild
All Implemented Interfaces:
DiskStructure

public class DiskChild
extends java.lang.Object
implements DiskStructure

Representation of a DiskChild. DiskChild is an block-to-block pointer stored within InternalNode of the B+Tree in ReiserFS.

        31        24        16       8       0
        --------------------------------------
  0000  |        Block Number                |
        --------------------------------------
  0004  |        Size       | Reserved       |
        --------------------------------------


Field Summary
protected  long blockNumber
           
protected  int childSize
           
protected  int reserved
           
 
Constructor Summary
DiskChild()
           
 
Method Summary
 long getBlockNumber()
          Get the block number of the child block that we are pointing to.
 int getChildSize()
          Get the number of bytes used within the child block.
 int getDataSize()
          Get the size of this structure.
 int getReserved()
           
 void loadFromBuffer(byte[] buffer, int blkoffset)
          Load this structure from disk.
 void setBlockNumber(long aBlockNumber)
           
 void setChildSize(int aChildSize)
           
 void setReserved(int aReserved)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

blockNumber

protected long blockNumber

childSize

protected int childSize

reserved

protected int reserved
Constructor Detail

DiskChild

public DiskChild()
Method Detail

getDataSize

public int getDataSize()
Get the size of this structure.

Specified by:
getDataSize in interface DiskStructure
Returns:
size
See Also:
DiskStructure.getDataSize()

getBlockNumber

public long getBlockNumber()
Get the block number of the child block that we are pointing to.

Returns:
block number

setBlockNumber

public void setBlockNumber(long aBlockNumber)

getChildSize

public int getChildSize()
Get the number of bytes used within the child block.

Returns:
child size.

setChildSize

public void setChildSize(int aChildSize)

getReserved

public int getReserved()

setReserved

public void setReserved(int aReserved)

loadFromBuffer

public void loadFromBuffer(byte[] buffer,
                           int blkoffset)
                    throws FsException
Load this structure from disk.

Specified by:
loadFromBuffer in interface DiskStructure
Parameters:
blkoffset - offset within buffer where data begins.
buffer - a byte[] containing data to be read in populating the object
Throws:
FsException - if a parse error occurs
See Also:
DiskStructure.loadFromBuffer(byte[], int)