naga.packetreader
public class AsciiLinePacketReader extends DelimiterPacketReader
This can be used for reading lines of ASCII characters.
DEFAULT_READ_BUFFER_SIZE
Constructor and Description |
---|
AsciiLinePacketReader()
Creates a '\n' delimited reader with default min buffer size
and unlimited max buffer size.
|
AsciiLinePacketReader(int maxLineLength)
Creates a '\n' delimited reader with the given max line length
and default read buffer size.
|
AsciiLinePacketReader(int readBufferSize,
int maxLineLength)
Creates a '\n' delimited reader with the given max line length
and read buffer size.
|
getBuffer, getMaxPacketSize, getNextPacket, setMaxPacketSize
public AsciiLinePacketReader()
public AsciiLinePacketReader(int readBufferSize, int maxLineLength)
Exceeding the line length 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.maxLineLength
- maximum line length.public AsciiLinePacketReader(int maxLineLength)
Exceeding the line length will throw a ProtocolViolationException.
maxLineLength
- maximum line length.