/** * 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 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); }
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); }
/** * 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); }
/** * 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); }
/** * Closes this stream and its underlying stream. * * @throws IOException */ public void close(String s) throws IOException { dos.close(); }
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 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 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 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)); }
/** * 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)); }