org.apache.mina.filter.codec

## Class AbstractProtocolEncoderOutput

- java.lang.Object
- - org.apache.mina.filter.codec.AbstractProtocolEncoderOutput

- All Implemented Interfaces:
    ProtocolEncoderOutput

      public abstract class AbstractProtocolEncoderOutput
      extends Object
      implements ProtocolEncoderOutput

  A `ProtocolEncoderOutput` based on queue.
  Author:
    Apache MINA Project

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractProtocolEncoderOutput()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Queue<Object>` | `getMessageQueue()`
    `void` | `mergeAll()` Merges all buffers you wrote via `ProtocolEncoderOutput.write(Object)` into one `IoBuffer` and replaces the old fragmented ones with it.
    `void` | `write(Object encodedMessage)` Callback for `ProtocolEncoder` to generate an encoded message such as an `IoBuffer`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.mina.filter.codec.ProtocolEncoderOutput

      `flush`

- - ### Constructor Detail

    - #### AbstractProtocolEncoderOutput

          public AbstractProtocolEncoderOutput()

  - ### Method Detail

    - #### getMessageQueue

          public Queue<Object> getMessageQueue()

    - #### write

          public void write(Object encodedMessage)

      Description copied from interface: `ProtocolEncoderOutput`
      Callback for `ProtocolEncoder` to generate an encoded message such as an `IoBuffer`. `ProtocolEncoder` must call `ProtocolEncoderOutput.write(Object)` for each encoded message.
      Specified by:
        `write` in interface `ProtocolEncoderOutput`
      Parameters:
        `encodedMessage` - the encoded message, typically an `IoBuffer` or a `FileRegion`.

    - #### mergeAll

          public void mergeAll()

      Description copied from interface: `ProtocolEncoderOutput`
      Merges all buffers you wrote via `ProtocolEncoderOutput.write(Object)` into one `IoBuffer` and replaces the old fragmented ones with it. This method is useful when you want to control the way MINA generates network packets. Please note that this method only works when you called `ProtocolEncoderOutput.write(Object)` method with only `IoBuffer`s.
      Specified by:
        `mergeAll` in interface `ProtocolEncoderOutput`

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