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 * Callback for {@link ProtocolEncoder} to generate encoded {@link ByteBuffer}s.
25 * {@link ProtocolEncoder} must call {@link #write(ByteBuffer)} for each decoded
26 * messages.
27 *
28 * @author Trustin Lee (trustin@apache.org)
29 * @version $Rev: 210062 $, $Date: 2005-07-11 12:52:38 +0900 $
30 */
31 public interface ProtocolEncoderOutput
32 {
33 /***
34 * Callback for {@link ProtocolEncoder} to generate encoded
35 * {@link ByteBuffer}s. {@link ProtocolEncoder} must call
36 * {@link #write(ByteBuffer)} for each decoded messages.
37 *
38 * @param buf the buffer which contains encoded data
39 */
40 void write( ByteBuffer buf );
41
42 /***
43 * Merges all buffers you wrote via {@link #write(ByteBuffer)} into
44 * one {@link ByteBuffer} and replaces the old fragmented ones with it.
45 * This method is useful when you want to control the way MINA generates
46 * network packets.
47 */
48 void mergeAll();
49 }