final int calcLevels ( long length ) { // The calculation is essentially a math log operation, but the table // lookup is faster. int index = Arrays . binarySearch ( mLevelMaxSizes , length ) ; return ( index < 0 ) ? ~ index : index ; }
Calculates the level of indirection needed to access a block in a file of the given length . If the level is zero the file table points directly to a data block . If the level is one the file table points to file table block . A file table block contains block ids which map to data blocks or more file table blocks .