Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.mina.filter.codec
Interface ProtocolEncoderOutput

    public interface ProtocolEncoderOutput

Callback for `ProtocolEncoder` to generate encoded `ByteBuffer`s. `ProtocolEncoder` must call `write(ByteBuffer)` for each encoded message.

Version:
  $Rev: 555855 $, $Date: 2007-07-13 12:19:00 +0900 (Fri, 13 Jul 2007) $
Author:
  The Apache Directory Project (mina-dev@directory.apache.org)

Method Summary
`WriteFuture` | `flush()` Flushes all buffers you wrote via `write(ByteBuffer)` to the session.
`void` | `mergeAll()` Merges all buffers you wrote via `write(ByteBuffer)` into one `ByteBuffer` and replaces the old fragmented ones with it.
`void` | `write(ByteBuffer buf)` Callback for `ProtocolEncoder` to generate encoded `ByteBuffer`s.

Method Detail

### write

    void write(ByteBuffer buf)

  Callback for `ProtocolEncoder` to generate encoded `ByteBuffer`s. `ProtocolEncoder` must call `write(ByteBuffer)` for each encoded message.

  Parameters:
    `buf` - the buffer which contains encoded data

### mergeAll

    void mergeAll()

  Merges all buffers you wrote via `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.

### flush

    WriteFuture flush()

  Flushes all buffers you wrote via `write(ByteBuffer)` to the session. This operation is asynchronous; please wait for the returned `WriteFuture` if you want to wait for the buffers flushed.

  Returns:
    `null` if there is nothing to flush at all.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2008 Apache MINA Project. All Rights Reserved.