Class ConfigurableTByteBuffer

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class ConfigurableTByteBuffer
    extends org.apache.thrift.transport.TEndpointTransport
    Source code of this class is a copy of TByteBuffer. However, TByteBuffer is a final class and has only one construction method which uses the default TConfiguration. In some cases, the capacity of our ByteBuffer could be so large that it reaches the MaxMessageSize of thrift. We need to customize the TConfiguration and that is why we use this class.
    • Constructor Detail

      • ConfigurableTByteBuffer

        public ConfigurableTByteBuffer​(ByteBuffer byteBuffer)
                                throws org.apache.thrift.transport.TTransportException
        Throws:
        org.apache.thrift.transport.TTransportException
      • ConfigurableTByteBuffer

        public ConfigurableTByteBuffer​(ByteBuffer byteBuffer,
                                       org.apache.thrift.TConfiguration configuration)
                                throws org.apache.thrift.transport.TTransportException
        Throws:
        org.apache.thrift.transport.TTransportException
    • Method Detail

      • isOpen

        public boolean isOpen()
        Specified by:
        isOpen in class org.apache.thrift.transport.TTransport
      • open

        public void open()
        Specified by:
        open in class org.apache.thrift.transport.TTransport
      • close

        public void close()
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in class org.apache.thrift.transport.TTransport
      • read

        public int read​(byte[] buf,
                        int off,
                        int len)
                 throws org.apache.thrift.transport.TTransportException
        Specified by:
        read in class org.apache.thrift.transport.TTransport
        Throws:
        org.apache.thrift.transport.TTransportException
      • write

        public void write​(byte[] buf,
                          int off,
                          int len)
                   throws org.apache.thrift.transport.TTransportException
        Specified by:
        write in class org.apache.thrift.transport.TTransport
        Throws:
        org.apache.thrift.transport.TTransportException
      • getByteBuffer

        public ByteBuffer getByteBuffer()
      • toByteArray

        public byte[] toByteArray()