|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.squawk.debugger.Packet
public abstract class Packet
A Packet
encapsulates a JDWP command or reply packet.
Field Summary | |
---|---|
static short |
FLAG_NEEDS_REPLY
Indicates a packet for which no reply is expected. |
static short |
FLAG_REPLY
The flag bit value indicating a reply packet. |
Constructor Summary | |
---|---|
Packet(int id)
Creates a Packet for a new JDWP request. |
|
Packet(int id,
int dataLength,
DataInputStream data)
Creates a Packet to encapsulate a received JDWP packet. |
Method Summary | |
---|---|
protected void |
appendData(StringBuffer buf)
Appends a textualized form of this packet's data to a given StringBuffer. |
abstract int |
getFlags()
Gets the value for the 'flags' field in the header of this packet. |
int |
getID()
Gets the ID that is used to pair this packet with its associated command or reply packet (if any). |
PacketInputStream |
getInputStream()
Gets a DataInputStream to read the data in this packet. |
PacketOutputStream |
getOutputStream()
Gets a PacketOutputStream to write some data to this packet. |
int |
getSize()
Gets the size (in bytes) of the entire packet. |
abstract String |
toString()
Returns a string representation of the object. |
void |
write(DataOutputStream dos)
Writes this packet to a given output stream. |
protected abstract void |
writeFields(DataOutputStream dos)
Hook for sublasses to write their specific fields to a packet being sent. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final short FLAG_REPLY
public static final short FLAG_NEEDS_REPLY
Constructor Detail |
---|
public Packet(int id)
id
- the identifier of the new packetpublic Packet(int id, int dataLength, DataInputStream data) throws IOException
owner
- the JDWPListener that received the packetid
- the identifier in the packetdataLength
- the length of the data to read from data
data
- the contents of the data field of the packet
IOException
Method Detail |
---|
public PacketInputStream getInputStream()
public PacketOutputStream getOutputStream()
public final int getID()
public abstract String toString()
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
toString
in class Object
protected void appendData(StringBuffer buf)
buf
- the buffer to extendpublic abstract int getFlags()
protected abstract void writeFields(DataOutputStream dos) throws IOException
dos
- the stream to write the fields to
IOException
- if an IO error occurspublic final int getSize()
public final void write(DataOutputStream dos) throws IOException
dos
- where to write the packet
IOException
- if an IO error occurs
|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |