rossi.fstools.io
Class BlockIO

java.lang.Object
  extended byrossi.fstools.io.BlockIO
All Implemented Interfaces:
BlockReader

public class BlockIO
extends java.lang.Object
implements BlockReader


Field Summary
protected  int blockSize
           
protected  BlockCache cache
           
protected  java.io.RandomAccessFile file
           
protected  long offset
           
 
Constructor Summary
BlockIO(java.io.RandomAccessFile f, int blockSize)
           
BlockIO(java.io.RandomAccessFile f, int blockSize, long offset)
           
 
Method Summary
 void close()
          Close this file
 byte[] getBlock(int blkno)
          Reads a block
 int getBlockSize()
          Gets the block size
 void setBlockSize(int aBlockSize)
          Sets the block size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

protected java.io.RandomAccessFile file

blockSize

protected int blockSize

cache

protected BlockCache cache

offset

protected long offset
Constructor Detail

BlockIO

public BlockIO(java.io.RandomAccessFile f,
               int blockSize)

BlockIO

public BlockIO(java.io.RandomAccessFile f,
               int blockSize,
               long offset)
Method Detail

getBlockSize

public int getBlockSize()
Description copied from interface: BlockReader
Gets the block size

Specified by:
getBlockSize in interface BlockReader

setBlockSize

public void setBlockSize(int aBlockSize)
Description copied from interface: BlockReader
Sets the block size

Specified by:
setBlockSize in interface BlockReader

getBlock

public byte[] getBlock(int blkno)
                throws java.io.IOException
Description copied from interface: BlockReader
Reads a block

Specified by:
getBlock in interface BlockReader
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Close this file

Specified by:
close in interface BlockReader
Throws:
java.io.IOException