rossi.fstools.fs.fatfs
Class FatTable

java.lang.Object
  extended byrossi.fstools.fs.fatfs.FatTable

public class FatTable
extends java.lang.Object

Class to lookup cluster pointers in the FAT table.


Constructor Summary
FatTable(FatSuperBlock sb, BlockReader br)
          Create a new FatTable object for managing access to the FAT.
 
Method Summary
 boolean isBad(int cluster)
          Return true if the given cluster number is bad.
 boolean isEOF(int cluster)
          Return true if the given cluster number is an EOF marker.
 boolean isFree(int cluster)
          Return true if the given cluster number is free (unallocated).
 int lookup(int cluster)
          Lookup the value for the given cluster in the FAT table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FatTable

public FatTable(FatSuperBlock sb,
                BlockReader br)
Create a new FatTable object for managing access to the FAT.

Parameters:
sb - a FatSuperBlock for this filesystem
br - a BlockReader initialized to read in sb.getSectorSize() blocks.
Method Detail

isEOF

public boolean isEOF(int cluster)
Return true if the given cluster number is an EOF marker.

Parameters:
cluster - number
Returns:
true if end of file mark.

isBad

public boolean isBad(int cluster)
Return true if the given cluster number is bad.

Parameters:
cluster - number
Returns:
true if marked bad.

isFree

public boolean isFree(int cluster)
Return true if the given cluster number is free (unallocated).

Parameters:
cluster - number
Returns:
true if free

lookup

public int lookup(int cluster)
           throws FsException,
                  java.io.IOException
Lookup the value for the given cluster in the FAT table.

Parameters:
cluster - a int
Returns:
value contained in the FAT for the given cluster.
Throws:
FsException
java.io.IOException - if an IO exception occurs.