コード例 #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();
   }
 }
コード例 #2
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);
 }
コード例 #3
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);
 }
コード例 #4
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);
 }
コード例 #5
0
 /**
  * Writes a char value to this stream.
  *
  * @param value a <code>char</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 writeChar(char value, String s) throws IOException {
   if (ENABLE_VERBOSE && s != null && Log.verbose()) Log.log("out[string]   " + s + "=" + value);
   dos.writeChar(value);
 }
コード例 #6
0
 /**
  * Writes a boolean value to this stream.
  *
  * @param value a <code>boolean</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 writeBoolean(boolean value, String s) throws IOException {
   if (ENABLE_VERBOSE && s != null && Log.verbose()) Log.log("out[boolean]  " + s + "=" + value);
   dos.writeBoolean(value);
 }
コード例 #7
0
 /**
  * Closes this stream and its underlying stream.
  *
  * @throws IOException
  */
 public void close(String s) throws IOException {
   dos.close();
 }
コード例 #8
0
 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);
 }
コード例 #9
0
 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);
 }
コード例 #10
0
 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);
 }
コード例 #11
0
 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);
 }
コード例 #12
0
 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);
 }
コード例 #13
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));
 }
コード例 #14
0
 /**
  * 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));
 }