|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ajp.Ajp13Packet
A single packet for communication between the web server and the container. Designed to be reused many times with no creation of garbage. Understands the format of data types for these packets. Can be used (somewhat confusingly) for both incoming and outgoing packets.
Ajp14/Ajp13Packet
Field Summary | |
static int |
AJP13_SW_HEADER
|
static int |
AJP13_WS_HEADER
|
static java.lang.String |
DEFAULT_CHAR_ENCODING
|
Constructor Summary | |
Ajp13Packet(byte[] b)
Create a new packet with given bytes |
|
Ajp13Packet(int size)
Create a new packet with an internal buffer of given size. |
Method Summary | |
MessageBytes |
addHeader(MimeHeaders headers)
|
void |
appendBool(boolean val)
|
void |
appendByte(byte val)
|
void |
appendBytes(byte[] b,
int off,
int numBytes)
Copy a chunk of bytes into the packet, starting at the current write position. |
void |
appendInt(int val)
|
void |
appendLongInt(int val)
|
void |
appendString(java.lang.String str)
Write a String out at the current write position. |
void |
appendXBytes(byte[] b,
int off,
int numBytes)
Copy a chunk of bytes into the packet, starting at the current write position. |
int |
checkIn()
Parse the packet header for a packet sent from the web server to the container. |
void |
dump(java.lang.String msg)
|
void |
end()
For a packet to be sent to the web server, finish the process of accumulating data and write the length of the data payload into the header. |
boolean |
getBool()
|
byte[] |
getBuff()
Get the internal buffer |
byte |
getByte()
|
int |
getByteOff()
Get offset into internal buffer. |
int |
getBytes(byte[] dest)
Copy a chunk of bytes from the packet into an array and advance the read position past the chunk. |
java.lang.String |
getEncoding()
Get the encoding used for byte[] <-> string conversions. |
int |
getInt()
Read an integer from packet, and advance the read position past it. |
int |
getLen()
Get length. |
int |
getLongInt()
Read a 32 bits integer from packet, and advance the read position past it. |
void |
getMessageBytes(MessageBytes mb)
|
java.lang.String |
getString()
Read a String from the packet, and advance the read position past it. |
int |
getXBytes(byte[] dest,
int length)
Copy a chunk of bytes from the packet into an array and advance the read position past the chunk. |
byte |
peekByte()
|
int |
peekInt()
Read an integer from the packet, but don't advance the read position past it. |
int |
peekLongInt()
Read a 32 bits integer from the packet, but don't advance the read position past it. |
void |
reset()
Prepare this packet for accumulating a message from the container to the web server. |
void |
setByteOff(int c)
Set offset into internal buffer. |
void |
setEncoding(java.lang.String encoding)
Set the encoding to use for byte[] <-> string conversions. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String DEFAULT_CHAR_ENCODING
public static final int AJP13_WS_HEADER
public static final int AJP13_SW_HEADER
Constructor Detail |
public Ajp13Packet(int size)
size
- packet sizepublic Ajp13Packet(byte[] b)
b
- this packet's bytes.Method Detail |
public void setEncoding(java.lang.String encoding)
encoding
- the encoding to use.public java.lang.String getEncoding()
public byte[] getBuff()
public int getLen()
public int getByteOff()
public void setByteOff(int c)
c
- new offsetpublic int checkIn()
public void reset()
public void end()
public void appendInt(int val)
public void appendByte(byte val)
public void appendBool(boolean val)
public void appendString(java.lang.String str) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public void appendBytes(byte[] b, int off, int numBytes)
b
- The array from which to copy bytes.off
- The offset into the array at which to start copyingpublic void appendLongInt(int val)
public void appendXBytes(byte[] b, int off, int numBytes)
b
- The array from which to copy bytes.off
- The offset into the array at which to start copyingpublic int getInt()
public int peekInt()
public byte getByte()
public byte peekByte()
public boolean getBool()
public void getMessageBytes(MessageBytes mb)
public MessageBytes addHeader(MimeHeaders headers)
public java.lang.String getString() throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public int getBytes(byte[] dest)
public int getLongInt()
public int getXBytes(byte[] dest, int length)
public int peekLongInt()
public void dump(java.lang.String msg)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |