Top Description Fields Constructors Methods
io.netty.buffer

pack-priv final Class UnreleasableByteBuf

extends WrappedByteBuf
Class Inheritance
Imports
io.netty.util.internal.ObjectUtil, java.nio.ByteOrder

A ByteBuf implementation that wraps another buffer to prevent a user from increasing or decreasing the wrapped buffer's reference count.

Field Summary

Modifier and TypeField and Description
private SwappedByteBuf
swappedBuf

Deprecated as a consequence of SwappedByteBuf being deprecated.
Inherited from io.netty.buffer.WrappedByteBuf:
buf

Constructor Summary

AccessConstructor and Description
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.
public ByteBuf
duplicate()

Overrides io.netty.buffer.WrappedByteBuf.duplicate.

Returns a buffer which shares the whole region of this buffer.
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
retain(int increment)

Overrides io.netty.buffer.WrappedByteBuf.retain.

Implements io.netty.util.ReferenceCounted.retain.

Increases the reference count by the specified increment.
public ByteBuf
retain()

Overrides io.netty.buffer.WrappedByteBuf.retain.

Implements io.netty.util.ReferenceCounted.retain.

Increases the reference count by 1.
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.
Inherited from io.netty.buffer.WrappedByteBuf:
allocarrayarrayOffsetbytesBeforebytesBeforebytesBeforecapacitycapacityclearcompareTocopycopydiscardReadBytesdiscardSomeReadBytesensureWritableensureWritableequalsforEachByteforEachByteforEachByteDescforEachByteDescgetBooleangetBytegetBytesgetBytesgetBytesgetBytesgetBytesgetBytesgetBytesgetBytesgetBytesgetChargetCharSequencegetDoublegetFloatgetIntgetIntLEgetLonggetLongLEgetMediumgetMediumLEgetShortgetShortLEgetUnsignedBytegetUnsignedIntgetUnsignedIntLEgetUnsignedMediumgetUnsignedMediumLEgetUnsignedShortgetUnsignedShortLEhasArrayhashCodehasMemoryAddressindexOfinternalNioBufferisAccessibleisContiguousisDirectisReadableisReadableisReadOnlyisWritableisWritablemarkReaderIndexmarkWriterIndexmaxCapacitymaxFastWritableBytesmaxWritableBytesmemoryAddressnioBuffernioBuffernioBufferCountnioBuffersnioBuffersorderreadableBytesreadBooleanreadBytereadBytesreadBytesreadBytesreadBytesreadBytesreadBytesreadBytesreadBytesreadBytesreadBytesreadCharreadCharSequencereadDoublereaderIndexreaderIndexreadFloatreadIntreadIntLEreadLongreadLongLEreadMediumreadMediumLEreadShortreadShortLEreadUnsignedBytereadUnsignedIntreadUnsignedIntLEreadUnsignedMediumreadUnsignedMediumLEreadUnsignedShortreadUnsignedShortLErefCntresetReaderIndexresetWriterIndexsetBooleansetBytesetBytessetBytessetBytessetBytessetBytessetBytessetBytessetBytessetBytessetCharsetCharSequencesetDoublesetFloatsetIndexsetIntsetIntLEsetLongsetLongLEsetMediumsetMediumLEsetShortsetShortLEsetZeroskipBytestoStringtoStringtoStringunwrapwritableByteswriteBooleanwriteBytewriteByteswriteByteswriteByteswriteByteswriteByteswriteByteswriteByteswriteByteswriteByteswriteCharwriteCharSequencewriteDoublewriteFloatwriteIntwriteIntLEwriteLongwriteLongLEwriteMediumwriteMediumLEwriterIndexwriterIndexwriteShortwriteShortLEwriteZero

Field Detail

swappedBufback to summary
private SwappedByteBuf swappedBuf

Deprecated

as a consequence of SwappedByteBuf being deprecated. See corresponding docs for further information.

Constructor Detail

UnreleasableByteBufback to summary
pack-priv UnreleasableByteBuf(ByteBuf buf)

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
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
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
retainback to summary
public ByteBuf retain(int increment)

Overrides io.netty.buffer.WrappedByteBuf.retain.

Implements io.netty.util.ReferenceCounted.retain.

Doc from io.netty.util.ReferenceCounted.retain.

Increases the reference count by the specified increment.

Annotations
@Override
retainback to summary
public ByteBuf retain()

Overrides io.netty.buffer.WrappedByteBuf.retain.

Implements io.netty.util.ReferenceCounted.retain.

Doc from io.netty.util.ReferenceCounted.retain.

Increases the reference count by 1.

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