Module io.netty5.buffer
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:
io.netty.buffer.ByteBufConvertible
,io.netty.util.ReferenceCounted
,BufferIntegratable
,Buffer
,BufferAccessor
,Resource<Buffer>
,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 AllocatorControl
control
-
Constructor Summary
Constructors Modifier Constructor Description protected
AdaptableBuffer(Drop<T> drop, AllocatorControl control)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.buffer.ByteBuf
asByteBuf()
boolean
equals(Object o)
int
hashCode()
io.netty.buffer.ByteBuf
initialise(ByteBufAllocatorAdaptor alloc, int maxCapacity)
int
refCnt()
boolean
release()
boolean
release(int decrement)
io.netty5.util.ReferenceCounted
retain()
io.netty5.util.ReferenceCounted
retain(int increment)
io.netty5.util.ReferenceCounted
touch()
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, bytesBefore, capacity, compact, copy, copy, copy, copy, copyInto, copyInto, copyInto, countComponents, countReadableComponents, countWritableComponents, ensureWritable, ensureWritable, fill, forEachReadable, forEachReadable, forEachWritable, forEachWritable, implicitCapacityLimit, isDirect, makeReadOnly, openCursor, openCursor, openReverseCursor, openReverseCursor, readableBytes, readBytes, readBytes, readCharSequence, readerOffset, readerOffset, readOnly, readSplit, resetOffsets, skipReadable, skipWritable, split, split, toString, transferFrom, transferFrom, transferTo, writableBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeCharSequence, writerOffset, writerOffset, writeSplit
-
Methods inherited from interface io.netty5.buffer.api.BufferAccessor
getBoolean, getByte, getChar, getDouble, getFloat, getInt, getLong, getMedium, getShort, getUnsignedByte, getUnsignedInt, getUnsignedMedium, getUnsignedShort, readBoolean, readByte, readChar, readDouble, readFloat, readInt, readLong, readMedium, readShort, readUnsignedByte, readUnsignedInt, readUnsignedMedium, readUnsignedShort, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setMedium, setShort, setUnsignedByte, setUnsignedInt, setUnsignedMedium, setUnsignedShort, writeBoolean, 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 io.netty.buffer.ByteBuf initialise(ByteBufAllocatorAdaptor alloc, int maxCapacity)
-
asByteBuf
public io.netty.buffer.ByteBuf asByteBuf()
- Specified by:
asByteBuf
in interfaceio.netty.buffer.ByteBufConvertible
-
refCnt
public int refCnt()
- Specified by:
refCnt
in interfaceio.netty.util.ReferenceCounted
- Specified by:
refCnt
in interfaceio.netty5.util.ReferenceCounted
-
retain
public io.netty5.util.ReferenceCounted retain()
- Specified by:
retain
in interfaceio.netty.util.ReferenceCounted
- Specified by:
retain
in interfaceio.netty5.util.ReferenceCounted
-
retain
public io.netty5.util.ReferenceCounted retain(int increment)
- Specified by:
retain
in interfaceio.netty.util.ReferenceCounted
- Specified by:
retain
in interfaceio.netty5.util.ReferenceCounted
-
touch
public io.netty5.util.ReferenceCounted touch()
- Specified by:
touch
in interfaceio.netty.util.ReferenceCounted
- Specified by:
touch
in interfaceio.netty5.util.ReferenceCounted
-
touch
public AdaptableBuffer<T> touch(Object hint)
Description copied from interface:Resource
Record 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:
touch
in interfaceio.netty.util.ReferenceCounted
- Specified by:
touch
in interfaceio.netty5.util.ReferenceCounted
- Specified by:
touch
in interfaceResource<T extends ResourceSupport<Buffer,T>>
- Overrides:
touch
in 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:
release
in interfaceio.netty.util.ReferenceCounted
- Specified by:
release
in interfaceio.netty5.util.ReferenceCounted
-
release
public boolean release(int decrement)
- Specified by:
release
in interfaceio.netty.util.ReferenceCounted
- Specified by:
release
in interfaceio.netty5.util.ReferenceCounted
-
-