public class SizePrefixedEncoder<IN> extends Object implements StatelessProtocolEncoder<IN,ByteBuffer>
| Constructor and Description |
|---|
SizePrefixedEncoder(ByteBufferEncoder<Integer> sizeEncoder,
ByteBufferEncoder<IN> payloadEncoder) |
| Modifier and Type | Method and Description |
|---|---|
Void |
createEncoderState()
Create a new session context for this decoder
|
ByteBuffer |
encode(IN message,
Void context)
Encodes higher-level message objects of type
INPUT into binary or protocol-specific data of type
OUTPUT. |
public SizePrefixedEncoder(ByteBufferEncoder<Integer> sizeEncoder, ByteBufferEncoder<IN> payloadEncoder)
public Void createEncoderState()
ProtocolEncodercreateEncoderState in interface ProtocolEncoder<IN,ByteBuffer,Void>public ByteBuffer encode(IN message, Void context)
ProtocolEncoderINPUT into binary or protocol-specific data of type
OUTPUT.encode in interface ProtocolEncoder<IN,ByteBuffer,Void>message - the message to encodecontext - the encoding context (will be stored in the session for the next decode call)Copyright © 2009–2013 Apache MINA Project. All rights reserved.