com.android.ddmlib
Class JdwpPacket

java.lang.Object
  extended by com.android.ddmlib.JdwpPacket

public final class JdwpPacket
extends java.lang.Object

A JDWP packet, sitting at the start of a ByteBuffer somewhere. This allows us to wrap a "pointer" to the data with the results of decoding the packet. None of the operations here are synchronized. If multiple threads will be accessing the same ByteBuffers, external sync will be required. Use the constructor to create an empty packet, or "findPacket()" to wrap a JdwpPacket around existing data.


Field Summary
static int JDWP_HEADER_LEN
           
 
Method Summary
 int getId()
          Return the packet's ID.
 java.nio.ByteBuffer getPayload()
          Return a slice of the byte buffer, positioned past the JDWP header to the start of the chunk header.
 boolean is(int cmdSet, int cmd)
           
 boolean isReply()
          Returns "true" if this JDWP packet is tagged as a reply.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

JDWP_HEADER_LEN

public static final int JDWP_HEADER_LEN
See Also:
Constant Field Values
Method Detail

getPayload

public java.nio.ByteBuffer getPayload()
Return a slice of the byte buffer, positioned past the JDWP header to the start of the chunk header. The buffer's limit will be set to the size of the payload if the size is known; if this is a packet under construction the limit will be set to the end of the buffer. Doesn't examine the packet at all -- works on empty buffers.


isReply

public boolean isReply()
Returns "true" if this JDWP packet is tagged as a reply.


getId

public int getId()
Return the packet's ID. For a reply packet, this allows us to match the reply with the original request.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

is

public boolean is(int cmdSet,
                  int cmd)