public class SizePrefixedDecoder<OUT> extends Object implements ProtocolDecoder<IoBuffer,OUT,SizePrefixedDecoder.MutableInt>
Modifier and Type | Class and Description |
---|---|
protected static class |
SizePrefixedDecoder.MutableInt
A mutable
Integer wrapper. |
Constructor and Description |
---|
SizePrefixedDecoder(IoBufferDecoder<Integer> sizeDecoder,
IoBufferDecoder<OUT> payloadDecoder) |
Modifier and Type | Method and Description |
---|---|
SizePrefixedDecoder.MutableInt |
createDecoderState()
Create a new session context for this decoder
|
OUT |
decode(IoBuffer input,
SizePrefixedDecoder.MutableInt nextBlockSize)
Decode binary or protocol-specific content of type
INPUT into higher-level protocol message objects,
of type OUTPUT |
void |
finishDecode(SizePrefixedDecoder.MutableInt context)
Finish decoding, for example if the decoder accumulated some unused input, it should discard it, or throw an
Exception
|
public SizePrefixedDecoder(IoBufferDecoder<Integer> sizeDecoder, IoBufferDecoder<OUT> payloadDecoder)
public SizePrefixedDecoder.MutableInt createDecoderState()
ProtocolDecoder
createDecoderState
in interface ProtocolDecoder<IoBuffer,OUT,SizePrefixedDecoder.MutableInt>
public OUT decode(IoBuffer input, SizePrefixedDecoder.MutableInt nextBlockSize)
ProtocolDecoder
INPUT
into higher-level protocol message objects,
of type OUTPUTdecode
in interface ProtocolDecoder<IoBuffer,OUT,SizePrefixedDecoder.MutableInt>
input
- the received message to decodenextBlockSize
- the decoding context (will be stored in the session for the next decode call)null
if nothing was decodedpublic void finishDecode(SizePrefixedDecoder.MutableInt context)
ProtocolDecoder
finishDecode
in interface ProtocolDecoder<IoBuffer,OUT,SizePrefixedDecoder.MutableInt>
Copyright © 2009–2013 Apache MINA Project. All rights reserved.