public synchronized void resizeFile(int newsize) throws IOException {
  if (!writable) {
    throw new IOException("File is not writeable!");
  }
  this.numrecs=newsize;
  file.seek(HEADER_POS_SIZE);
  file.writeInt(numrecs);
  file.setLength(indexToFileposition(numrecs));
  mapArray();
}

public synchronized void resizeFile ( int newsize ) throws IOException { if ( ! writable ) { throw new IOException ( "File is not writeable!" ) ; } this . numrecs = newsize ; file . seek ( HEADER_POS_SIZE ) ; file . writeInt ( numrecs ) ; file . setLength ( indexToFileposition ( numrecs ) ) ; mapArray ( ) ; }
resize file to the intended size
