A single packet for communication between the web server and the
container.
In a more generic sense, it's the event that drives the processing chain.
XXX Use Event, make Msg a particular case.
| Method from org.apache.jk.core.Msg Detail: |
abstract public void appendByte(int val)
|
abstract public void appendByteChunk(ByteChunk bc) throws IOException
|
abstract public void appendBytes(MessageBytes mb) throws IOException
|
abstract public void appendBytes(byte[] b,
int off,
int numBytes)
Copy a chunk of bytes into the packet, starting at the current
write position. The chunk of bytes is encoded with the length
in two bytes first, then the data itself, and finally a
terminating \0 (which is not included in the encoded
length). |
abstract public void appendInt(int val)
|
abstract public void appendLongInt(int val)
|
abstract public void dump(String msg)
|
abstract public 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. |
abstract public byte[] getBuffer()
|
abstract public byte getByte()
|
abstract public void getBytes(MessageBytes mb)
|
abstract public int getBytes(byte[] dest)
Copy a chunk of bytes from the packet into an array and advance
the read position past the chunk. See appendBytes() for details
on the encoding. |
abstract public int getHeaderLength()
|
abstract public int getInt()
Read an integer from packet, and advance the read position past
it. Integers are encoded as two unsigned bytes with the
high-order byte first, and, as far as I can tell, in
little-endian order within each byte. |
abstract public int getLen()
|
abstract public int getLongInt()
Read a 32 bits integer from packet, and advance the read position past
it. Integers are encoded as four unsigned bytes with the
high-order byte first, and, as far as I can tell, in
little-endian order within each byte. |
public static String hexLine(byte[] buf,
int start,
int len) {
StringBuffer sb=new StringBuffer();
for( int i=start; i< start+16 ; i++ ) {
if( i < len + 4)
sb.append( hex( buf[i] ) + " ");
else
sb.append( " " );
}
sb.append(" | ");
for( int i=start; i < start+16 && i < len + 4; i++ ) {
if( ! Character.isISOControl( (char)buf[i] ))
sb.append( new Character((char)buf[i]) );
else
sb.append( "." );
}
return sb.toString();
}
|
abstract public byte peekByte()
|
abstract public int peekInt()
|
abstract public int processHeader()
|
abstract public void reset()
Prepare this packet for accumulating a message from the container to
the web server. Set the write position to just after the header
(but leave the length unwritten, because it is as yet unknown). |