com.hazelcast.nio.ascii

## Class TextEncoder

- java.lang.Object
- - com.hazelcast.nio.ascii.TextEncoder

- All Implemented Interfaces:
    com.hazelcast.internal.networking.ChannelOutboundHandler<com.hazelcast.internal.ascii.TextCommand>

      @PrivateApi
      public class TextEncoder
      extends Object
      implements com.hazelcast.internal.networking.ChannelOutboundHandler<com.hazelcast.internal.ascii.TextCommand>

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TextEncoder(TcpIpConnection connection)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `enqueue(com.hazelcast.internal.ascii.TextCommand response)`
    `boolean` | `onWrite(com.hazelcast.internal.ascii.TextCommand textCommand, ByteBuffer dst)` A callback to indicate that the Frame should be written to the destination ByteBuffer.

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

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

- - ### Constructor Detail

    - #### TextEncoder

          public TextEncoder(TcpIpConnection connection)

  - ### Method Detail

    - #### enqueue

          public void enqueue(com.hazelcast.internal.ascii.TextCommand response)

    - #### onWrite

          public boolean onWrite(com.hazelcast.internal.ascii.TextCommand textCommand,
                                 ByteBuffer dst)
                          throws Exception

      Description copied from interface: `com.hazelcast.internal.networking.ChannelOutboundHandler`
      A callback to indicate that the Frame should be written to the destination ByteBuffer. It could be that a Frame is too big to fit into the ByteBuffer in 1 go; in that case this call will be made for the same Frame multiple times until write returns true.
      Specified by:
        `onWrite` in interface `com.hazelcast.internal.networking.ChannelOutboundHandler<com.hazelcast.internal.ascii.TextCommand>`
      Parameters:
        `textCommand` - the Frame to write
        `dst` - the destination ByteBuffer
      Returns:
        true if the Frame is completely written
      Throws:
        `Exception` - if something fails while writing to ByteBuffer. When an exception is thrown, the `ChannelErrorHandler` is called.

Copyright © 2018. All rights reserved.