public interface ProtocolDecoder
Objects implementing this interface are created by Protocol objects. They
are used to decompose a stream into individual datagrams.
| Modifier and Type | Method and Description |
|---|---|
void |
decode(byte[] buf,
int offset,
int length)
Decode data from the stream.
|
byte[] |
getNext()
Get the next datagram.
|
boolean |
inputRequired()
Check whether the decoder requires more input.
|
boolean inputRequired()
getNext(),
false if no datagram is available and the caller should provide more
input using decode(byte[], int, int)void decode(byte[] buf,
int offset,
int length)
inputRequired() returned
true.buf - a byte array containing data from the streamoffset - the start offset in the datalength - the number of bytesbyte[] getNext()
inputRequired() returned
false. Otherwise the result is undefined.Copyright © 2005-2017 Apache Software Foundation. All Rights Reserved.