org.apache.mina.examples.reverser
Class TextLineEncoder

java.lang.Object
  extended by org.apache.mina.examples.reverser.TextLineEncoder
All Implemented Interfaces:
ProtocolEncoder

public class TextLineEncoder
extends Object
implements ProtocolEncoder

Encodes a string into a text line which ends with "\r\n".

Version:
$Rev: 264677 $, $Date: 2005-08-30 11:44:35 +0900 $,
Author:
Trustin Lee (trustin@apache.org)

Constructor Summary
TextLineEncoder()
           
 
Method Summary
 void encode(ProtocolSession session, Object message, ProtocolEncoderOutput out)
          Encodes higher-level message objects into binary or protocol-specific data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextLineEncoder

public TextLineEncoder()
Method Detail

encode

public void encode(ProtocolSession session,
                   Object message,
                   ProtocolEncoderOutput out)
            throws ProtocolViolationException
Description copied from interface: ProtocolEncoder
Encodes higher-level message objects into binary or protocol-specific data. MINA invokes ProtocolEncoder.encode(ProtocolSession, Object, ProtocolEncoderOutput) method with message which is popped from the session write queue, and then the encoder implementation puts encoded ByteBuffers into ProtocolEncoderOutput.

Specified by:
encode in interface ProtocolEncoder
Throws:
ProtocolViolationException - if the message violated protocol specification


Copyright © 2004-2005 . All Rights Reserved.