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(java.nio.ByteBuffer b)
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 |
appendInt(int val)
Add a short integer (2 bytes) to the message.
|
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 |
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.
|
protected static java.lang.String |
hex(int x) |
protected static java.lang.String |
hexLine(byte[] buf,
int start,
int len) |
int |
peekInt() |
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 final 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)
val - The integer to appendpublic void appendByte(int val)
val - The byte value to appendpublic void appendBytes(MessageBytes mb)
mb - The data to writepublic void appendByteChunk(ByteChunk bc)
bc - The data to writepublic 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 void appendBytes(java.nio.ByteBuffer b)
b - The ByteBuffer from which to copy bytes.public int getInt()
public int peekInt()
public byte getByte()
public void getBytes(MessageBytes mb)
public void getBodyBytes(MessageBytes mb)
public int getLongInt()
public int processHeader(boolean toContainer)
protected static java.lang.String hexLine(byte[] buf,
int start,
int len)
protected static java.lang.String hex(int x)
Copyright © 2000-2024 Apache Software Foundation.
Apache Tomcat, Tomcat, Apache, the Apache Tomcat logo and the Apache logo are either registered trademarks or trademarks of the Apache Software Foundation.