Class ExpandableBuffer

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int INPUT_MODE  
      static int OUTPUT_MODE  
    • Constructor Summary

      Constructors 
      Constructor Description
      ExpandableBuffer​(int buffersize, ByteBufferAllocator allocator)
      Allocates buffer of the given size using the given allocator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int available()
      Returns available capacity of this buffer.
      int capacity()
      Returns the total capacity of this buffer.
      boolean hasData()
      Determines if the buffer contains data.
      int length()
      Returns the length of this buffer.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ExpandableBuffer

        public ExpandableBuffer​(int buffersize,
                                ByteBufferAllocator allocator)
        Allocates buffer of the given size using the given allocator.
        Parameters:
        buffersize - the buffer size.
        allocator - allocator to be used to allocate ByteBuffers.
    • Method Detail

      • capacity

        public int capacity()
        Returns the total capacity of this buffer.
        Specified by:
        capacity in interface BufferInfo
        Specified by:
        capacity in interface BufferInfo
        Returns:
        total capacity.
      • hasData

        public boolean hasData()
        Determines if the buffer contains data.
        Returns:
        true if there is data in the buffer, false otherwise.
      • length

        public int length()
        Returns the length of this buffer.
        Specified by:
        length in interface BufferInfo
        Specified by:
        length in interface BufferInfo
        Returns:
        buffer length.
      • available

        public int available()
        Returns available capacity of this buffer.
        Specified by:
        available in interface BufferInfo
        Specified by:
        available in interface BufferInfo
        Returns:
        buffer length.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object