VM_Magic.setIntAtOffset(buffer, index, METHOD_RECORD);      index += SIZE_OF_INT;
VM_Magic.setIntAtOffset(buffer, index, METHOD_RECORD);      index = index.add(BYTES_IN_INT);
  static private final void writeMethod(int mid, VM_Atom className, VM_Atom methodName, VM_Atom methodDescriptor) {    if (verbose>=7) {      VM.sysWrite("VM_HPMs.writeMethod(", mid, ",");      VM.sysWrite(className);      VM.sysWrite(", ");      VM.sysWrite(methodName);      VM.sysWrite(", ");      VM.sysWrite(methodDescriptor);      VM.sysWriteln(")");    }    final byte[] classNameBytes = className.toByteArray();    final byte[] methodNameBytes = methodName.toByteArray();    final byte[] methodDescriptorBytes = methodDescriptor.toByteArray();    int index = 0;    byte[] buffer = new byte[classNameBytes.length+methodNameBytes.length+methodDescriptorBytes.length+5*SIZE_OF_INT];    // write record format number    if(verbose>=8){VM.sysWriteln(  "VM_HPMs.writeIntToBuffer() buffer index ",index," value ",METHOD_RECORD);}    VM_Magic.setIntAtOffset(buffer, index, METHOD_RECORD);      index += SIZE_OF_INT;    // write mid    if(verbose>=8){VM.sysWriteln(  "VM_HPMs.writeIntToBuffer() buffer index ",index," value ",mid);}    VM_Magic.setIntAtOffset(buffer, index, mid);                index += SIZE_OF_INT;    // write class name    index = writeStringToBuffer(buffer, index, classNameBytes);    // write method name    index = writeStringToBuffer(buffer, index, methodNameBytes);    // write method descriptor    index = writeStringToBuffer(buffer, index, methodDescriptorBytes);    // write buffer to file    writeHeaderFileOutputStream(buffer, index);  }