org.apache.mina.protocol
Class SimpleProtocolEncoderOutput

java.lang.Object
  extended by org.apache.mina.protocol.SimpleProtocolEncoderOutput
All Implemented Interfaces:
ProtocolEncoderOutput

public class SimpleProtocolEncoderOutput
extends Object
implements ProtocolEncoderOutput

A ProtocolEncoderOutput based on queue.

Version:
$Rev: 332218 $, $Date: 2005-11-10 12:52:42 +0900 $
Author:
The Apache Directory Project (dev@directory.apache.org)

Constructor Summary
SimpleProtocolEncoderOutput()
           
 
Method Summary
 Queue getBufferQueue()
           
 void mergeAll()
          Merges all buffers you wrote via ProtocolEncoderOutput.write(ByteBuffer) into one ByteBuffer and replaces the old fragmented ones with it.
 void write(ByteBuffer buf)
          Callback for ProtocolEncoder to generate encoded ByteBuffers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleProtocolEncoderOutput

public SimpleProtocolEncoderOutput()
Method Detail

getBufferQueue

public Queue getBufferQueue()

write

public void write(ByteBuffer buf)
Description copied from interface: ProtocolEncoderOutput
Callback for ProtocolEncoder to generate encoded ByteBuffers. ProtocolEncoder must call ProtocolEncoderOutput.write(ByteBuffer) for each decoded messages.

Specified by:
write in interface ProtocolEncoderOutput
Parameters:
buf - the buffer which contains encoded data

mergeAll

public void mergeAll()
Description copied from interface: ProtocolEncoderOutput
Merges all buffers you wrote via ProtocolEncoderOutput.write(ByteBuffer) into one ByteBuffer and replaces the old fragmented ones with it. This method is useful when you want to control the way MINA generates network packets.

Specified by:
mergeAll in interface ProtocolEncoderOutput


Copyright © 2004-2005 . All Rights Reserved.