public Ext2FileSystem(Device device) throws FileSystemException{ if(device==null)
public Ext2FileSystem(Device device) throws FileSystemException { if (device == null) {
	public Ext2FileSystem(Device device) throws FileSystemException{		if(device==null)			throw new FileSystemException("null device!");					this.device = device;		closed = false;		byte data[];		//points to the byte where the fs metadata parsing has reached		long byteIndex;						cache = new BlockCache(50,(float)0.75);		Driver driver = device.getDriver();		if(driver instanceof IDEDiskPartitionDriver) 			pdriver = (IDEDiskPartitionDriver)driver;		try {			data = new byte[Superblock.SUPERBLOCK_LENGTH];			//skip the first 1024 bytes (bootsector) and read the superblock 			byteIndex = 1024;			pdriver.read(byteIndex, data, 0, Superblock.SUPERBLOCK_LENGTH);			byteIndex+=Superblock.SUPERBLOCK_LENGTH;			superblock = new Superblock(data);						//read the group descriptors			groupCount = (int)Math.ceil((double)superblock.getBlocksCount() / (double)superblock.getBlocksPerGroup());			groupDescriptors = new GroupDescriptor[groupCount];			for(int i=0; i<groupCount; i++) {				data = new byte[GroupDescriptor.GROUPDESCRIPTOR_LENGTH];				pdriver.read(	byteIndex+i*GroupDescriptor.GROUPDESCRIPTOR_LENGTH, 							data, 0, 							GroupDescriptor.GROUPDESCRIPTOR_LENGTH);								groupDescriptors[i] = new GroupDescriptor(data);			}				byteIndex += superblock.getBlockSize();						/*			//go through each block group			//XXX byteIndex = ...						//read the block bitmap				//XXX what if it doesn't fit?				data = new byte[(int)superblock.getBlockSize()];				api.read( byteIndex, data, 0, (int)superblock.getBlockSize());				FSBitmap blockBitmap = new FSBitmap(data);				byteIndex += superblock.getBlockSize();							//read the inode bitmap				//XXX what if it doesn't fit?				data = new byte[(int)superblock.getBlockSize()];				api.read( byteIndex, data, 0, (int)superblock.getBlockSize());				FSBitmap inodeBitmap = new FSBitmap(data);				byteIndex += superblock.getBlockSize();							//read the inode table				//XXX what if it doesn't fit?				Inode inodeTable[] = new Inode[ (int)superblock.getInodesCount() ];			*/		} catch (FileSystemException e) {			throw e;		} catch (Exception e) {			throw new FileSystemException(e);		}						Ext2Debugger.debug( "Ext2fs filesystem constructed sucessfully");		Ext2Debugger.debug( "	superblock:	#blocks:		"+superblock.getBlocksCount()+"\n"+							"				#blocks/group:	"+superblock.getBlocksPerGroup()+"\n"+							"				#block groups:	"+groupCount+"\n"+							"				block size:		"+superblock.getBlockSize()+"\n"+							"				#inodes:		"+superblock.getINodesCount()+"\n"+							"				#inodes/group:	"+superblock.getINodesPerGroup());	}