|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrossi.fstools.fs.fatfs.FatSuperBlock
Representation of FAT superblock.
On disk the superblock looks like this:
31 24 16 8 0
--------------------------------------
0000 | Bootstrap | SysID |
--------------------------------------
0004 | System ID |
--------------------------------------
0008 | System ID |SectSze|
--------------------------------------
000C |SectSze |SecPerClus| Reserved Sects |
--------------------------------------
0010 |NumFats | Root Dir Entries |sectors|
--------------------------------------
0014 |sectors | Media | Fat Length |
--------------------------------------
0018 |Sectors per Track | Heads |
--------------------------------------
001C | Hidden Sectors |
--------------------------------------
0020 | Total Sectors |
--------------------------------------
0024 | Fat32 length |
--------------------------------------
0028 | Flags | Version |
--------------------------------------
002C | Root cluster |
--------------------------------------
0030 | Info Sector | backup boot |
--------------------------------------
0034 | Reserved |
--------------------------------------
| Field Summary | |
protected int |
backupBootSector
|
protected byte[] |
bootStrap
|
protected long |
fat32Length
|
protected int |
fatLength
|
protected int |
flags
|
protected int |
heads
|
protected long |
hiddenSectors
|
protected int |
infoSector
|
static int |
MAX_FAT12
Max number of clusters for FAT12. |
static int |
MAX_FAT16
Max number of clusters for FAT16. |
static int |
MAX_FAT32
Max number of clusters for FAT32. |
protected byte |
media
|
protected int |
numFATs
|
protected int |
reservedSectors
|
protected long |
rootCluster
|
protected int |
rootDirEntries
|
protected int |
sectors
|
protected int |
sectorSize
|
protected int |
sectorsPerCluster
|
protected int |
sectorsPerTrack
|
protected java.lang.String |
systemId
|
protected long |
totalSectors
|
protected int |
version
|
| Constructor Summary | |
FatSuperBlock()
Default constructor. |
|
| Method Summary | |
int |
getBackupBootSector()
Get the sector address of the backup boot sector. |
byte[] |
getBootStrap()
Return the first 3 bytes of the filesystem. |
int |
getDataSize()
Get the size in bytes of the structure. |
long |
getFat32Length()
Get the length of the FAT in sectors for a FAT32 system. |
int |
getFatBits()
Get the number bits per entry in the FAT. |
int |
getFatLength()
FAT length in sectors. |
int |
getFirstDataSector()
Get the sector address of the first data sector (cluster 2). |
int |
getFlags()
Not sure what this is for. |
int |
getHeads()
Number of heads. |
long |
getHiddenSectors()
Number of hidden sectors. |
int |
getInfoSector()
Get the sector address of the FAT32 info block. |
byte |
getMedia()
Media descriptor byte. |
long |
getNumClusters()
Get the number of clusters. |
int |
getNumFATs()
Get the number of FAT tables. |
long |
getNumSectors()
Get the number of sectors in the filesystem. |
int |
getReservedSectors()
Get the number of reserved sectors. |
long |
getRootCluster()
Get the first cluster of the root directory. |
int |
getRootDirEntries()
Get the number of root directory entries. |
int |
getSectors()
Get the count of sectors in the FS. |
int |
getSectorSize()
Sector size. |
int |
getSectorsPerCluster()
Get number of sectors per cluster. |
int |
getSectorsPerTrack()
Number of sectors per track. |
java.lang.String |
getSystemId()
Get the system identifier. |
long |
getTotalSectors()
Total sectors in the filesystem. |
int |
getVersion()
Get the filesystem version. |
void |
loadFromBuffer(byte[] buffer,
int offset)
Loads the object from a memory buffer |
void |
setBackupBootSector(int aBackupBootSector)
|
void |
setBootStrap(byte[] aBootStrap)
|
void |
setFat32Length(long aFat32Length)
|
void |
setFatLength(int aFatLength)
|
void |
setFlags(int aFlags)
|
void |
setHeads(int aHeads)
|
void |
setHiddenSectors(long aHiddenSectors)
|
void |
setInfoSector(int aInfoSector)
|
void |
setMedia(byte aMedia)
|
void |
setNumFATs(int aNumFATs)
|
void |
setReservedSectors(int aReservedSectors)
|
void |
setRootCluster(long aRootCluster)
|
void |
setRootDirEntries(int aRootDirEntries)
|
void |
setSectors(int aSectors)
|
void |
setSectorSize(int aSectorSize)
|
void |
setSectorsPerCluster(int aSectorsPerCluster)
|
void |
setSectorsPerTrack(int aSectorsPerTrack)
|
void |
setSystemId(java.lang.String aSystemId)
|
void |
setTotalSectors(long aTotalSectors)
|
void |
setVersion(int aVersion)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected byte[] bootStrap
protected java.lang.String systemId
protected int sectorSize
protected int sectorsPerCluster
protected int reservedSectors
protected int numFATs
protected int rootDirEntries
protected int sectors
protected byte media
protected int fatLength
protected int sectorsPerTrack
protected int heads
protected long hiddenSectors
protected long totalSectors
protected long fat32Length
protected int flags
protected int version
protected long rootCluster
protected int infoSector
protected int backupBootSector
public static final int MAX_FAT12
public static final int MAX_FAT16
public static final int MAX_FAT32
| Constructor Detail |
public FatSuperBlock()
| Method Detail |
public byte[] getBootStrap()
public void setBootStrap(byte[] aBootStrap)
public java.lang.String getSystemId()
public void setSystemId(java.lang.String aSystemId)
public int getSectorSize()
public void setSectorSize(int aSectorSize)
public int getSectorsPerCluster()
public void setSectorsPerCluster(int aSectorsPerCluster)
public int getReservedSectors()
public void setReservedSectors(int aReservedSectors)
public int getNumFATs()
public void setNumFATs(int aNumFATs)
public int getRootDirEntries()
public void setRootDirEntries(int aRootDirEntries)
public int getSectors()
getTotalSectors()public void setSectors(int aSectors)
public byte getMedia()
public void setMedia(byte aMedia)
public int getFatLength()
getFat32Length()public void setFatLength(int aFatLength)
public int getSectorsPerTrack()
public void setSectorsPerTrack(int aSectorsPerTrack)
public int getHeads()
public void setHeads(int aHeads)
public long getHiddenSectors()
public void setHiddenSectors(long aHiddenSectors)
public long getTotalSectors()
getSectors()public void setTotalSectors(long aTotalSectors)
public long getFat32Length()
getFatLength()public void setFat32Length(long aFat32Length)
public int getFlags()
public void setFlags(int aFlags)
public int getVersion()
public void setVersion(int aVersion)
public long getRootCluster()
public void setRootCluster(long aRootCluster)
public int getInfoSector()
public void setInfoSector(int aInfoSector)
public int getBackupBootSector()
public void setBackupBootSector(int aBackupBootSector)
public long getNumSectors()
public long getNumClusters()
public int getFatBits()
public int getFirstDataSector()
public int getDataSize()
DiskStructure
getDataSize in interface DiskStructure
public void loadFromBuffer(byte[] buffer,
int offset)
throws FsException
DiskStructure
loadFromBuffer in interface DiskStructurebuffer - a byte[] containing data to be read in populating the objectoffset - a int indicating the offset within the buffer to start parsing.
FsException - if a parse error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||