com.hazelcast.nio.ascii

## Class TextDecoder

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

- All Implemented Interfaces:
    com.hazelcast.internal.networking.ChannelInboundHandler

      @PrivateApi
      public class TextDecoder
      extends Object
      implements com.hazelcast.internal.networking.ChannelInboundHandler

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TextDecoder(TcpIpConnection connection, TextEncoder encoder)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `closeConnection()`
    `TextEncoder` | `getEncoder()`
    `void` | `onRead(ByteBuffer src)` A callback to indicate that data is available in the src ByteBuffer to be processed.
    `void` | `publishRequest(com.hazelcast.internal.ascii.TextCommand command)`
    `void` | `sendResponse(com.hazelcast.internal.ascii.TextCommand command)`

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

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

- - ### Constructor Detail

    - #### TextDecoder

          public TextDecoder(TcpIpConnection connection,
                             TextEncoder encoder)

  - ### Method Detail

    - #### sendResponse

          public void sendResponse(com.hazelcast.internal.ascii.TextCommand command)

    - #### onRead

          public void onRead(ByteBuffer src)
                      throws Exception

      Description copied from interface: `com.hazelcast.internal.networking.ChannelInboundHandler`
      A callback to indicate that data is available in the src ByteBuffer to be processed.
      Specified by:
        `onRead` in interface `com.hazelcast.internal.networking.ChannelInboundHandler`
      Parameters:
        `src` - the ByteBuffer containing the data to read. The ByteBuffer is already in reading mode and when completed, should not be converted to write-mode using clear/compact.
      Throws:
        `Exception` - if something fails while reading data from the ByteBuffer or processing the data (e.g. when a Packet fails to get processed). When an exception is thrown, the `ChannelErrorHandler` is called.

    - #### publishRequest

          public void publishRequest(com.hazelcast.internal.ascii.TextCommand command)

    - #### getEncoder

          public TextEncoder getEncoder()

    - #### closeConnection

          public void closeConnection()

Copyright © 2018. All rights reserved.