|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.comm.codec.Decoder<ByteBuffer,ByteBuffer>
com.kuka.comm.codec.bytebuffer.LengthDecoder
public final class LengthDecoder
Decoder that reads length information for a variable or fixed length payload and extracts the payload. If the remaining buffer contains enough bytes, the payload is passed on to the next decoder.
| Constructor Summary | |
|---|---|
LengthDecoder(int fixedLength)
Creates a new decoder for fixed length payload. |
|
LengthDecoder(LengthFieldType type)
Creates a new decoder for variable length payload. |
|
| Method Summary | |
|---|---|
protected ByteBuffer |
decodeImpl(ByteBuffer in)
Realization of the decoding method to be implemented in subclasses. |
| Methods inherited from class com.kuka.comm.codec.Decoder |
|---|
concat, decode |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LengthDecoder(LengthFieldType type)
type - the type of the length field, must not be null
IllegalArgumentException - if the length type is nullpublic LengthDecoder(int fixedLength)
fixedLength - the fixed length of the payload, must be greater than 0
IllegalArgumentException - if the fixed length is less or equal than 0| Method Detail |
|---|
protected ByteBuffer decodeImpl(ByteBuffer in)
throws DecoderException
DecoderDecoder.decode(Object) method.
Return null to indicate that the decoder could not finish its job (e.g. because the input was
incomplete). The decoding will be cancelled, i.e. concatenated decoders coming after this decoder will not be
called, and the decoding process will restart, when more data is available. Throw an exception to indicate that
an error occurred during decoding. The data read so far will be discarded.
decodeImpl in class Decoder<ByteBuffer,ByteBuffer>in - the input for this decoder, usually the message to be decoded
null if the input was incomplete
DecoderException - if an error occurred during decoding
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||