naga.packetreader
public class ZeroDelimitedPacketReader extends DelimiterPacketReader
DEFAULT_READ_BUFFER_SIZE
Constructor and Description |
---|
ZeroDelimitedPacketReader()
Creates zero delimited reader with a default read buffer
and unlimited max packet size.
|
ZeroDelimitedPacketReader(int maxPacketSize)
Creates a zero delimited reader with the given max packet size
and the default read buffer size.
|
ZeroDelimitedPacketReader(int readBufferSize,
int maxPacketSize)
Creates a zero delimited reader with the given max packet size
and read buffer size.
|
getBuffer, getMaxPacketSize, getNextPacket, setMaxPacketSize
public ZeroDelimitedPacketReader()
public ZeroDelimitedPacketReader(int readBufferSize, int maxPacketSize)
Exceeding the packet size will throw a ProtocolViolationException.
readBufferSize
- the size of the read buffer (i.e. how many
bytes are read in a single pass) - this only has effect on read
efficiency and memory requirements.maxPacketSize
- the maximum packet size to accept.public ZeroDelimitedPacketReader(int maxPacketSize)
Exceeding the packet size will throw a ProtocolViolationException.
maxPacketSize
- the maximum packet size to accept.