"

2013 FRC Java API

"

com.sun.squawk.debugger
Class PacketOutputStream

java.lang.Object
  extended by com.sun.squawk.debugger.PacketOutputStream

public final class PacketOutputStream
extends Object

A PacketOutputStream is used to write data to the data part of a Packet.


Constructor Summary
PacketOutputStream(DataOutputStream dis)
           
 
Method Summary
 void close(String s)
          Closes this stream and its underlying stream.
 void copyTaggedValue(PacketInputStream in)
          Copy a tagged value (primitive or object) from the input stream to the output stream.
 void copyValue(int tag, PacketInputStream in)
          Copy a value (primitive or object) from the input stream to the output stream.
 void writeBoolean(boolean value, String s)
          Writes a boolean value to this stream.
 void writeByte(int value, String s)
          Writes one byte to this stream.
 void writeChar(char value, String s)
          Writes a char value to this stream.
 void writeDouble(double value, String s)
          Writes a double value to this stream.
 void writeFieldID(DataType.FieldID value, String s)
           
 void writeFloat(float value, String s)
          Writes a float value to this stream.
 void writeFrameID(DataType.FrameID value, String s)
           
 void writeInt(int value, String s)
          Writes an int value to this stream.
 void writeLocation(DataType.Location value, String s)
           
 void writeLong(long value, String s)
          Writes a long value to this stream.
 void writeMethodID(DataType.MethodID value, String s)
           
 void writeNullLocation(String s)
           
 void writeObjectID(DataType.ObjectID value, String s)
           
 void writePrimitive(byte tag, long value, String s)
          Writes a primitive value to this stream preceeded by a tag describing the type and data size (in bytes) of the value.
 void writeReferenceTypeID(DataType.ReferenceTypeID value, String s)
           
 void writeShort(short value, String s)
          Writes a short value to this stream.
 void writeString(String value, String s)
          Writes a string to the underlying output stream using UTF-8 encoding in a machine-independent manner.
 void writeTaggedObjectID(DataType.TaggedObjectID value, String s)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PacketOutputStream

public PacketOutputStream(DataOutputStream dis)
Method Detail

writeByte

public void writeByte(int value,
                      String s)
               throws IOException
Writes one byte to this stream.

Parameters:
value - a byte value to be written.
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

writeBoolean

public void writeBoolean(boolean value,
                         String s)
                  throws IOException
Writes a boolean value to this stream.

Parameters:
value - a boolean value to be written.
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

writeChar

public void writeChar(char value,
                      String s)
               throws IOException
Writes a char value to this stream.

Parameters:
value - a char value to be written.
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

writeShort

public void writeShort(short value,
                       String s)
                throws IOException
Writes a short value to this stream.

Parameters:
value - a short value to be written.
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

writeInt

public void writeInt(int value,
                     String s)
              throws IOException
Writes an int value to this stream.

Parameters:
value - an int value to be written.
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

writeLong

public void writeLong(long value,
                      String s)
               throws IOException
Writes a long value to this stream.

Parameters:
value - a long value to be written.
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

writeFloat

public void writeFloat(float value,
                       String s)
                throws IOException
Writes a float value to this stream.

Parameters:
value - a float value to be written.
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

writeDouble

public void writeDouble(double value,
                        String s)
                 throws IOException
Writes a double value to this stream.

Parameters:
value - a double value to be written.
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

writeString

public void writeString(String value,
                        String s)
                 throws IOException
Writes a string to the underlying output stream using UTF-8 encoding in a machine-independent manner.

First, four bytes are written to the output stream as if by the writeInt method giving the number of bytes to follow. This value is the number of bytes actually written out, not the length of the string. Following the length, each character of the string is output, in sequence, using the UTF-8 encoding for the character.

Parameters:
value - a string to be written.
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

writeObjectID

public void writeObjectID(DataType.ObjectID value,
                          String s)
                   throws IOException
Throws:
IOException

writeReferenceTypeID

public void writeReferenceTypeID(DataType.ReferenceTypeID value,
                                 String s)
                          throws IOException
Throws:
IOException

writeTaggedObjectID

public void writeTaggedObjectID(DataType.TaggedObjectID value,
                                String s)
                         throws IOException
Throws:
IOException

writeMethodID

public void writeMethodID(DataType.MethodID value,
                          String s)
                   throws IOException
Throws:
IOException

writeFieldID

public void writeFieldID(DataType.FieldID value,
                         String s)
                  throws IOException
Throws:
IOException

writeFrameID

public void writeFrameID(DataType.FrameID value,
                         String s)
                  throws IOException
Throws:
IOException

writeLocation

public void writeLocation(DataType.Location value,
                          String s)
                   throws IOException
Throws:
IOException

writeNullLocation

public void writeNullLocation(String s)
                       throws IOException
Throws:
IOException

writePrimitive

public void writePrimitive(byte tag,
                           long value,
                           String s)
                    throws IOException
Writes a primitive value to this stream preceeded by a tag describing the type and data size (in bytes) of the value.

Parameters:
tag - a JDWP.Tag_... value
value - the value to write
Throws:
IOException - if there was an IO error while writing

copyValue

public void copyValue(int tag,
                      PacketInputStream in)
               throws IOException
Copy a value (primitive or object) from the input stream to the output stream. using the specified tag.

Parameters:
tag - a JDWP.Tag_... value
in - a PacketInputStream containing a value to copy.
Throws:
IOException - if there was an IO error while writing

copyTaggedValue

public void copyTaggedValue(PacketInputStream in)
                     throws IOException
Copy a tagged value (primitive or object) from the input stream to the output stream. including a tag.

Parameters:
in - a PacketInputStream containing a tag and a value to copy.
Throws:
IOException - if there was an IO error while writing

close

public void close(String s)
           throws IOException
Closes this stream and its underlying stream.

Throws:
IOException

"

2013 FRC Java API

"

"
For updated information see the Java FRC site
"