Top Fields Constructors Methods
io.netty.buffer

pack-priv Class SimpleLeakAwareCompositeByteBuf

extends WrappedCompositeByteBuf
Class Inheritance
Known Direct Subclasses
io.netty.buffer.AdvancedLeakAwareCompositeByteBuf
Imports
io.netty.util.ResourceLeakTracker, io.netty.util.internal.ObjectUtil, java.nio.ByteOrder

Field Summary

Modifier and TypeField and Description
pack-priv final ResourceLeakTracker<ByteBuf>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public ByteBuf
asReadOnly()

Overrides io.netty.buffer.WrappedCompositeByteBuf.asReadOnly.

Returns a read-only version of this buffer.
private void
closeLeak(ByteBuf trackedByteBuf)

public ByteBuf
duplicate()

Overrides io.netty.buffer.WrappedCompositeByteBuf.duplicate.

Returns a buffer which shares the whole region of this buffer.
private SimpleLeakAwareByteBuf
protected SimpleLeakAwareByteBuf
newLeakAwareByteBuf(ByteBuf wrapped, ByteBuf trackedByteBuf, ResourceLeakTracker<ByteBuf> leakTracker)

public ByteBuf
order(ByteOrder endianness)

Overrides io.netty.buffer.WrappedCompositeByteBuf.order.

Returns a buffer with the specified endianness which shares the whole region, indexes, and marks of this buffer.
public ByteBuf
readRetainedSlice(int
the size of the new slice
length
)

Overrides io.netty.buffer.WrappedCompositeByteBuf.readRetainedSlice.

Returns a new retained slice of this buffer's sub-region starting at the current readerIndex and increases the readerIndex by the size of the new slice (= length).
public ByteBuf
readSlice(int
the size of the new slice
length
)

Overrides io.netty.buffer.WrappedCompositeByteBuf.readSlice.

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).
public boolean
release()

Overrides io.netty.buffer.WrappedCompositeByteBuf.release.

Implements io.netty.util.ReferenceCounted.release.

Decreases the reference count by 1 and deallocates this object if the reference count reaches at 0.
public boolean
release(int decrement)

Overrides io.netty.buffer.WrappedCompositeByteBuf.release.

Implements io.netty.util.ReferenceCounted.release.

Decreases the reference count by the specified decrement and deallocates this object if the reference count reaches at 0.
public ByteBuf
retainedDuplicate()

Overrides io.netty.buffer.WrappedCompositeByteBuf.retainedDuplicate.

Returns a retained buffer which shares the whole region of this buffer.
public ByteBuf
retainedSlice()

Overrides io.netty.buffer.WrappedCompositeByteBuf.retainedSlice.

Returns a retained slice of this buffer's readable bytes.
public ByteBuf
retainedSlice(int index, int length)

Overrides io.netty.buffer.WrappedCompositeByteBuf.retainedSlice.

Returns a retained slice of this buffer's sub-region.
public ByteBuf
slice()

Overrides io.netty.buffer.WrappedCompositeByteBuf.slice.

Returns a slice of this buffer's readable bytes.
public ByteBuf
slice(int index, int length)

Overrides io.netty.buffer.WrappedCompositeByteBuf.slice.

