Class TCPNIOUtils


  • public class TCPNIOUtils
    extends java.lang.Object
    TCP NIO Transport utils
    Author:
    Alexey Stashok
    • Constructor Detail

      • TCPNIOUtils

        public TCPNIOUtils()
    • Method Detail

      • writeCompositeBuffer

        public static int writeCompositeBuffer​(TCPNIOConnection connection,
                                               CompositeBuffer buffer)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • writeSimpleBuffer

        public static int writeSimpleBuffer​(TCPNIOConnection connection,
                                            Buffer buffer)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • flushByteBuffer

        public static int flushByteBuffer​(java.nio.channels.SocketChannel channel,
                                          java.nio.ByteBuffer byteBuffer)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • flushByteBuffers

        public static int flushByteBuffers​(java.nio.channels.SocketChannel channel,
                                           java.nio.ByteBuffer[] byteBuffer,
                                           int firstBufferOffest,
                                           int numberOfBuffers)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • allocateAndReadBuffer

        public static Buffer allocateAndReadBuffer​(TCPNIOConnection connection)
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • readBuffer

        public static int readBuffer​(TCPNIOConnection connection,
                                     Buffer buffer)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • readCompositeBuffer

        public static int readCompositeBuffer​(TCPNIOConnection connection,
                                              CompositeBuffer buffer)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • readSimpleBuffer

        public static int readSimpleBuffer​(TCPNIOConnection connection,
                                           Buffer buffer)
                                    throws java.io.IOException
        Throws:
        java.io.IOException