|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.catalina.connector.warp.WarpPacket
Field Summary | |
protected byte[] |
buffer
This packet's data buffer |
protected int |
pointer
|
protected int |
size
Number of bytes stored in the buffer |
Constructor Summary | |
WarpPacket()
Construct a new WarpPacket instance. |
Method Summary | |
java.lang.String |
dump()
|
int |
getType()
Return the type of this packet. |
int |
readInteger()
Read a signed integer value (32 bit) from the packet buffer. |
java.lang.String |
readString()
Read a string from the packet buffer. |
int |
readUnsignedShort()
Read an unsigned short value (16 bit) from the packet buffer. |
void |
reset()
Reset this packet. |
void |
setType(int type)
Set this packet type. |
void |
writeInteger(int value)
Write a signed integer value (32 bit) in the packet buffer. |
void |
writeString(java.lang.String string)
Write a string into the packet buffer. |
void |
writeUnsignedShort(int value)
Write an unsigned short value (16 bit) in the packet buffer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected byte[] buffer
protected int size
protected int pointer
Constructor Detail |
public WarpPacket()
Method Detail |
public void reset()
public void setType(int type)
type
- The type of this packet.public int getType()
public void writeUnsignedShort(int value)
value
- The unsigned short value to write.
java.lang.IllegalArgumentException
- If the value is negative or greater
than 65535.
java.lang.ArrayIndexOutOfBoundsException
- If the packet buffer cannot
contain the new value.public void writeInteger(int value)
value
- The signed integer value to write.
java.lang.ArrayIndexOutOfBoundsException
- If the packet buffer cannot
contain the new value.public void writeString(java.lang.String string)
string
- The string to write into the packet buffer.
java.lang.ArrayIndexOutOfBoundsException
- If the packet buffer cannot
contain the new value.
java.lang.RuntimeException
- If the platform doesn't support UTF-8
encoding.public int readUnsignedShort()
java.lang.ArrayIndexOutOfBoundsException
- If no data is left in the
packet buffer to be read.public int readInteger()
java.lang.ArrayIndexOutOfBoundsException
- If no data is left in the
packet buffer to be read.public java.lang.String readString()
java.lang.ArrayIndexOutOfBoundsException
- If no data is left in the
packet buffer to be read.public java.lang.String dump()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |