/**
  * Writes a primitive value to this stream preceeded by a tag describing the type and data size
  * (in bytes) of the value.
  *
  * @param tag a <code>JDWP.Tag_...</code> value
  * @param value the value to write
  * @throws IOException if there was an IO error while writing
  */
 public void writePrimitive(byte tag, long value, String s) throws IOException {
   if (ENABLE_VERBOSE && s != null && Log.verbose()) Log.log("out[t-prim]:  " + s + "=" + value);
   dos.writeByte(tag);
   switch (tag) {
     case JDWP.Tag_VOID:
       break;
     case JDWP.Tag_BYTE:
     case JDWP.Tag_BOOLEAN:
       dos.writeByte((byte) value);
       break;
     case JDWP.Tag_CHAR:
     case JDWP.Tag_SHORT:
       dos.writeShort((short) value);
       break;
     case JDWP.Tag_INT:
     case JDWP.Tag_FLOAT:
       dos.writeInt((int) value);
       break;
     case JDWP.Tag_LONG:
     case JDWP.Tag_DOUBLE:
       dos.writeLong(value);
       break;
     default:
       Assert.shouldNotReachHere();
   }
 }
 public void writeNullLocation(String s) throws IOException {
   if (ENABLE_VERBOSE && s != null && Log.verbose()) Log.log("out[location]  " + s + "=null");
   dos.writeByte(JDWP.TypeTag_CLASS);
   writeReferenceTypeID(ReferenceTypeID.NULL, null);
   dos.writeInt(0);
   dos.writeLong(0);
 }
 /**
  * Writes an int value to this stream.
  *
  * @param value an <code>int</code> value to be written.
  * @param s prefix to use if this write is logged. A value of null prevents logging altogether.
  * @throws IOException if there was an IO error while writing
  */
 public void writeInt(int value, String s) throws IOException {
   if (ENABLE_VERBOSE && s != null && Log.verbose()) Log.log("out[int]      " + s + "=" + value);
   dos.writeInt(value);
 }
 public void writeFrameID(FrameID value, String s) throws IOException {
   if (ENABLE_VERBOSE && s != null && Log.verbose()) Log.log("out[frame]    " + s + "=" + value);
   writeObjectID(value.threadID, null);
   dos.writeInt(value.frame);
 }
 public void writeFieldID(FieldID value, String s) throws IOException {
   if (ENABLE_VERBOSE && s != null && Log.verbose()) Log.log("out[field]    " + s + "=" + value);
   writeReferenceTypeID(value.definingClass, "defining class");
   dos.writeInt(value.encoding);
 }
 public void writeMethodID(MethodID value, String s) throws IOException {
   if (ENABLE_VERBOSE && s != null && Log.verbose()) Log.log("out[method]   " + s + "=" + value);
   dos.writeInt(value.id);
 }
 public void writeTaggedObjectID(TaggedObjectID value, String s) throws IOException {
   if (ENABLE_VERBOSE && s != null && Log.verbose()) Log.log("out[t-object] " + s + "=" + value);
   dos.writeByte(value.tag);
   dos.writeInt(value.id);
 }
 public void writeReferenceTypeID(ReferenceTypeID value, String s) throws IOException {
   if (ENABLE_VERBOSE && s != null && Log.verbose()) Log.log("out[type]     " + s + "=" + value);
   dos.writeInt(value.id);
 }
 /**
  * Writes a float value to this stream.
  *
  * @param value a <code>float</code> value to be written.
  * @param s prefix to use if this write is logged. A value of null prevents logging altogether.
  * @throws IOException if there was an IO error while writing
  */
 public void writeFloat(float value, String s) throws IOException {
   if (ENABLE_VERBOSE && s != null && Log.verbose())
     Log.log("out[float]    " + s + "=" + (int) value);
   dos.writeInt(Float.floatToIntBits(value));
 }