Package io.netty5.buffer
Class AbstractReferenceCountedByteBuf
- java.lang.Object
-
- io.netty5.buffer.ByteBuf
-
- io.netty5.buffer.AbstractByteBuf
-
- io.netty5.buffer.AbstractReferenceCountedByteBuf
-
- All Implemented Interfaces:
ByteBufConvertible,io.netty5.util.ReferenceCounted,Comparable<ByteBuf>
- Direct Known Subclasses:
CompositeByteBuf,UnpooledDirectByteBuf,UnpooledHeapByteBuf
public abstract class AbstractReferenceCountedByteBuf extends AbstractByteBuf
Abstract base class forByteBufimplementations that count references.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractReferenceCountedByteBuf(int maxCapacity)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voiddeallocate()Called oncerefCnt()is equals 0.intrefCnt()booleanrelease()booleanrelease(int decrement)protected voidresetRefCnt()An unsafe operation intended for use by a subclass that resets the reference count of the buffer to 1ByteBufretain()ByteBufretain(int increment)protected voidsetRefCnt(int refCnt)An unsafe operation intended for use by a subclass that sets the reference count of the buffer directlyByteBuftouch()ByteBuftouch(Object hint)-
Methods inherited from class io.netty5.buffer.AbstractByteBuf
_getByte, _getInt, _getIntLE, _getLong, _getLongLE, _getShort, _getShortLE, _getUnsignedMedium, _getUnsignedMediumLE, _setByte, _setInt, _setIntLE, _setLong, _setLongLE, _setMedium, _setMediumLE, _setShort, _setShortLE, asReadOnly, bytesBefore, bytesBefore, bytesBefore, checkDstIndex, checkDstIndex, checkIndex, checkIndex, checkNewCapacity, checkReadableBytes, checkSrcIndex, clear, compareTo, copy, discardReadBytes, discardSomeReadBytes, duplicate, ensureAccessible, ensureWritable, ensureWritable, equals, forEachByte, forEachByte, forEachByteDesc, forEachByteDesc, getBoolean, getByte, getBytes, getBytes, getBytes, getChar, getCharSequence, getDouble, getFloat, getInt, getIntLE, getLong, getLongLE, getMedium, getMediumLE, getShort, getShortLE, getUnsignedByte, getUnsignedInt, getUnsignedIntLE, getUnsignedMedium, getUnsignedMediumLE, getUnsignedShort, getUnsignedShortLE, hashCode, indexOf, isReadable, isReadable, isReadOnly, isWritable, isWritable, maxCapacity, maxCapacity, maxWritableBytes, newSwappedByteBuf, nioBuffer, nioBuffers, order, readableBytes, readBoolean, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readCharSequence, readDouble, readerIndex, readerIndex, readFloat, readInt, readIntLE, readLong, readLongLE, readMedium, readMediumLE, readRetainedSlice, readShort, readShortLE, readSlice, readUnsignedByte, readUnsignedInt, readUnsignedIntLE, readUnsignedMedium, readUnsignedMediumLE, readUnsignedShort, readUnsignedShortLE, retainedDuplicate, retainedSlice, retainedSlice, setBoolean, setByte, setBytes, setBytes, setBytes, setChar, setCharSequence, setDouble, setFloat, setIndex, setInt, setIntLE, setLong, setLongLE, setMedium, setMediumLE, setShort, setShortLE, setZero, skipBytes, slice, slice, toString, toString, toString, trimIndicesToCapacity, writableBytes, writeBoolean, writeByte, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeChar, writeCharSequence, writeDouble, writeFloat, writeInt, writeIntLE, writeLong, writeLongLE, writeMedium, writeMediumLE, writerIndex, writerIndex, writeShort, writeShortLE, writeZero
-
Methods inherited from class io.netty5.buffer.ByteBuf
alloc, array, arrayOffset, asByteBuf, capacity, capacity, copy, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getDoubleLE, getFloatLE, hasArray, hasMemoryAddress, internalNioBuffer, isContiguous, isDirect, maxFastWritableBytes, memoryAddress, nioBuffer, nioBufferCount, nioBuffers, order, readDoubleLE, readFloatLE, setBytes, setBytes, setBytes, setBytes, setBytes, setBytes, setDoubleLE, setFloatLE, unwrap, writeDoubleLE, writeFloatLE
-
-
-
-
Method Detail
-
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()
-
retain
public ByteBuf retain(int increment)
-
touch
public ByteBuf touch()
-
release
public boolean release()
-
release
public boolean release(int decrement)
-
deallocate
protected abstract void deallocate()
Called oncerefCnt()is equals 0.
-
-