private long fileSizeAdjusted ( long alignedPointerToRaw , long readSize ) { // end of section outside the file --> cut at file.length() if ( readSize + alignedPointerToRaw > file . length ( ) ) { readSize = file . length ( ) - alignedPointerToRaw ; } // start of section outside the file --> nothing is read if ( alignedPointerToRaw > file . length ( ) ) { logger . info ( "invalid section: starts outside the file, readsize set to 0" ) ; readSize = 0 ; } return readSize ; }
Adjusts the readsize of a section to the size of the file .