public interface ByteProcessor
| Modifier and Type | Method and Description |
|---|---|
void |
flushUnprocessedBytes()
Discard all the bytes which have not been processed.
|
void |
processBytes(ByteSource networkData)
Process byte stream; processing a byte stream typically involves
encoding, parsing and building a packet.
|
void |
processBytes(ByteSource networkData,
int length)
Process byte stream; processing a byte stream typically involves
encoding, parsing and building a packet.
|
void |
resume(Packet switchOver)
Resume processing a byte stream.
|
int |
unprocessedByteCount()
A byte processor is likely to process bytes in chunks from a
ByteSource. |
void resume(Packet switchOver)
switchOver - half-built packet from previous processorvoid processBytes(ByteSource networkData) throws Exception
ParserException or MalformedStreamExceptionnetworkData - networkDataException - exceptionvoid processBytes(ByteSource networkData, int length) throws Exception
ParserException or MalformedStreamException anetworkData - networkDatalength - lengthException - Exceptionint unprocessedByteCount()
ByteSource. It may happen that before a byte processor finishes
processing a byte chunk, byte processing is taken over by another
ByteProcessor. In this case, the active byte processor will
require to know the number pf bytes which were left unprocessed in the
chunk.void flushUnprocessedBytes()
Copyright © 2019. All rights reserved.