Class DefaultByteBufHolder

    • Constructor Detail

      • DefaultByteBufHolder

        public DefaultByteBufHolder​(ByteBuf data)
    • Method Detail

      • refCnt

        public int refCnt()
        Specified by:
        refCnt in interface io.netty5.util.ReferenceCounted
      • retain

        public ByteBufHolder retain​(int increment)
        Specified by:
        retain in interface ByteBufHolder
        Specified by:
        retain in interface io.netty5.util.ReferenceCounted
      • release

        public boolean release()
        Specified by:
        release in interface io.netty5.util.ReferenceCounted
      • release

        public boolean release​(int decrement)
        Specified by:
        release in interface io.netty5.util.ReferenceCounted
      • contentToString

        protected final String contentToString()
        Return ByteBuf.toString() without checking the reference count first. This is useful to implement toString().
      • equals

        public boolean equals​(Object o)
        This implementation of the equals operation is restricted to work only with instances of the same class. The reason for that is that Netty library already has a number of classes that extend DefaultByteBufHolder and override equals method with an additional comparison logic and we need the symmetric property of the equals operation to be preserved.
        Overrides:
        equals in class Object
        Parameters:
        o - the reference object with which to compare.
        Returns:
        true if this object is the same as the obj argument; false otherwise.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object