/** * 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 one byte to this stream. * * @param value a <code>byte</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 writeByte(int value, String s) throws IOException { if (ENABLE_VERBOSE && s != null && Log.verbose()) Log.log("out[byte] " + s + "=" + value); dos.writeByte(value); }
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); }