public interface ProtocolDecoder
decode(IoSession, IoBuffer, ProtocolDecoderOutput)
method with read data, and then the decoder implementation puts decoded
messages into ProtocolDecoderOutput
by calling
ProtocolDecoderOutput.write(Object)
.
Please refer to
TextLineDecoder
example.
ProtocolDecoderException
Modifier and Type | Method and Description |
---|---|
void |
decode(IoSession session,
IoBuffer in,
ProtocolDecoderOutput out)
Decodes binary or protocol-specific content into higher-level message objects.
|
void |
dispose(IoSession session)
Releases all resources related with this decoder.
|
void |
finishDecode(IoSession session,
ProtocolDecoderOutput out)
Invoked when the specified
session is closed. |
void decode(IoSession session, IoBuffer in, ProtocolDecoderOutput out) throws Exception
decode(IoSession, IoBuffer, ProtocolDecoderOutput)
method with read data, and then the decoder implementation puts decoded
messages into ProtocolDecoderOutput
.session
- The current Sessionin
- the buffer to decodeout
- The ProtocolDecoderOutput
that will receive the decoded messageException
- if the read data violated protocol specificationvoid finishDecode(IoSession session, ProtocolDecoderOutput out) throws Exception
session
is closed. This method is useful
when you deal with the protocol which doesn't specify the length of a message
such as HTTP response without content-length
header. Implement this
method to process the remaining data that decode(IoSession, IoBuffer, ProtocolDecoderOutput)
method didn't process completely.session
- The current Sessionout
- The ProtocolDecoderOutput
that contains the decoded messageException
- if the read data violated protocol specificationCopyright © 2004–2025 Apache MINA Project. All rights reserved.