public long size ( String fileName ) { try { IoChannel fileChannel = getFileChannel ( fileName ) ; return fileChannel . size ( ) / BLOCK_SIZE ; } catch ( IOException e ) { throw new RuntimeException ( "cannot access " + fileName ) ; } }
Returns the number of blocks in the specified file .