final class SimpleLeakAwareCompositeByteBuf extends WrappedCompositeByteBuf
Modifier and Type | Field and Description |
---|---|
private ResourceLeak |
leak |
leakDetector, readerIndex, writerIndex
Constructor and Description |
---|
SimpleLeakAwareCompositeByteBuf(CompositeByteBuf wrapped,
ResourceLeak leak) |
Modifier and Type | Method and Description |
---|---|
ByteBuf |
duplicate()
Returns a buffer which shares the whole region of this buffer.
|
ByteBuf |
order(java.nio.ByteOrder endianness)
Returns a buffer with the specified
endianness which shares the whole region,
indexes, and marks of this buffer. |
ByteBuf |
readSlice(int length)
Returns a new slice of this buffer's sub-region starting at the current
readerIndex and increases the readerIndex by the size
of the new slice (= length ). |
boolean |
release()
Decreases the reference count by
1 and deallocates this object if the reference count reaches at
0 . |
boolean |
release(int decrement)
Decreases the reference count by the specified
decrement and deallocates this object if the reference
count reaches at 0 . |
ByteBuf |
slice()
Returns a slice of this buffer's readable bytes.
|
ByteBuf |
slice(int index,
int length)
Returns a slice of this buffer's sub-region.
|
_getByte, _getInt, _getLong, _getShort, _getUnsignedMedium, _setByte, _setInt, _setLong, _setMedium, _setShort, addComponent, addComponent, addComponent, addComponent, addComponents, addComponents, addComponents, addComponents, addComponents, addComponents, alloc, array, arrayOffset, bytesBefore, bytesBefore, bytesBefore, capacity, capacity, clear, compareTo, component, componentAtOffset, consolidate, consolidate, copy, copy, deallocate, decompose, discardReadBytes, discardReadComponents, discardSomeReadBytes, ensureWritable, ensureWritable, equals, forEachByte, forEachByte, forEachByteDesc, forEachByteDesc, getBoolean, getByte, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getChar, getDouble, getFloat, getInt, getLong, getMedium, getShort, getUnsignedByte, getUnsignedInt, getUnsignedMedium, getUnsignedShort, hasArray, hashCode, hasMemoryAddress, indexOf, internalComponent, internalComponentAtOffset, internalNioBuffer, isDirect, isReadable, isReadable, isWritable, isWritable, iterator, markReaderIndex, markWriterIndex, maxCapacity, maxNumComponents, maxWritableBytes, memoryAddress, nioBuffer, nioBuffer, nioBufferCount, nioBuffers, nioBuffers, numComponents, order, readableBytes, readBoolean, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readDouble, readerIndex, readerIndex, readFloat, readInt, readLong, readMedium, readShort, readUnsignedByte, readUnsignedInt, readUnsignedMedium, readUnsignedShort, refCnt, removeComponent, removeComponents, resetReaderIndex, resetWriterIndex, retain, retain, setBoolean, setByte, setBytes, setBytes, setBytes, setBytes, setBytes, setBytes, setBytes, setBytes, setChar, setDouble, setFloat, setIndex, setInt, setLong, setMedium, setShort, setZero, skipBytes, toByteIndex, toComponentIndex, toString, toString, toString, unwrap, writableBytes, writeBoolean, writeByte, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeChar, writeDouble, writeFloat, writeInt, writeLong, writeMedium, writerIndex, writerIndex, writeShort, writeZero
setRefCnt
adjustMarkers, checkDstIndex, checkIndex, checkIndex, checkIndex0, checkReadableBytes, checkSrcIndex, discardMarks, ensureAccessible, maxCapacity, newSwappedByteBuf, setIndex0
private final ResourceLeak leak
SimpleLeakAwareCompositeByteBuf(CompositeByteBuf wrapped, ResourceLeak leak)
public boolean release()
ReferenceCounted
1
and deallocates this object if the reference count reaches at
0
.release
in interface ReferenceCounted
release
in class WrappedCompositeByteBuf
true
if and only if the reference count became 0
and this object has been deallocatedpublic boolean release(int decrement)
ReferenceCounted
decrement
and deallocates this object if the reference
count reaches at 0
.release
in interface ReferenceCounted
release
in class WrappedCompositeByteBuf
true
if and only if the reference count became 0
and this object has been deallocatedpublic ByteBuf order(java.nio.ByteOrder endianness)
ByteBuf
endianness
which shares the whole region,
indexes, and marks of this buffer. Modifying the content, the indexes, or the marks of the
returned buffer or this buffer affects each other's content, indexes, and marks. If the
specified endianness
is identical to this buffer's byte order, this method can
return this
. This method does not modify readerIndex
or writerIndex
of this buffer.order
in class WrappedCompositeByteBuf
public ByteBuf slice()
ByteBuf
buf.slice(buf.readerIndex(), buf.readableBytes())
.
This method does not modify readerIndex
or writerIndex
of
this buffer.
Also be aware that this method will NOT call ByteBuf.retain()
and so the
reference count will NOT be increased.
slice
in class WrappedCompositeByteBuf
public ByteBuf slice(int index, int length)
ByteBuf
readerIndex
or writerIndex
of
this buffer.
Also be aware that this method will NOT call ByteBuf.retain()
and so the
reference count will NOT be increased.
slice
in class WrappedCompositeByteBuf
public ByteBuf duplicate()
ByteBuf
buf.slice(0, buf.capacity())
.
This method does not modify readerIndex
or writerIndex
of
this buffer.
The reader and writer marks will not be duplicated. Also be aware that this method will
NOT call ByteBuf.retain()
and so the reference count will NOT be increased.
duplicate
in class WrappedCompositeByteBuf
public ByteBuf readSlice(int length)
ByteBuf
readerIndex
and increases the readerIndex
by the size
of the new slice (= length
).
Also be aware that this method will NOT call ByteBuf.retain()
and so the
reference count will NOT be increased.
readSlice
in class WrappedCompositeByteBuf
length
- the size of the new slice