Class CachedBufferAllocator.CachedBuffer

    • Field Detail

      • ownerThread

        private final java.lang.Thread ownerThread
      • buf

        private java.nio.ByteBuffer buf
    • Constructor Detail

      • CachedBuffer

        protected CachedBuffer​(java.nio.ByteBuffer buf)
    • Method Detail

      • buf

        public java.nio.ByteBuffer buf()
        Specified by:
        buf in class IoBuffer
        Returns:
        the underlying NIO ByteBuffer instance.
      • buf

        protected void buf​(java.nio.ByteBuffer buf)
        Description copied from class: AbstractIoBuffer
        Sets the underlying NIO buffer instance.
        Specified by:
        buf in class AbstractIoBuffer
        Parameters:
        buf - The buffer to store within this IoBuffer
      • duplicate0

        protected IoBuffer duplicate0()
        Description copied from class: AbstractIoBuffer
        Implement this method to return the unexpandable duplicate of this buffer.
        Specified by:
        duplicate0 in class AbstractIoBuffer
        Returns:
        the IoBoffer instance
      • slice0

        protected IoBuffer slice0()
        Description copied from class: AbstractIoBuffer
        Implement this method to return the unexpandable slice of this buffer.
        Specified by:
        slice0 in class AbstractIoBuffer
        Returns:
        the IoBoffer instance
      • array

        public byte[] array()
        Specified by:
        array in class IoBuffer
        Returns:
        A byte[] if this IoBuffer supports it
        See Also:
        ByteBuffer.array()
      • arrayOffset

        public int arrayOffset()
        Specified by:
        arrayOffset in class IoBuffer
        Returns:
        The offset in the returned byte[] when the IoBuffer.array() method is called
        See Also:
        ByteBuffer.arrayOffset()
      • hasArray

        public boolean hasArray()
        Specified by:
        hasArray in class IoBuffer
        Returns:
        true if the IoBuffer.array() method will return a byte[]
        See Also:
        ByteBuffer.hasArray()
      • free

        public void free()
        Description copied from class: IoBuffer
        Declares this buffer and all its derived buffers are not used anymore so that it can be reused by some IoBufferAllocator implementations. It is not mandatory to call this method, but you might want to invoke this method for maximum performance.
        Specified by:
        free in class IoBuffer
      • free

        private void free​(java.nio.ByteBuffer oldBuf)