Class AbstractPooledDerivedByteBuf.PooledNonRetainedDuplicateByteBuf
- java.lang.Object
-
- io.netty.buffer.ByteBuf
-
- io.netty.buffer.AbstractByteBuf
-
- io.netty.buffer.AbstractDerivedByteBuf
-
- io.netty.buffer.DuplicatedByteBuf
-
- io.netty.buffer.UnpooledDuplicatedByteBuf
-
- io.netty.buffer.AbstractPooledDerivedByteBuf.PooledNonRetainedDuplicateByteBuf
-
- All Implemented Interfaces:
ByteBufConvertible
,ReferenceCounted
,java.lang.Comparable<ByteBuf>
- Enclosing class:
- AbstractPooledDerivedByteBuf
private static final class AbstractPooledDerivedByteBuf.PooledNonRetainedDuplicateByteBuf extends UnpooledDuplicatedByteBuf
-
-
Field Summary
Fields Modifier and Type Field Description private ByteBuf
referenceCountDelegate
-
Fields inherited from class io.netty.buffer.AbstractByteBuf
checkAccessible, leakDetector, readerIndex, writerIndex
-
-
Constructor Summary
Constructors Constructor Description PooledNonRetainedDuplicateByteBuf(ByteBuf referenceCountDelegate, AbstractByteBuf buffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBuf
duplicate()
Returns a buffer which shares the whole region of this buffer.(package private) boolean
isAccessible0()
(package private) int
refCnt0()
(package private) boolean
release0()
(package private) boolean
release0(int decrement)
(package private) ByteBuf
retain0()
(package private) ByteBuf
retain0(int increment)
ByteBuf
retainedDuplicate()
Returns a retained buffer which shares the whole region of this buffer.ByteBuf
retainedSlice()
Returns a retained slice of this buffer's readable bytes.ByteBuf
retainedSlice(int index, int length)
Returns a retained slice of this buffer's sub-region.ByteBuf
slice(int index, int length)
Returns a slice of this buffer's sub-region.(package private) ByteBuf
touch0()
(package private) ByteBuf
touch0(java.lang.Object hint)
-
Methods inherited from class io.netty.buffer.UnpooledDuplicatedByteBuf
_getByte, _getInt, _getIntLE, _getLong, _getLongLE, _getShort, _getShortLE, _getUnsignedMedium, _getUnsignedMediumLE, _setByte, _setInt, _setIntLE, _setLong, _setLongLE, _setMedium, _setMediumLE, _setShort, _setShortLE, unwrap
-
Methods inherited from class io.netty.buffer.DuplicatedByteBuf
alloc, array, arrayOffset, capacity, capacity, copy, forEachByte, forEachByteDesc, getByte, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getInt, getIntLE, getLong, getLongLE, getShort, getShortLE, getUnsignedMedium, getUnsignedMediumLE, hasArray, hasMemoryAddress, isDirect, memoryAddress, nioBufferCount, nioBuffers, order, setByte, setBytes, setBytes, setBytes, setBytes, setBytes, setBytes, setInt, setIntLE, setLong, setLongLE, setMedium, setMediumLE, setShort, setShortLE
-
Methods inherited from class io.netty.buffer.AbstractDerivedByteBuf
internalNioBuffer, isAccessible, isContiguous, isReadOnly, nioBuffer, refCnt, release, release, retain, retain, touch, touch
-
Methods inherited from class io.netty.buffer.AbstractByteBuf
adjustMarkers, asReadOnly, bytesBefore, bytesBefore, bytesBefore, checkDstIndex, checkDstIndex, checkIndex, checkIndex, checkIndex0, checkNewCapacity, checkReadableBytes, checkSrcIndex, clear, compareTo, copy, discardMarks, discardReadBytes, discardSomeReadBytes, ensureAccessible, ensureWritable, ensureWritable, ensureWritable0, equals, forEachByte, forEachByteAsc0, forEachByteDesc, forEachByteDesc0, getBoolean, getBytes, getBytes, getBytes, getChar, getCharSequence, getDouble, getFloat, getMedium, getMediumLE, getUnsignedByte, getUnsignedInt, getUnsignedIntLE, getUnsignedShort, getUnsignedShortLE, hashCode, indexOf, isReadable, isReadable, isWritable, isWritable, markReaderIndex, markWriterIndex, maxCapacity, maxCapacity, maxWritableBytes, newSwappedByteBuf, nioBuffer, nioBuffers, order, readableBytes, readBoolean, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readCharSequence, readDouble, readerIndex, readerIndex, readFloat, readInt, readIntLE, readLong, readLongLE, readMedium, readMediumLE, readRetainedSlice, readShort, readShortLE, readSlice, readUnsignedByte, readUnsignedInt, readUnsignedIntLE, readUnsignedMedium, readUnsignedMediumLE, readUnsignedShort, readUnsignedShortLE, resetReaderIndex, resetWriterIndex, setBoolean, setBytes, setBytes, setBytes, setChar, setCharSequence, setDouble, setFloat, setIndex, setIndex0, setZero, skipBytes, slice, toString, toString, toString, trimIndicesToCapacity, writableBytes, writeBoolean, writeByte, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeChar, writeCharSequence, writeDouble, writeFloat, writeInt, writeIntLE, writeLong, writeLongLE, writeMedium, writeMediumLE, writerIndex, writerIndex, writeShort, writeShortLE, writeZero
-
Methods inherited from class io.netty.buffer.ByteBuf
asByteBuf, getDoubleLE, getFloatLE, maxFastWritableBytes, readDoubleLE, readFloatLE, setDoubleLE, setFloatLE, writeDoubleLE, writeFloatLE
-
-
-
-
Field Detail
-
referenceCountDelegate
private final ByteBuf referenceCountDelegate
-
-
Constructor Detail
-
PooledNonRetainedDuplicateByteBuf
PooledNonRetainedDuplicateByteBuf(ByteBuf referenceCountDelegate, AbstractByteBuf buffer)
-
-
Method Detail
-
isAccessible0
boolean isAccessible0()
- Overrides:
isAccessible0
in classAbstractDerivedByteBuf
-
refCnt0
int refCnt0()
- Overrides:
refCnt0
in classAbstractDerivedByteBuf
-
retain0
ByteBuf retain0()
- Overrides:
retain0
in classAbstractDerivedByteBuf
-
retain0
ByteBuf retain0(int increment)
- Overrides:
retain0
in classAbstractDerivedByteBuf
-
touch0
ByteBuf touch0()
- Overrides:
touch0
in classAbstractDerivedByteBuf
-
touch0
ByteBuf touch0(java.lang.Object hint)
- Overrides:
touch0
in classAbstractDerivedByteBuf
-
release0
boolean release0()
- Overrides:
release0
in classAbstractDerivedByteBuf
-
release0
boolean release0(int decrement)
- Overrides:
release0
in classAbstractDerivedByteBuf
-
duplicate
public ByteBuf duplicate()
Description copied from class:ByteBuf
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 modifyreaderIndex
orwriterIndex
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.- Overrides:
duplicate
in classAbstractByteBuf
- Returns:
- A buffer whose readable content is equivalent to the buffer returned by
ByteBuf.slice()
. However this buffer will share the capacity of the underlying buffer, and therefore allows access to all of the underlying content if necessary.
-
retainedDuplicate
public ByteBuf retainedDuplicate()
Description copied from class:ByteBuf
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 tobuf.slice(0, buf.capacity())
. This method does not modifyreaderIndex
orwriterIndex
of this buffer.Note that this method returns a retained buffer unlike
ByteBuf.slice(int, int)
. This method behaves similarly toduplicate().retain()
except that this method may return a buffer implementation that produces less garbage.- Overrides:
retainedDuplicate
in classAbstractByteBuf
-
slice
public ByteBuf slice(int index, int length)
Description copied from class:ByteBuf
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 modifyreaderIndex
orwriterIndex
of this buffer.Also be aware that this method will NOT call
ByteBuf.retain()
and so the reference count will NOT be increased.- Overrides:
slice
in classDuplicatedByteBuf
-
retainedSlice
public ByteBuf retainedSlice()
Description copied from class:ByteBuf
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 tobuf.slice(buf.readerIndex(), buf.readableBytes())
. This method does not modifyreaderIndex
orwriterIndex
of this buffer.Note that this method returns a retained buffer unlike
ByteBuf.slice()
. This method behaves similarly toslice().retain()
except that this method may return a buffer implementation that produces less garbage.- Overrides:
retainedSlice
in classAbstractByteBuf
-
retainedSlice
public ByteBuf retainedSlice(int index, int length)
Description copied from class:ByteBuf
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 modifyreaderIndex
orwriterIndex
of this buffer.Note that this method returns a retained buffer unlike
ByteBuf.slice(int, int)
. This method behaves similarly toslice(...).retain()
except that this method may return a buffer implementation that produces less garbage.- Overrides:
retainedSlice
in classAbstractByteBuf
-
-