Top Fields Constructors Methods
io.netty.buffer

pack-priv Class SimpleLeakAwareByteBuf

extends WrappedByteBuf
Class Inheritance
Known Direct Subclasses
io.netty.buffer.AdvancedLeakAwareByteBuf
Imports
io.netty.util.ResourceLeakDetector, .ResourceLeakTracker, io.netty.util.internal.ObjectUtil, java.nio.ByteOrder

Field Summary

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

This object's is associated with the ResourceLeakTracker.

Inherited from io.netty.buffer.WrappedByteBuf:
buf

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
public ByteBuf
asReadOnly()

Overrides io.netty.buffer.WrappedByteBuf.asReadOnly.

Returns a read-only version of this buffer.
private void
public ByteBuf
duplicate()

Overrides io.netty.buffer.WrappedByteBuf.duplicate.

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

private SimpleLeakAwareByteBuf
public ByteBuf
order(ByteOrder endianness)

Overrides io.netty.buffer.WrappedByteBuf.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.WrappedByteBuf.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.WrappedByteBuf.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.WrappedByteBuf.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.WrappedByteBuf.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.WrappedByteBuf.retainedDuplicate.

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

Overrides io.netty.buffer.WrappedByteBuf.retainedSlice.

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

Overrides io.netty.buffer.WrappedByteBuf.retainedSlice.

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

Overrides io.netty.buffer.WrappedByteBuf.slice.

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

Overrides io.netty.buffer.WrappedByteBuf.slice.

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

Overrides io.netty.buffer.WrappedByteBuf.touch.

Implements io.netty.util.ReferenceCounted.touch.

Records the current access location of this object for debugging purposes.
public ByteBuf
touch(Object hint)

Overrides io.netty.buffer.WrappedByteBuf.touch.

Implements io.netty.util.ReferenceCounted.touch.

Records the current access location of this object with an additional arbitrary information for debugging purposes.
private ByteBuf
private static ByteBuf
Inherited from io.netty.buffer.WrappedByteBuf:
allocarrayarrayOffsetbytesBeforebytesBeforebytesBeforecapacitycapacityclearcompareTocopycopydiscardReadBytesdiscardSomeReadBytesensureWritableensureWritableequalsforEachByteforEachByteforEachByteDescforEachByteDescgetBooleangetBytegetBytesgetBytesgetBytesgetBytesgetBytesgetBytesgetBytesgetBytesgetBytesgetChargetCharSequencegetDoublegetFloatgetIntgetIntLEgetLonggetLongLEgetMediumgetMediumLEgetShortgetShortLEgetUnsignedBytegetUnsignedIntgetUnsignedIntLEgetUnsignedMediumgetUnsignedMediumLEgetUnsignedShortgetUnsignedShortLEhasArrayhashCodehasMemoryAddressindexOfinternalNioBufferisAccessibleisContiguousisDirectisReadableisReadableisReadOnlyisWritableisWritablemarkReaderIndexmarkWriterIndexmaxCapacitymaxFastWritableBytesmaxWritableBytesmemoryAddressnioBuffernioBuffernioBufferCountnioBuffersnioBuffersorderreadableBytesreadBooleanreadBytereadBytesreadBytesreadBytesreadBytesreadBytesreadBytesreadBytesreadBytesreadBytesreadBytesreadCharreadCharSequencereadDoublereaderIndexreaderIndexreadFloatreadIntreadIntLEreadLongreadLongLEreadMediumreadMediumLEreadShortreadShortLEreadUnsignedBytereadUnsignedIntreadUnsignedIntLEreadUnsignedMediumreadUnsignedMediumLEreadUnsignedShortreadUnsignedShortLErefCntresetReaderIndexresetWriterIndexretainretainsetBooleansetBytesetBytessetBytessetBytessetBytessetBytessetBytessetBytessetBytessetBytessetCharsetCharSequencesetDoublesetFloatsetIndexsetIntsetIntLEsetLongsetLongLEsetMediumsetMediumLEsetShortsetShortLEsetZeroskipBytestoStringtoStringtoStringunwrapwritableByteswriteBooleanwriteBytewriteByteswriteByteswriteByteswriteByteswriteByteswriteByteswriteByteswriteByteswriteByteswriteCharwriteCharSequencewriteDoublewriteFloatwriteIntwriteIntLEwriteLongwriteLongLEwriteMediumwriteMediumLEwriterIndexwriterIndexwriteShortwriteShortLEwriteZero

Field Detail

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

This object's is associated with the ResourceLeakTracker. When ResourceLeakTracker#close(Object) is called this object will be used as the argument. It is also assumed that this object is used when ResourceLeakDetector#track(Object) is called to create leak.

Constructor Detail

SimpleLeakAwareByteBufback to summary
pack-priv SimpleLeakAwareByteBuf(ByteBuf wrapped, ByteBuf trackedByteBuf, ResourceLeakTracker<ByteBuf> leak)
SimpleLeakAwareByteBufback to summary
pack-priv SimpleLeakAwareByteBuf(ByteBuf wrapped, ResourceLeakTracker<ByteBuf> leak)

Method Detail

asReadOnlyback to summary
public ByteBuf asReadOnly()

Overrides io.netty.buffer.WrappedByteBuf.asReadOnly.

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

Returns a read-only version of this buffer.

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

Overrides io.netty.buffer.WrappedByteBuf.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, ResourceLeakTracker<ByteBuf> leakTracker)
newLeakAwareByteBufback to summary
protected SimpleLeakAwareByteBuf newLeakAwareByteBuf(ByteBuf buf, ByteBuf trackedByteBuf, ResourceLeakTracker<ByteBuf> leakTracker)
newSharedLeakAwareByteBufback to summary
private SimpleLeakAwareByteBuf newSharedLeakAwareByteBuf(ByteBuf wrapped)
orderback to summary
public ByteBuf order(ByteOrder endianness)

Overrides io.netty.buffer.WrappedByteBuf.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.WrappedByteBuf.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.WrappedByteBuf.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.WrappedByteBuf.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.WrappedByteBuf.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.WrappedByteBuf.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.WrappedByteBuf.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.WrappedByteBuf.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.WrappedByteBuf.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.WrappedByteBuf.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
touchback to summary
public ByteBuf touch()

Overrides io.netty.buffer.WrappedByteBuf.touch.

Implements io.netty.util.ReferenceCounted.touch.

Doc from io.netty.util.ReferenceCounted.touch.

Records the current access location of this object for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you via ResourceLeakDetector. This method is a shortcut to touch(null).

Annotations
@Override
touchback to summary
public ByteBuf touch(Object hint)

Overrides io.netty.buffer.WrappedByteBuf.touch.

Implements io.netty.util.ReferenceCounted.touch.

Doc from io.netty.util.ReferenceCounted.touch.

Records the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you via ResourceLeakDetector.

Annotations
@Override
unwrappedDerivedback to summary
private ByteBuf unwrappedDerived(ByteBuf derived)
unwrapSwappedback to summary
private static ByteBuf unwrapSwapped(ByteBuf buf)
Annotations
@SuppressWarnings:deprecation