1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.mina.protocol;
20
21 import org.apache.mina.common.ByteBuffer;
22
23 /***
24 * Decodes binary or protocol-specific data into higher-level message objects.
25 * MINA invokes {@link #decode(ProtocolSession, ByteBuffer, ProtocolDecoderOutput)}
26 * method with read data, and then the decoder implementation puts decoded
27 * messages into {@link ProtocolDecoderOutput} by calling
28 * {@link ProtocolDecoderOutput#write(Object)}.
29 * <p>
30 * Please refer to
31 * <a href="../../../../../xref-examples/org/apache/mina/examples/reverser/TextLineDecoder.html"><code>TextLineDecoder</code></a>
32 * example.
33 *
34 * @author Trustin Lee (trustin@apache.org)
35 * @version $Rev: 210062 $, $Date: 2005-07-11 12:52:38 +0900 $
36 */
37 public interface ProtocolDecoder
38 {
39 /***
40 * Decodes binary or protocol-specific content into higher-level message objects.
41 * MINA invokes {@link #decode(ProtocolSession, ByteBuffer, ProtocolDecoderOutput)}
42 * method with read data, and then the decoder implementation puts decoded
43 * messages into {@link ProtocolDecoderOutput}.
44 *
45 * @throws ProtocolViolationException if the read data violated protocol
46 * specification
47 */
48 void decode( ProtocolSession session, ByteBuffer in,
49 ProtocolDecoderOutput out ) throws ProtocolViolationException;
50 }