Package io.netty5.buffer.api.internal
Class AdaptableBuffer<T extends ResourceSupport<Buffer,T>>
- java.lang.Object
-
- io.netty5.buffer.api.internal.ResourceSupport<Buffer,T>
-
- io.netty5.buffer.api.internal.AdaptableBuffer<T>
-
- All Implemented Interfaces:
BufferIntegratable,Buffer,BufferAccessor,Resource<Buffer>,ByteBufConvertible,io.netty5.util.ReferenceCounted,AutoCloseable
public abstract class AdaptableBuffer<T extends ResourceSupport<Buffer,T>> extends ResourceSupport<Buffer,T> implements BufferIntegratable, Buffer
-
-
Field Summary
Fields Modifier and Type Field Description protected AllocatorControlcontrol
-
Constructor Summary
Constructors Modifier Constructor Description protectedAdaptableBuffer(Drop<T> drop, AllocatorControl control)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBufasByteBuf()Turn this object into aByteBuf.booleanequals(Object o)inthashCode()ByteBufinitialise(ByteBufAllocatorAdaptor alloc, int maxCapacity)intrefCnt()booleanrelease()booleanrelease(int decrement)io.netty5.util.ReferenceCountedretain()io.netty5.util.ReferenceCountedretain(int increment)io.netty5.util.ReferenceCountedtouch()AdaptableBuffer<T>touch(Object hint)Record the current access location for debugging purposes.-
Methods inherited from class io.netty5.buffer.api.internal.ResourceSupport
acquire, attachTrace, close, countBorrows, createResourceClosedException, isAccessible, isOwned, makeInaccessible, notSendableException, prepareSend, send, unsafeGetDrop, unsafeSetDrop
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty5.buffer.api.Buffer
bytesBefore, capacity, compact, copy, copy, copyInto, copyInto, copyInto, countComponents, countReadableComponents, countWritableComponents, ensureWritable, ensureWritable, fill, forEachReadable, forEachWritable, isDirect, makeReadOnly, openCursor, openCursor, openReverseCursor, openReverseCursor, readableBytes, readBytes, readCharSequence, readerOffset, readerOffset, readOnly, readSplit, resetOffsets, skipReadable, skipWritable, split, split, toString, transferFrom, transferTo, writableBytes, writeBytes, writeBytes, writeBytes, writeCharSequence, writerOffset, writerOffset, writeSplit
-
Methods inherited from interface io.netty5.buffer.api.BufferAccessor
getByte, getChar, getDouble, getFloat, getInt, getLong, getMedium, getShort, getUnsignedByte, getUnsignedInt, getUnsignedMedium, getUnsignedShort, readByte, readChar, readDouble, readFloat, readInt, readLong, readMedium, readShort, readUnsignedByte, readUnsignedInt, readUnsignedMedium, readUnsignedShort, setByte, setChar, setDouble, setFloat, setInt, setLong, setMedium, setShort, setUnsignedByte, setUnsignedInt, setUnsignedMedium, setUnsignedShort, writeByte, writeChar, writeDouble, writeFloat, writeInt, writeLong, writeMedium, writeShort, writeUnsignedByte, writeUnsignedInt, writeUnsignedMedium, writeUnsignedShort
-
Methods inherited from interface io.netty5.buffer.api.Resource
close, isAccessible, send
-
-
-
-
Field Detail
-
control
protected final AllocatorControl control
-
-
Constructor Detail
-
AdaptableBuffer
protected AdaptableBuffer(Drop<T> drop, AllocatorControl control)
-
-
Method Detail
-
initialise
public ByteBuf initialise(ByteBufAllocatorAdaptor alloc, int maxCapacity)
-
asByteBuf
public ByteBuf asByteBuf()
Description copied from interface:ByteBufConvertibleTurn this object into aByteBuf. This does not increment the reference count of theByteBufinstance. The conversion or exposure of theByteBufmust be idempotent, so that this method can be called either once, or multiple times, without causing any change in program behaviour.- Specified by:
asByteBufin interfaceByteBufConvertible- Returns:
- A
ByteBufinstance from this object.
-
refCnt
public int refCnt()
- Specified by:
refCntin interfaceio.netty5.util.ReferenceCounted
-
retain
public io.netty5.util.ReferenceCounted retain()
- Specified by:
retainin interfaceio.netty5.util.ReferenceCounted
-
retain
public io.netty5.util.ReferenceCounted retain(int increment)
- Specified by:
retainin interfaceio.netty5.util.ReferenceCounted
-
touch
public io.netty5.util.ReferenceCounted touch()
- Specified by:
touchin interfaceio.netty5.util.ReferenceCounted
-
touch
public AdaptableBuffer<T> touch(Object hint)
Description copied from interface:ResourceRecord the current access location for debugging purposes. This information may be included if the resource throws a life-cycle related exception, or if it leaks. If this resource has already been closed, then this method has no effect.- Specified by:
touchin interfaceio.netty5.util.ReferenceCounted- Specified by:
touchin interfaceResource<T extends ResourceSupport<Buffer,T>>- Overrides:
touchin classResourceSupport<Buffer,T extends ResourceSupport<Buffer,T>>- Parameters:
hint- An optional hint about this access and its context. May benull.- Returns:
- This resource instance.
-
release
public boolean release()
- Specified by:
releasein interfaceio.netty5.util.ReferenceCounted
-
release
public boolean release(int decrement)
- Specified by:
releasein interfaceio.netty5.util.ReferenceCounted
-
-