Class AbstractPooledDerivedByteBuf.PooledNonRetainedSlicedByteBuf

All Implemented Interfaces:
ByteBufConvertible, ReferenceCounted, Comparable<ByteBuf>
Enclosing class:
AbstractPooledDerivedByteBuf

private static final class AbstractPooledDerivedByteBuf.PooledNonRetainedSlicedByteBuf extends UnpooledSlicedByteBuf
  • Field Details

    • referenceCountDelegate

      private final ByteBuf referenceCountDelegate
  • Constructor Details

    • PooledNonRetainedSlicedByteBuf

      PooledNonRetainedSlicedByteBuf(ByteBuf referenceCountDelegate, AbstractByteBuf buffer, int index, int length)
  • Method Details

    • isAccessible0

      boolean isAccessible0()
      Overrides:
      isAccessible0 in class AbstractDerivedByteBuf
    • refCnt0

      int refCnt0()
      Overrides:
      refCnt0 in class AbstractDerivedByteBuf
    • retain0

      ByteBuf retain0()
      Overrides:
      retain0 in class AbstractDerivedByteBuf
    • retain0

      ByteBuf retain0(int increment)
      Overrides:
      retain0 in class AbstractDerivedByteBuf
    • touch0

      ByteBuf touch0()
      Overrides:
      touch0 in class AbstractDerivedByteBuf
    • touch0

      ByteBuf touch0(Object hint)
      Overrides:
      touch0 in class AbstractDerivedByteBuf
    • release0

      boolean release0()
      Overrides:
      release0 in class AbstractDerivedByteBuf
    • release0

      boolean release0(int decrement)
      Overrides:
      release0 in class AbstractDerivedByteBuf
    • duplicate

      public ByteBuf duplicate()
      Description copied from class: ByteBuf
      Returns a buffer which shares the whole region of this buffer. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks. This method does not modify readerIndex or writerIndex of this buffer.

      The reader and writer marks will not be duplicated. Also be aware that this method will NOT call ByteBuf.retain() and so the reference count will NOT be increased.

      Overrides:
      duplicate in class AbstractUnpooledSlicedByteBuf
      Returns:
      A buffer whose readable content is equivalent to the buffer returned by ByteBuf.slice(). However this buffer will share the capacity of the underlying buffer, and therefore allows access to all of the underlying content if necessary.
    • retainedDuplicate

      public ByteBuf retainedDuplicate()
      Description copied from class: ByteBuf
      Returns a retained buffer which shares the whole region of this buffer. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks. This method is identical to buf.slice(0, buf.capacity()). This method does not modify readerIndex or writerIndex of this buffer.

      Note that this method returns a retained buffer unlike ByteBuf.slice(int, int). This method behaves similarly to duplicate().retain() except that this method may return a buffer implementation that produces less garbage.

      Overrides:
      retainedDuplicate in class AbstractUnpooledSlicedByteBuf
    • slice

      public ByteBuf slice(int index, int length)
      Description copied from class: ByteBuf
      Returns a slice of this buffer's sub-region. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks. This method does not modify readerIndex or writerIndex of this buffer.

      Also be aware that this method will NOT call ByteBuf.retain() and so the reference count will NOT be increased.

      Overrides:
      slice in class AbstractUnpooledSlicedByteBuf
    • retainedSlice

      public ByteBuf retainedSlice()
      Description copied from class: ByteBuf
      Returns a retained slice of this buffer's readable bytes. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks. This method is identical to buf.slice(buf.readerIndex(), buf.readableBytes()). This method does not modify readerIndex or writerIndex of this buffer.

      Note that this method returns a retained buffer unlike ByteBuf.slice(). This method behaves similarly to slice().retain() except that this method may return a buffer implementation that produces less garbage.

      Overrides:
      retainedSlice in class AbstractByteBuf
    • retainedSlice

      public ByteBuf retainedSlice(int index, int length)
      Description copied from class: ByteBuf
      Returns a retained slice of this buffer's sub-region. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks. This method does not modify readerIndex or writerIndex of this buffer.

      Note that this method returns a retained buffer unlike ByteBuf.slice(int, int). This method behaves similarly to slice(...).retain() except that this method may return a buffer implementation that produces less garbage.

      Overrides:
      retainedSlice in class AbstractByteBuf