@ Override public void enlargeFile ( long toEnlarge ) throws IOException { size += ( long ) Math . ceil ( ( double ) toEnlarge / incrementSize ) * incrementSize ; logger . debug ( "Enlarge filesize of {} to {}" , osFile , size ) ; contentEnd = size ; accessFile . setLength ( size ) ; // TODO check buffer size // if there are more chunks than the index can contain if ( ( size - contentStart ) / chunkSize > indexSize ) { logger . error ( "File-Enlargement not possible. The index becomes too large." ) ; throw new IOException ( "File-Enlargement not possible. The index becomes too large." ) ; } calcIndexInformations ( ) ; }
Rounds up the given size to the next full chunk and enlarges the file by these amounts of bytes .