Returns a slice of this buffer's sub-region.
Inherited from io.netty.buffer.WrappedCompositeByteBuf:
_getByte_getInt_getIntLE_getLong_getLongLE_getShort_getShortLE_getUnsignedMedium_getUnsignedMediumLE_setByte_setInt_setIntLE_setLong_setLongLE_setMedium_setMediumLE_setShort_setShortLEaddComponentaddComponentaddComponentaddComponentaddComponentsaddComponentsaddComponentsaddComponentsaddComponentsaddComponentsaddFlattenedComponentsallocarrayarrayOffsetbytesBeforebytesBeforebytesBeforecapacitycapacityclearcompareTocomponentcomponentAtOffsetconsolidateconsolidatecopycopydeallocatedecomposediscardReadBytesdiscardReadComponentsdiscardSomeReadBytesensureWritableensureWritableequalsforEachByteforEachByteforEachByteAsc0forEachByteDescforEachByteDescforEachByteDesc0getBooleangetBytegetBytesgetBytesgetBytesgetBytesgetBytesgetBytesgetBytesgetBytesgetBytesgetChargetCharSequencegetDoublegetFloatgetIntgetIntLEgetLonggetLongLEgetMediumgetMediumLEgetShortgetShortLEgetUnsignedBytegetUnsignedIntgetUnsignedIntLEgetUnsignedMediumgetUnsignedMediumLEgetUnsignedShortgetUnsignedShortLEhasArrayhashCodehasMemoryAddressindexOfinternalComponentinternalComponentAtOffsetinternalNioBufferisAccessibleisDirectisReadableisReadableisReadOnlyisWritableisWritableiteratormarkReaderIndexmarkWriterIndexmaxCapacitymaxFastWritableBytesmaxNumComponentsmaxWritableBytesmemoryAddressnewSwappedByteBufnioBuffernioBuffernioBufferCountnioBuffersnioBuffersnumComponentsorderreadableBytesreadBooleanreadBytereadBytesreadBytesreadBytesreadBytesreadBytesreadBytesreadBytesreadBytesreadBytesreadBytesreadCharreadCharSequencereadDoublereaderIndexreaderIndexreadFloatreadIntreadIntLEreadLongreadLongLEreadMediumreadMediumLEreadShortreadShortLEreadUnsignedBytereadUnsignedIntreadUnsignedIntLEreadUnsignedMediumreadUnsignedMediumLEreadUnsignedShortreadUnsignedShortLErefCntremoveComponentremoveComponentsresetReaderIndexresetWriterIndexretainretainsetBooleansetBytesetBytessetBytessetBytessetBytessetBytessetBytessetBytessetBytessetBytessetCharsetCharSequencesetDoublesetFloatsetIndexsetIntsetIntLEsetLongsetLongLEsetMediumsetMediumLEsetShortsetShortLEsetZeroskipBytestoByteIndextoComponentIndextoStringtoStringtoStringtouchtouchunwrapwritableByteswriteBooleanwriteBytewriteByteswriteByteswriteByteswriteByteswriteByteswriteByteswriteByteswriteByteswriteByteswriteCharwriteCharSequencewriteDoublewriteFloatwriteIntwriteIntLEwriteLongwriteLongLEwriteMediumwriteMediumLEwriterIndexwriterIndexwriteShortwriteShortLEwriteZero

Field Detail

leakback to summary
pack-priv final ResourceLeakTracker<ByteBuf> leak

Constructor Detail

SimpleLeakAwareCompositeByteBufback to summary
pack-priv SimpleLeakAwareCompositeByteBuf(CompositeByteBuf wrapped, ResourceLeakTracker<ByteBuf> leak)

Method Detail

asReadOnlyback to summary
public ByteBuf asReadOnly()

Overrides io.netty.buffer.WrappedCompositeByteBuf.asReadOnly.

Doc from io.netty.buffer.ByteBuf.asReadOnly.

Returns a read-only version of this buffer.

Annotations
@Override
closeLeakback to summary
private void closeLeak(ByteBuf trackedByteBuf)
duplicateback to summary
public ByteBuf duplicate()

Overrides io.netty.buffer.WrappedCompositeByteBuf.duplicate.

Doc from io.netty.buffer.ByteBuf.duplicate.

Returns a buffer which shares the whole region of this buffer. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks. 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 retain() and so the reference count will NOT be increased.

Returns:ByteBuf

A buffer whose readable content is equivalent to the buffer returned by slice(). However this buffer will share the capacity of the underlying buffer, and therefore allows access to all of the underlying content if necessary.

Annotations
@Override
newLeakAwareByteBufback to summary
private SimpleLeakAwareByteBuf newLeakAwareByteBuf(ByteBuf wrapped)
newLeakAwareByteBufback to summary
protected SimpleLeakAwareByteBuf newLeakAwareByteBuf(ByteBuf wrapped, ByteBuf trackedByteBuf, ResourceLeakTracker<ByteBuf> leakTracker)
orderback to summary
public ByteBuf order(ByteOrder endianness)

Overrides io.netty.buffer.WrappedCompositeByteBuf.order.

Doc from io.netty.buffer.ByteBuf.order.

Returns a buffer with the specified 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.

Annotations
@Override
readRetainedSliceback to summary
public ByteBuf readRetainedSlice(int length)

