public class AjpMessage
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected byte[] |
buf
Fixed size buffer.
|
protected int |
len
This actually means different things depending on whether the
packet is read or write.
|
protected int |
pos
The current read or write position in the buffer.
|
protected static StringManager |
sm
The string manager for this package.
|
Constructor and Description |
---|
AjpMessage(int packetSize) |
Modifier and Type | Method and Description |
---|---|
void |
appendByte(int val)
Append a byte (1 byte) to the message.
|
void |
appendByteChunk(ByteChunk bc)
Write a ByteChunk out at the current write position.
|
void |
appendBytes(byte[] b,
int off,
int numBytes)
Copy a chunk of bytes into the packet, starting at the current
write position.
|
void |
appendBytes(MessageBytes mb)
Write a MessageBytes out at the current write position.
|
void |
appendCharChunk(CharChunk cc)
Write a CharChunk out at the current write position.
|
void |
appendInt(int val)
Add a short integer (2 bytes) to the message.
|
void |
appendString(java.lang.String str)
Write a String out at the current write position.
|
void |
dump(java.lang.String msg)
Dump the contents of the message, prefixed with the given String.
|
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.
|
void |
getBodyBytes(MessageBytes mb) |
byte[] |
getBuffer()
Return the underlying byte buffer.
|
byte |
getByte() |
void |
getBytes(MessageBytes mb) |
int |
getHeaderLength() |
int |
getInt()
Read an integer from packet, and advance the read position past
it.
|
int |
getLen()
Return the current message length.
|
int |
getLongInt()
Read a 32 bits integer from packet, and advance the read position past
it.
|
int |
getPacketSize() |
protected static java.lang.String |
hex(int x) |
protected static java.lang.String |
hexLine(byte[] buf,
int start,
int len) |
int |
peekInt() |
int |
processHeader()
Deprecated.
|
int |
processHeader(boolean toContainer) |
void |
reset()
Prepare this packet for accumulating a message from the container to
the web server.
|
protected static final StringManager sm
protected byte[] buf
protected int pos
protected int len
public void reset()
public void end()
public byte[] getBuffer()
public int getLen()
public void appendInt(int val)
public void appendByte(int val)
public void appendBytes(MessageBytes mb)
public void appendByteChunk(ByteChunk bc)
public void appendCharChunk(CharChunk cc)
public void appendString(java.lang.String str)
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 copyingnumBytes
- The number of bytes to copy.public int getInt()
public int peekInt()
public byte getByte()
public void getBytes(MessageBytes mb)
public void getBodyBytes(MessageBytes mb)
public int getLongInt()
public int getHeaderLength()
public int getPacketSize()
@Deprecated public int processHeader()
public int processHeader(boolean toContainer)
public void dump(java.lang.String msg)
protected static java.lang.String hexLine(byte[] buf, int start, int len)
protected static java.lang.String hex(int x)
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.