Class ReleasableSSLBufferManagementStrategy.InternalBuffer

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int length  
      private java.nio.ByteBuffer wrapped  
    • Constructor Summary

      Constructors 
      Constructor Description
      InternalBuffer​(int size)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.nio.ByteBuffer acquire()
      Allocates the resources required for this buffer, or returns the resources already allocated for this buffer.
      boolean hasData()
      Tests to make sure that the buffer has been acquired and the underlying buffer has a position larger than 0.
      boolean isAcquired()
      Tests to see if this buffer has been acquired.
      void release()
      Releases the resources for this buffer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • wrapped

        private java.nio.ByteBuffer wrapped
      • length

        private final int length
    • Constructor Detail

      • InternalBuffer

        public InternalBuffer​(int size)
    • Method Detail

      • acquire

        public java.nio.ByteBuffer acquire()
        Description copied from interface: SSLBuffer
        Allocates the resources required for this buffer, or returns the resources already allocated for this buffer. Unless SSLBuffer.release() is called, multiple invokations to this method must return the same ByteBuffer.
        Specified by:
        acquire in interface SSLBuffer
        Returns:
        buffer
      • release

        public void release()
        Description copied from interface: SSLBuffer
        Releases the resources for this buffer. If the buffer has already been released, this method does nothing.
        Specified by:
        release in interface SSLBuffer
      • isAcquired

        public boolean isAcquired()
        Description copied from interface: SSLBuffer
        Tests to see if this buffer has been acquired.
        Specified by:
        isAcquired in interface SSLBuffer
        Returns:
        true if the buffer is acquired, otherwise false
      • hasData

        public boolean hasData()
        Description copied from interface: SSLBuffer
        Tests to make sure that the buffer has been acquired and the underlying buffer has a position larger than 0. Essentially the same as isAquired() && acquire().position > 0.
        Specified by:
        hasData in interface SSLBuffer
        Returns:
        true if the buffer has been acquired and the underlying buffer's position is > 0, otherwise false