appendByteChunk

appendBytes

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).

Parameters:

b - The array from which to copy bytes.

off - The offset into the array at which to start copying

numBytes - The number of bytes to copy.

getInt

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.

getByte

peekByte

getBytes

getBytes

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.

Returns:

The number of bytes copied.

getLongInt

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.