Class AbstractReferenceCountedByteBuf

java.lang.Object
io.netty.buffer.ByteBuf
io.netty.buffer.AbstractByteBuf
io.netty.buffer.AbstractReferenceCountedByteBuf
All Implemented Interfaces:
ByteBufConvertible, io.netty.util.ReferenceCounted, Comparable<ByteBuf>
Direct Known Subclasses:
CompositeByteBuf, UnpooledDirectByteBuf, UnpooledHeapByteBuf

public abstract class AbstractReferenceCountedByteBuf extends AbstractByteBuf
Abstract base class for ByteBuf implementations that count references.
  • Constructor Details

    • AbstractReferenceCountedByteBuf

      protected AbstractReferenceCountedByteBuf(int maxCapacity)
  • Method Details

    • refCnt

      public int refCnt()
    • setRefCnt

      protected final void setRefCnt(int refCnt)
      An unsafe operation intended for use by a subclass that sets the reference count of the buffer directly
    • resetRefCnt

      protected final void resetRefCnt()
      An unsafe operation intended for use by a subclass that resets the reference count of the buffer to 1
    • retain

      public ByteBuf retain()
      Specified by:
      retain in interface io.netty.util.ReferenceCounted
      Specified by:
      retain in class ByteBuf
    • retain

      public ByteBuf retain(int increment)
      Specified by:
      retain in interface io.netty.util.ReferenceCounted
      Specified by:
      retain in class ByteBuf
    • touch

      public ByteBuf touch()
      Specified by:
      touch in interface io.netty.util.ReferenceCounted
      Specified by:
      touch in class ByteBuf
    • touch

      public ByteBuf touch(Object hint)
      Specified by:
      touch in interface io.netty.util.ReferenceCounted
      Specified by:
      touch in class ByteBuf
    • release

      public boolean release()
    • release

      public boolean release(int decrement)
    • deallocate

      protected abstract void deallocate()
      Called once refCnt() is equals 0.