public abstract class FixedLengthDecodingState extends java.lang.Object implements DecodingState
DecodingState
which consumes all received bytes until a configured
number of read bytes has been reached. Please note that this state can
produce the buffer with less data if the associated session has been
closed unexpectedly.Constructor and Description |
---|
FixedLengthDecodingState(int length)
Constructs with a known decode length.
|
Modifier and Type | Method and Description |
---|---|
DecodingState |
decode(IoBuffer in,
ProtocolDecoderOutput out)
Invoked when data is available for this state.
|
protected abstract DecodingState |
finishDecode(IoBuffer readData,
ProtocolDecoderOutput out) |
DecodingState |
finishDecode(ProtocolDecoderOutput out)
Invoked when the associated
IoSession is closed. |
public FixedLengthDecodingState(int length)
length
- The decode lengthpublic DecodingState decode(IoBuffer in, ProtocolDecoderOutput out) throws java.lang.Exception
DecodingState
decode
in interface DecodingState
java.lang.Exception
public DecodingState finishDecode(ProtocolDecoderOutput out) throws java.lang.Exception
DecodingState
IoSession
is closed.finishDecode
in interface DecodingState
java.lang.Exception
protected abstract DecodingState finishDecode(IoBuffer readData, ProtocolDecoderOutput out) throws java.lang.Exception
java.lang.Exception
Copyright © 2004-2019 Apache MINA Project. All Rights Reserved.