VM_Magic.setIntAtOffset(buffer, index, HPM_info.getNumberOfValues());index += SIZE_OF_INT;
VM_Magic.setIntAtOffset(buffer, index, HPM_info.getNumberOfValues());index = index.add(BYTES_IN_INT);
  static private void writeHeader()  {    if(verbose>=2){       VM.sysWrite("VM_HPMs.writeHeader(",HPM_info.version_number,",");      VM.sysWrite(HPM_info.getNumberOfValues()); VM.sysWrite(", ");      VM.sysWrite(HPM_info.mode);VM.sysWrite(", ");       VM.sysWrite(HPM_info.isBigEndian()?"BIG_ENDIAN":"LITTLE_ENDIAN"); VM.sysWrite(")\n");    }    byte[] buffer   = new byte[100];    // temporary buffer    int    index    = 0;      if (HPM_info.isBigEndian()) {      // write version number       VM_Magic.setIntAtOffset(buffer, index, HPM_info.version_number);     index += SIZE_OF_INT;      // write endian      VM_Magic.setIntAtOffset(buffer, index, HPM_info.getEndian());        index += SIZE_OF_INT;    } else {      // write in default BIG_ENDIAN manner      // write version number       VM_Magic.setIntAtOffset(buffer, index, HPM_info.swapByteOrder(HPM_info.version_number));index += SIZE_OF_INT;      // write endian      VM_Magic.setIntAtOffset(buffer, index, HPM_info.swapByteOrder(HPM_info.getEndian()));   index += SIZE_OF_INT;    }    // write number of events    VM_Magic.setIntAtOffset(buffer, index, HPM_info.getNumberOfValues());index += SIZE_OF_INT;    // write mode    VM_Magic.setIntAtOffset(buffer, index, HPM_info.mode);               index += SIZE_OF_INT;    if(verbose>=4){      VM.sysWrite("VM_HPMs.writeHeaderPrefix() header: version number ", HPM_info.version_number);      VM.sysWrite(  ", number of values ", HPM_info.getNumberOfValues());      VM.sysWrite(", mode ", HPM_info.mode);      VM.sysWrite(", endian ", HPM_info.getEndian());      VM.sysWriteln(", record_size ", record_size);    }    // write it to the file    writeHeaderFileOutputStream(buffer, index);  }