synchronized(iNode) { if(len+off>getLength()) throw new IOException("Can't read past the file!"); long blockSize = iNode.getExt2FileSystem().getBlockSize(); long bytesRead=0; while( bytesRead < len ) { long blockNr = (fileOffset+bytesRead) / blockSize; long blockOffset = (fileOffset+bytesRead) % blockSize; long copyLength = Math.min(len-bytesRead, blockSize - blockOffset);  System.arraycopy( 	iNode.getDataBlock(blockNr), (int)blockOffset, dest, off+(int)bytesRead, (int)copyLength);  bytesRead += copyLength;
synchronized(iNode) { try{ if(len+off>getLength()) throw new IOException("Can't read past the file!"); long blockSize = iNode.getExt2FileSystem().getBlockSize(); long bytesRead=0; while( bytesRead < len ) { long blockNr = (fileOffset+bytesRead) / blockSize; long blockOffset = (fileOffset+bytesRead) % blockSize; long copyLength = Math.min(len-bytesRead, blockSize - blockOffset);  System.arraycopy( 	iNode.getDataBlock(blockNr), (int)blockOffset, dest, off+(int)bytesRead, (int)copyLength);  bytesRead += copyLength; }  iNode.decLocked(); return; }catch(Throwable t) {  iNode.decLocked(); throw new IOException(t);
	public void read(long fileOffset, byte[] dest, int off, int len) throws IOException {		//a single inode may be represented by more than one Ext2Directory instances, 		//but each will use the same instance of the underlying inode (see Ext2FileSystem.getINode()),		//so synchronize to the inode		synchronized(iNode) {	 			if(len+off>getLength())				throw new IOException("Can't read past the file!");			long blockSize = iNode.getExt2FileSystem().getBlockSize();			long bytesRead=0;			while( bytesRead < len ) {				long blockNr = (fileOffset+bytesRead) / blockSize;				long blockOffset = (fileOffset+bytesRead) % blockSize;				long copyLength = Math.min(len-bytesRead, blockSize - blockOffset);								System.arraycopy( 	iNode.getDataBlock(blockNr), (int)blockOffset,									dest, off+(int)bytesRead, (int)copyLength);													bytesRead += copyLength;			}		}	}