static PacketStream enqueueCommand(
     VirtualMachineImpl vm,
     ThreadMirror threadMirror,
     InvokeFlags invokeFlags,
     MethodMirror methodMirror,
     Value<?> thisObjectMirror,
     Value<?>[] arguments) {
   PacketStream ps = new PacketStream(vm, COMMAND_SET, COMMAND);
   ps.writeId(threadMirror);
   ps.writeInt(invokeFlags.ordinal());
   ps.writeId(methodMirror);
   ps.writeValue(thisObjectMirror);
   ps.writeInt(arguments.length);
   for (Value<?> argument : arguments) {
     ps.writeValue(argument);
   }
   ps.send();
   return ps;
 }
 private VirtualMachine_InvokeMethod(VirtualMachineImpl vm, PacketStream ps) {
   byte result = ps.readByte();
   myThrowException = result == 0;
   myValue = ps.readValue();
 }
 static VirtualMachine_InvokeMethod waitForReply(VirtualMachineImpl vm, PacketStream ps)
     throws JDWPException {
   ps.waitForReply();
   return new VirtualMachine_InvokeMethod(vm, ps);
 }