com.tibbo.aggregate.common.util

## Class SocketBlockingChannel

- java.lang.Object
- - com.tibbo.aggregate.common.util.SocketBlockingChannel

- All Implemented Interfaces:
    BlockingChannel, java.io.Closeable, java.lang.AutoCloseable, java.nio.channels.ByteChannel, java.nio.channels.Channel, java.nio.channels.ReadableByteChannel, java.nio.channels.WritableByteChannel

      public class SocketBlockingChannel
      extends java.lang.Object
      implements BlockingChannel

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SocketBlockingChannel()`
    `SocketBlockingChannel(java.net.Socket socket)`
    `SocketBlockingChannel(java.net.Socket socket, boolean compressData, int bufferSize)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `flush()`
    `java.lang.String` | `getChannelAddress()`
    `java.net.Socket` | `getSocket()`
    `boolean` | `isOpen()`
    `boolean` | `isUsesCompression()`
    `int` | `read(java.nio.ByteBuffer dst)`
    `void` | `setUsesCompression(boolean usesCompression)`
    `int` | `write(java.nio.ByteBuffer byteBuffer)`

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

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

- - ### Constructor Detail

    - #### SocketBlockingChannel

          public SocketBlockingChannel(java.net.Socket socket)
                                throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### SocketBlockingChannel

          public SocketBlockingChannel(java.net.Socket socket,
                                       boolean compressData,
                                       int bufferSize)
                                throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### SocketBlockingChannel

          public SocketBlockingChannel()

  - ### Method Detail

    - #### read

          public int read(java.nio.ByteBuffer dst)
                   throws java.io.IOException

      Specified by:
        `read` in interface `java.nio.channels.ReadableByteChannel`
      Throws:
        `java.io.IOException`

    - #### write

          public int write(java.nio.ByteBuffer byteBuffer)
                    throws java.io.IOException

      Specified by:
        `write` in interface `java.nio.channels.WritableByteChannel`
      Throws:
        `java.io.IOException`

    - #### flush

          public void flush()
                     throws java.io.IOException

      Specified by:
        `flush` in interface `BlockingChannel`
      Throws:
        `java.io.IOException`

    - #### isUsesCompression

          public boolean isUsesCompression()

      Specified by:
        `isUsesCompression` in interface `BlockingChannel`

    - #### setUsesCompression

          public void setUsesCompression(boolean usesCompression)

      Specified by:
        `setUsesCompression` in interface `BlockingChannel`

    - #### close

          public void close()
                     throws java.io.IOException

      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Specified by:
        `close` in interface `java.nio.channels.Channel`
      Throws:
        `java.io.IOException`

    - #### isOpen

          public boolean isOpen()

      Specified by:
        `isOpen` in interface `java.nio.channels.Channel`

    - #### getSocket

          public java.net.Socket getSocket()

    - #### getChannelAddress

          public java.lang.String getChannelAddress()

      Specified by:
        `getChannelAddress` in interface `BlockingChannel`