void flush(DataOutputStream out) throws IOException {
  writeHeader(out);
  int size;
  int block_address;
  for (  int block_index : onDiskOrder) {
    block_address=memoryLookup.get(block_index);
    size=blockSize(block_index);
    out.write(backing,block_address,size);
  }
}

void flush ( DataOutputStream out ) throws IOException { writeHeader ( out ) ; int size ; int block_address ; for ( int block_index : onDiskOrder ) { block_address = memoryLookup . get ( block_index ) ; size = blockSize ( block_index ) ; out . write ( backing , block_address , size ) ; } }
performs the actual writing to disk in the order specified by calls to write ( ) since the last call to initialize ( ) .
