Ejemplo n.º 1
0
 /**
  * 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();
   }
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 public void writeLocation(Location value, String s) throws IOException {
   if (ENABLE_VERBOSE && s != null && Log.verbose()) Log.log("out[location] " + s + "=" + value);
   dos.writeByte(value.tag);
   writeReferenceTypeID(value.definingClass, null);
   writeMethodID(value.method, null);
   dos.writeLong(value.offset);
 }
Ejemplo n.º 4
0
 /**
  * Writes a double value to this stream.
  *
  * @param value a <code>double</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 writeDouble(double value, String s) throws IOException {
   if (ENABLE_VERBOSE && s != null && Log.verbose())
     Log.log("out[double]   " + s + "=" + (long) value);
   dos.writeLong(Double.doubleToLongBits(value));
 }
Ejemplo n.º 5
0
 /**
  * Writes a long value to this stream.
  *
  * @param value a <code>long</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 writeLong(long value, String s) throws IOException {
   if (ENABLE_VERBOSE && s != null && Log.verbose()) Log.log("out[long]     " + s + "=" + value);
   dos.writeLong(value);
 }