org.apache.mina.filter.codec
Interface ProtocolDecoder

All Known Implementing Classes:
Asn1CodecDecoder, CumulativeProtocolDecoder, NettyDecoder, ObjectSerializationDecoder, ProtocolDecoderAdapter, SynchronizedProtocolDecoder, TextLineDecoder

public interface ProtocolDecoder

Decodes binary or protocol-specific data into higher-level message objects. MINA invokes decode(IoSession, ByteBuffer, 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.

Version:
$Rev: 391231 $, $Date: 2006-04-04 15:21:55 +0900 (Tue, 04 Apr 2006) $
Author:
The Apache Directory Project (mina-dev@directory.apache.org)

Method Summary
 void decode(IoSession session, ByteBuffer 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.
 

Method Detail

decode

void decode(IoSession session,
            ByteBuffer in,
            ProtocolDecoderOutput out)
            throws Exception
Decodes binary or protocol-specific content into higher-level message objects. MINA invokes decode(IoSession, ByteBuffer, ProtocolDecoderOutput) method with read data, and then the decoder implementation puts decoded messages into ProtocolDecoderOutput.

Throws:
Exception - if the read data violated protocol specification

dispose

void dispose(IoSession session)
             throws Exception
Releases all resources related with this decoder.

Throws:
Exception - if failed to dispose all resources