Methods Summary |
---|
public abstract void | appendByte(int val)
|
public abstract void | appendByteChunk(org.apache.tomcat.util.buf.ByteChunk bc)
|
public abstract void | appendBytes(org.apache.tomcat.util.buf.MessageBytes mb)
|
public abstract 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).
|
public abstract void | appendInt(int val)
|
public abstract void | appendLongInt(int val)
|
public abstract void | dump(java.lang.String msg)
|
public abstract 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.
|
public abstract byte[] | getBuffer()
|
public abstract byte | getByte()
|
public abstract void | getBytes(org.apache.tomcat.util.buf.MessageBytes mb)
|
public abstract 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.
|
public abstract int | getHeaderLength()
|
public abstract 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.
|
public abstract int | getLen()
|
public abstract 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.
|
private static java.lang.String | hex(int x)
// if( x < 0) x=256 + x;
String h=Integer.toHexString( x );
if( h.length() == 1 ) h = "0" + h;
return h.substring( h.length() - 2 );
|
public static java.lang.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();
|
public abstract byte | peekByte()
|
public abstract int | peekInt()
|
public abstract int | processHeader()
|
public abstract 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).
|