Interface ProtocolDecoder
- All Known Implementing Classes:
CumulativeProtocolDecoder, DecodingStateProtocolDecoder, DemuxingProtocolDecoder, HttpClientDecoder, HttpServerDecoder, ObjectSerializationDecoder, PrefixedStringDecoder, ProtocolDecoderAdapter, SynchronizedProtocolDecoder, TextLineDecoder
public interface ProtocolDecoder
Decodes binary or protocol-specific data into higher-level message objects.
MINA invokes
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.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoiddecode(IoSession session, IoBuffer in, ProtocolDecoderOutput out) Decodes binary or protocol-specific content into higher-level message objects.voidReleases all resources related with this decoder.voidfinishDecode(IoSession session, ProtocolDecoderOutput out) Invoked when the specifiedsessionis closed.
-
Method Details
-
decode
Decodes binary or protocol-specific content into higher-level message objects. MINA invokesdecode(IoSession, IoBuffer, ProtocolDecoderOutput)method with read data, and then the decoder implementation puts decoded messages intoProtocolDecoderOutput.- Parameters:
session- The current Sessionin- the buffer to decodeout- TheProtocolDecoderOutputthat will receive the decoded message- Throws:
Exception- if the read data violated protocol specification
-
finishDecode
Invoked when the specifiedsessionis closed. This method is useful when you deal with the protocol which doesn't specify the length of a message such as HTTP response withoutcontent-lengthheader. Implement this method to process the remaining data thatdecode(IoSession, IoBuffer, ProtocolDecoderOutput)method didn't process completely.- Parameters:
session- The current Sessionout- TheProtocolDecoderOutputthat contains the decoded message- Throws:
Exception- if the read data violated protocol specification
-
dispose
-