Overrides io.netty.buffer.WrappedCompositeByteBuf.readRetainedSlice.

Doc from io.netty.buffer.ByteBuf.readRetainedSlice.

Returns a new retained slice of this buffer's sub-region starting at the current readerIndex and increases the readerIndex by the size of the new slice (= length).

Note that this method returns a retained buffer unlike readSlice(int). This method behaves similarly to readSlice(...).retain() except that this method may return a buffer implementation that produces less garbage.

Parameters
length:int

the size of the new slice

Returns:ByteBuf

the newly created slice

Annotations
@Override
readSliceback to summary
public ByteBuf readSlice(int length)

Overrides io.netty.buffer.WrappedCompositeByteBuf.readSlice.

Doc from io.netty.buffer.ByteBuf.readSlice.

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).

Also be aware that this method will NOT call retain() and so the reference count will NOT be increased.

Parameters
length:int

the size of the new slice

Returns:ByteBuf

the newly created slice

Annotations
@Override
releaseback to summary
public boolean release()

Overrides io.netty.buffer.WrappedCompositeByteBuf.release.

Implements io.netty.util.ReferenceCounted.release.

Doc from io.netty.util.ReferenceCounted.release.

Decreases the reference count by 1 and deallocates this object if the reference count reaches at 0.

Returns:boolean

true if and only if the reference count became 0 and this object has been deallocated

Annotations
@Override
releaseback to summary
public boolean release(int decrement)

Overrides io.netty.buffer.WrappedCompositeByteBuf.release.

Implements io.netty.util.ReferenceCounted.release.

Doc from io.netty.util.ReferenceCounted.release.

Decreases the reference count by the specified decrement and deallocates this object if the reference count reaches at 0.

Returns:boolean

true if and only if the reference count became 0 and this object has been deallocated

Annotations
@Override
retainedDuplicateback to summary
public ByteBuf retainedDuplicate()

Overrides io.netty.buffer.WrappedCompositeByteBuf.retainedDuplicate.

Doc from io.netty.buffer.ByteBuf.retainedDuplicate.

Returns a retained buffer which shares the whole region of this buffer. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks. This method is identical to buf.slice(0, buf.capacity()). This method does not modify readerIndex or writerIndex of this buffer.

Note that this method returns a retained buffer unlike slice(int, int). This method behaves similarly to duplicate().retain() except that this method may return a buffer implementation that produces less garbage.

Annotations
@Override
retainedSliceback to summary
public ByteBuf retainedSlice()

Overrides io.netty.buffer.WrappedCompositeByteBuf.retainedSlice.

Doc from io.netty.buffer.ByteBuf.retainedSlice.

Returns a retained slice of this buffer's readable bytes. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks. This method is identical to buf.slice(buf.readerIndex(), buf.readableBytes()). This method does not modify readerIndex or writerIndex of this buffer.

Note that this method returns a retained buffer unlike slice(). This method behaves similarly to slice().retain() except that this method may return a buffer implementation that produces less garbage.

Annotations
@Override
retainedSliceback to summary
public ByteBuf retainedSlice(int index, int length)

Overrides io.netty.buffer.WrappedCompositeByteBuf.retainedSlice.

Doc from io.netty.buffer.ByteBuf.retainedSlice.

Returns a retained slice of this buffer's sub-region. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks. This method does not modify readerIndex or writerIndex of this buffer.

Note that this method returns a retained buffer unlike slice(int, int). This method behaves similarly to slice(...).retain() except that this method may return a buffer implementation that produces less garbage.

Annotations
@Override
sliceback to summary
public ByteBuf slice()

Overrides io.netty.buffer.WrappedCompositeByteBuf.slice.

Doc from io.netty.buffer.ByteBuf.slice.

Returns a slice of this buffer's readable bytes. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks. This method is identical to 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 retain() and so the reference count will NOT be increased.

Annotations
@Override
sliceback to summary
public ByteBuf slice(int index, int length)

Overrides io.netty.buffer.WrappedCompositeByteBuf.slice.

Doc from io.netty.buffer.ByteBuf.slice.

Returns a slice of this buffer's sub-region. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks. This method does not modify readerIndex or writerIndex of this buffer.

Also be aware that this method will NOT call retain() and so the reference count will NOT be increased.

Annotations
@Override