public interface ProtocolParser
Modifier and Type | Method and Description |
---|---|
void |
process(java.nio.ByteBuffer buffer,
int length,
MessageHandler listener)
Processes a region of a byte buffer into messages of a specific protocol and then invokes the specified message
handler for each message parsed from the bytes.
|
void process(java.nio.ByteBuffer buffer, int length, MessageHandler listener) throws StreamException
buffer
- The byte buffer to be processed.length
- The length of the byte buffer.listener
- The message handler invoked for each message.StreamException
- Thrown when the buffer contains corrupt data or data that is in an invalid format.