Top Description Inners Fields Constructors Methods
io.netty.buffer

public Class CompositeByteBuf

extends AbstractReferenceCountedByteBuf
implements Iterable<ByteBuf>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable
Known Direct Subclasses
io.netty.buffer.WrappedCompositeByteBuf
Imports
io.netty.util.ByteProcessor, .IllegalReferenceCountException, .ReferenceCountUtil, io.netty.util.internal.EmptyArrays, .ObjectUtil, .RecyclableArrayList, java.io.IOException, .InputStream, .OutputStream, java.nio.ByteBuffer, .ByteOrder, java.nio.channels.FileChannel, .GatheringByteChannel, .ScatteringByteChannel, java.util.ArrayList, .Arrays, .Collection, .Collections, .ConcurrentModificationException, .Iterator, .List, .NoSuchElementException

A virtual buffer which shows multiple buffers as a single merged buffer. It is recommended to use ByteBufAllocator#compositeBuffer() or Unpooled#wrappedBuffer(ByteBuf...) instead of calling the constructor explicitly.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static interface
private static class
private class

Field Summary

Modifier and TypeField and Description
private final ByteBufAllocator
pack-priv static final CompositeByteBuf.ByteWrapper<byte[]>
pack-priv static final CompositeByteBuf.ByteWrapper<ByteBuffer>
private int
private CompositeByteBuf.Component[]
private final boolean
private static final Iterator<ByteBuf>
private static final ByteBuffer
private boolean
private CompositeByteBuf.Component
private final int

Constructor Summary

AccessConstructor and Description
private
CompositeByteBuf(ByteBufAllocator alloc, boolean direct, int maxNumComponents, int initSize)

public
CompositeByteBuf(ByteBufAllocator alloc, boolean direct, int maxNumComponents)

public
CompositeByteBuf(ByteBufAllocator alloc, boolean direct, int maxNumComponents, ByteBuf... buffers)

pack-priv
CompositeByteBuf(ByteBufAllocator alloc, boolean direct, int maxNumComponents, ByteBuf[] buffers, int offset)

public
CompositeByteBuf(ByteBufAllocator alloc, boolean direct, int maxNumComponents, Iterable<ByteBuf> buffers)

pack-priv <T>
CompositeByteBuf(ByteBufAllocator alloc, boolean direct, int maxNumComponents, CompositeByteBuf.ByteWrapper<T> wrapper, T[] buffers, int offset)

pack-priv

Method Summary

Modifier and TypeMethod and Description
protected byte
_getByte(int index)

Implements abstract io.netty.buffer.AbstractByteBuf._getByte.

protected int
_getInt(int index)

Implements abstract io.netty.buffer.AbstractByteBuf._getInt.

protected int
protected long
_getLong(int index)

Implements abstract io.netty.buffer.AbstractByteBuf._getLong.

protected long
protected short
protected short
protected int
protected int
protected void
_setByte(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setByte.

protected void
_setInt(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setInt.

protected void
_setIntLE(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setIntLE.

protected void
_setLong(int index, long value)

Implements abstract io.netty.buffer.AbstractByteBuf._setLong.

protected void
_setLongLE(int index, long value)

Implements abstract io.netty.buffer.AbstractByteBuf._setLongLE.

protected void
_setMedium(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setMedium.

protected void
_setMediumLE(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setMediumLE.

protected void
_setShort(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setShort.

protected void
_setShortLE(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setShortLE.

private void
public CompositeByteBuf
addComponent(ByteBuf
the ByteBuf to add. ByteBuf#release() ownership is transferred to this CompositeByteBuf.
buffer
)

Add the given ByteBuf.

public CompositeByteBuf
addComponent(int
the index on which the ByteBuf will be added.
cIndex
,
ByteBuf
the ByteBuf to add. ByteBuf#release() ownership is transferred to this CompositeByteBuf.
buffer
)

Add the given ByteBuf on the specific index.

public CompositeByteBuf
addComponent(boolean increaseWriterIndex, ByteBuf
the ByteBuf to add. ByteBuf#release() ownership is transferred to this CompositeByteBuf.
buffer
)

Add the given ByteBuf and increase the writerIndex if increaseWriterIndex is true.

public CompositeByteBuf
addComponent(boolean increaseWriterIndex, int
the index on which the ByteBuf will be added.
cIndex
,
ByteBuf
the ByteBuf to add. ByteBuf#release() ownership is transferred to this CompositeByteBuf.
buffer
)

Add the given ByteBuf on the specific index and increase the writerIndex if increaseWriterIndex is true.

private int
addComponent0(boolean increaseWriterIndex, int cIndex, ByteBuf buffer)

Precondition is that buffer != null.

public CompositeByteBuf
addComponents(ByteBuf...
the ByteBufs to add. ByteBuf#release() ownership of all ByteBuf#release() ownership of all ByteBuf objects is transferred to this CompositeByteBuf.
buffers
)

Add the given ByteBufs.

public CompositeByteBuf
addComponents(Iterable<ByteBuf>
the ByteBufs to add. ByteBuf#release() ownership of all ByteBuf#release() ownership of all ByteBuf objects is transferred to this CompositeByteBuf.
buffers
)

Add the given ByteBufs.

public CompositeByteBuf
addComponents(boolean increaseWriterIndex, ByteBuf...
the ByteBufs to add. ByteBuf#release() ownership of all ByteBuf#release() ownership of all ByteBuf objects is transferred to this CompositeByteBuf.
buffers
)

Add the given ByteBufs and increase the writerIndex if increaseWriterIndex is true.

public CompositeByteBuf
addComponents(boolean increaseWriterIndex, Iterable<ByteBuf>
the ByteBufs to add. ByteBuf#release() ownership of all ByteBuf#release() ownership of all ByteBuf objects is transferred to this CompositeByteBuf.
buffers
)

Add the given ByteBufs and increase the writerIndex if increaseWriterIndex is true.

public CompositeByteBuf
addComponents(int
the index on which the ByteBuf will be added. ByteBuf#release() ownership of all ByteBuf#release() ownership of all ByteBuf objects is transferred to this CompositeByteBuf.
cIndex
,
ByteBuf...
the ByteBufs to add. ByteBuf#release() ownership of all ByteBuf#release() ownership of all ByteBuf objects is transferred to this CompositeByteBuf.
buffers
)

Add the given ByteBufs on the specific index

Be aware that this method does not increase the writerIndex of the CompositeByteBuf.

public CompositeByteBuf
addComponents(int
the index on which the ByteBuf will be added.
cIndex
,
Iterable<ByteBuf>
the ByteBufs to add. ByteBuf#release() ownership of all ByteBuf#release() ownership of all ByteBuf objects is transferred to this CompositeByteBuf.
buffers
)

Add the given ByteBufs on the specific index Be aware that this method does not increase the writerIndex of the CompositeByteBuf.

private CompositeByteBuf
addComponents(boolean increaseIndex, int cIndex, Iterable<ByteBuf> buffers)

private CompositeByteBuf
addComponents0(boolean increaseWriterIndex, final int cIndex, ByteBuf[] buffers, int arrOffset)

private <T> int
addComponents0(boolean increaseWriterIndex, int cIndex, CompositeByteBuf.ByteWrapper<T> wrapper, T[] buffers, int offset)

public CompositeByteBuf
addFlattenedComponents(boolean increaseWriterIndex, ByteBuf
the ByteBuf to add. ByteBuf#release() ownership is transferred to this CompositeByteBuf.
buffer
)

Add the given ByteBuf and increase the writerIndex if increaseWriterIndex is true.

public ByteBufAllocator
alloc()

Implements abstract io.netty.buffer.ByteBuf.alloc.

Returns the ByteBufAllocator which created this buffer.
private ByteBuf
allocBuffer(int capacity)

public byte[]
array()

Implements abstract io.netty.buffer.ByteBuf.array.

Returns the backing byte array of this buffer.
public int
arrayOffset()

Implements abstract io.netty.buffer.ByteBuf.arrayOffset.

Returns the offset of the first byte within the backing byte array of this buffer.
public int
capacity()

Implements abstract io.netty.buffer.ByteBuf.capacity.

Returns the number of bytes (octets) this buffer can contain.
public CompositeByteBuf
capacity(int newCapacity)

Implements abstract io.netty.buffer.ByteBuf.capacity.

Adjusts the capacity of this buffer.
private void
checkComponentIndex(int cIndex)

private void
checkComponentIndex(int cIndex, int numComponents)

private static void
checkForOverflow(int capacity, int readableBytes)

public CompositeByteBuf
clear()

Overrides io.netty.buffer.AbstractByteBuf.clear.

Sets the readerIndex and writerIndex of this buffer to 0.
private void
public ByteBuf

Returns:

buf the ByteBuf on the specified index
component
(int
the index for which the ByteBuf should be returned
cIndex
)

Return the ByteBuf on the specified index

public ByteBuf

Returns:

the ByteBuf on the specified index
componentAtOffset
(int
the offset for which the ByteBuf should be returned
offset
)

Return the ByteBuf on the specified index

public CompositeByteBuf
consolidate()

Consolidate the composed ByteBufs

public CompositeByteBuf
consolidate(int
the index on which to start to compose
cIndex
,
int
the number of components to compose
numComponents
)

Consolidate the composed ByteBufs

private void
consolidate0(int cIndex, int numComponents)

private void
consolidateIfNeeded()

This should only be called as last operation from a method as this may adjust the underlying array of components and so affect the index etc.

public ByteBuf
copy(int index, int length)

Implements abstract io.netty.buffer.ByteBuf.copy.

Returns a copy of this buffer's sub-region.
private void
copyTo(int index, int length, int componentId, ByteBuf dst)

protected void
public List<ByteBuf>
decompose(int offset, int length)

Same with slice(int, int) except that this method returns a list.

public CompositeByteBuf
discardReadBytes()

Overrides io.netty.buffer.AbstractByteBuf.discardReadBytes.

Discards the bytes between the 0th index and readerIndex.
public CompositeByteBuf
discardReadComponents()

Discard all ByteBufs which are read.

public CompositeByteBuf
discardSomeReadBytes()

Overrides io.netty.buffer.AbstractByteBuf.discardSomeReadBytes.

Similar to ByteBuf#discardReadBytes() except that this method might discard some, all, or none of read bytes depending on its internal implementation to reduce overall memory bandwidth consumption at the cost of potentially additional memory consumption.
private static ByteBuf
public CompositeByteBuf
ensureWritable(int
the expected minimum number of writable bytes
minWritableBytes
)

Overrides io.netty.buffer.AbstractByteBuf.ensureWritable.

Expands the buffer capacity() to make sure the number of writable bytes is equal to or greater than the specified value.
private CompositeByteBuf.Component
findComponent(int offset)

private CompositeByteBuf.Component
findComponent0(int offset)

private CompositeByteBuf.Component
findIt(int offset)

protected int
protected int
public byte
getByte(int index)

Overrides io.netty.buffer.AbstractByteBuf.getByte.

Gets a byte at the specified absolute index in this buffer.
public CompositeByteBuf
getBytes(int index, byte[] dst, int
the first index of the destination
dstIndex
,
int
the number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified destination starting at the specified absolute index.
public CompositeByteBuf
getBytes(int index, ByteBuffer dst)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified destination starting at the specified absolute index until the destination's position reaches its limit.
public CompositeByteBuf
getBytes(int index, ByteBuf dst, int
the first index of the destination
dstIndex
,
int
the number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified destination starting at the specified absolute index.
public int
getBytes(int index, GatheringByteChannel out, int
the maximum number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified channel starting at the specified absolute index.
public int
getBytes(int index, FileChannel out, long
the file position at which the transfer is to begin
position
,
int
the maximum number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data starting at the specified absolute index to the specified channel starting at the given file position.
public CompositeByteBuf
getBytes(int index, OutputStream out, int
the number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified stream starting at the specified absolute index.
public CompositeByteBuf
getBytes(int index, ByteBuf dst)

Overrides io.netty.buffer.AbstractByteBuf.getBytes.

Transfers this buffer's data to the specified destination starting at the specified absolute index until the destination becomes non-writable.
public CompositeByteBuf
getBytes(int index, ByteBuf dst, int
the number of bytes to transfer
length
)

Overrides io.netty.buffer.AbstractByteBuf.getBytes.

Transfers this buffer's data to the specified destination starting at the specified absolute index.
public CompositeByteBuf
getBytes(int index, byte[] dst)

Overrides io.netty.buffer.AbstractByteBuf.getBytes.

Transfers this buffer's data to the specified destination starting at the specified absolute index.
public boolean
hasArray()

Implements abstract io.netty.buffer.ByteBuf.hasArray.

Returns true if and only if this buffer has a backing byte array.
public boolean
hasMemoryAddress()

Implements abstract io.netty.buffer.ByteBuf.hasMemoryAddress.

Returns true if and only if this buffer has a reference to the low-level memory address that points to the backing data.
public ByteBuf
internalComponent(int
the index for which the ByteBuf should be returned
cIndex
)

Return the internal ByteBuf on the specified index.

public ByteBuf
internalComponentAtOffset(int
the offset for which the ByteBuf should be returned
offset
)

Return the internal ByteBuf on the specified offset.

public ByteBuffer
internalNioBuffer(int index, int length)

Implements abstract io.netty.buffer.ByteBuf.internalNioBuffer.

Internal use only: Exposes the internal NIO buffer.
pack-priv boolean
isAccessible()

Overrides io.netty.buffer.AbstractReferenceCountedByteBuf.isAccessible.

Used internally by AbstractByteBuf#ensureAccessible() to try to guard against using the buffer after it was released (best-effort).
public boolean
isDirect()

Implements abstract io.netty.buffer.ByteBuf.isDirect.

Returns true if and only if this buffer is backed by an NIO direct buffer.
public Iterator<ByteBuf>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.
public CompositeByteBuf
markReaderIndex()

Overrides io.netty.buffer.AbstractByteBuf.markReaderIndex.

Marks the current readerIndex in this buffer.
public CompositeByteBuf
markWriterIndex()

Overrides io.netty.buffer.AbstractByteBuf.markWriterIndex.

Marks the current writerIndex in this buffer.
public int
maxNumComponents()

Return the max number of ByteBuf's that are composed in this instance

public long
memoryAddress()

Implements abstract io.netty.buffer.ByteBuf.memoryAddress.

Returns the low-level memory address that point to the first byte of ths backing data.
private static CompositeByteBuf.Component[]
newCompArray(int initComponents, int maxNumComponents)

private CompositeByteBuf.Component
newComponent(final ByteBuf buf, final int offset)

public ByteBuffer
nioBuffer(int index, int length)

Implements abstract io.netty.buffer.ByteBuf.nioBuffer.

Exposes this buffer's sub-region as an NIO ByteBuffer.
public int
nioBufferCount()

Implements abstract io.netty.buffer.ByteBuf.nioBufferCount.

Returns the maximum number of NIO ByteBuffers that consist this buffer.
public ByteBuffer[]
nioBuffers(int index, int length)

Implements abstract io.netty.buffer.ByteBuf.nioBuffers.

Exposes this buffer's bytes as an NIO ByteBuffer's for the specified index and length The returned buffer either share or contains the copied content of this buffer, while changing the position and limit of the returned NIO buffer does not affect the indexes and marks of this buffer.
public ByteBuffer[]
nioBuffers()

Overrides io.netty.buffer.AbstractByteBuf.nioBuffers.

Exposes this buffer's readable bytes as an NIO ByteBuffer's.
public int
numComponents()

Return the current number of ByteBuf's that are composed in this instance

public ByteOrder
order()

Implements abstract io.netty.buffer.ByteBuf.order.

Returns the endianness of this buffer.
public CompositeByteBuf
readBytes(ByteBuf dst)

Overrides io.netty.buffer.AbstractByteBuf.readBytes.

Transfers this buffer's data to the specified destination starting at the current readerIndex until the destination becomes non-writable, and increases the readerIndex by the number of the transferred bytes.
public CompositeByteBuf
readBytes(ByteBuf dst, int length)

Overrides io.netty.buffer.AbstractByteBuf.readBytes.

Transfers this buffer's data to the specified destination starting at the current readerIndex and increases the readerIndex by the number of the transferred bytes (= length).
public CompositeByteBuf
readBytes(ByteBuf dst, int
the first index of the destination
dstIndex
,
int
the number of bytes to transfer
length
)

Overrides io.netty.buffer.AbstractByteBuf.readBytes.

Transfers this buffer's data to the specified destination starting at the current readerIndex and increases the readerIndex by the number of the transferred bytes (= length).
public CompositeByteBuf
readBytes(byte[] dst)

Overrides io.netty.buffer.AbstractByteBuf.readBytes.

Transfers this buffer's data to the specified destination starting at the current readerIndex and increases the readerIndex by the number of the transferred bytes (= dst.length).
public CompositeByteBuf
readBytes(byte[] dst, int
the first index of the destination
dstIndex
,
int
the number of bytes to transfer
length
)

Overrides io.netty.buffer.AbstractByteBuf.readBytes.

Transfers this buffer's data to the specified destination starting at the current readerIndex and increases the readerIndex by the number of the transferred bytes (= length).
public CompositeByteBuf
readBytes(ByteBuffer dst)

Overrides io.netty.buffer.AbstractByteBuf.readBytes.

Transfers this buffer's data to the specified destination starting at the current readerIndex until the destination's position reaches its limit, and increases the readerIndex by the number of the transferred bytes.
public CompositeByteBuf
readBytes(OutputStream out, int
the number of bytes to transfer
length
)

Overrides io.netty.buffer.AbstractByteBuf.readBytes.

Transfers this buffer's data to the specified stream starting at the current readerIndex.
public CompositeByteBuf
readerIndex(int readerIndex)

Overrides io.netty.buffer.AbstractByteBuf.readerIndex.

Sets the readerIndex of this buffer.
private void
removeComp(int i)

public CompositeByteBuf
removeComponent(int
the index on from which the ByteBuf will be remove
cIndex
)

Remove the ByteBuf from the given index.

public CompositeByteBuf
removeComponents(int
the index on which the ByteBufs will be started to removed
cIndex
,
int
the number of components to remove
numComponents
)

Remove the number of ByteBufs starting from the given index.

private void
removeCompRange(int from, int to)

public CompositeByteBuf
resetReaderIndex()

Overrides io.netty.buffer.AbstractByteBuf.resetReaderIndex.

Repositions the current readerIndex to the marked readerIndex in this buffer.
public CompositeByteBuf
resetWriterIndex()

Overrides io.netty.buffer.AbstractByteBuf.resetWriterIndex.

Repositions the current writerIndex to the marked writerIndex in this buffer.
public CompositeByteBuf
retain(int increment)

Overrides io.netty.buffer.AbstractReferenceCountedByteBuf.retain.

Implements io.netty.util.ReferenceCounted.retain.

Increases the reference count by the specified increment.
public CompositeByteBuf
public CompositeByteBuf
setBoolean(int index, boolean value)

Overrides io.netty.buffer.AbstractByteBuf.setBoolean.

Sets the specified boolean at the specified absolute index in this buffer.
public CompositeByteBuf
setByte(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setByte.

Sets the specified byte at the specified absolute index in this buffer.
public CompositeByteBuf
setBytes(int index, byte[] src, int srcIndex, int length)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Transfers the specified source array's data to this buffer starting at the specified absolute index.
public CompositeByteBuf
setBytes(int index, ByteBuffer src)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Transfers the specified source buffer's data to this buffer starting at the specified absolute index until the source buffer's position reaches its limit.
public CompositeByteBuf
setBytes(int index, ByteBuf src, int
the first index of the source
srcIndex
,
int
the number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Transfers the specified source buffer's data to this buffer starting at the specified absolute index.
public int
setBytes(int index, InputStream in, int
the number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Transfers the content of the specified source stream to this buffer starting at the specified absolute index.
public int
setBytes(int index, ScatteringByteChannel in, int
the maximum number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Transfers the content of the specified source channel to this buffer starting at the specified absolute index.
public int
setBytes(int index, FileChannel in, long
the file position at which the transfer is to begin
position
,
int
the maximum number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Transfers the content of the specified source channel starting at the given file position to this buffer starting at the specified absolute index.
public CompositeByteBuf
setBytes(int index, ByteBuf src)

Overrides io.netty.buffer.AbstractByteBuf.setBytes.

Transfers the specified source buffer's data to this buffer starting at the specified absolute index until the source buffer becomes unreadable.
public CompositeByteBuf
setBytes(int index, ByteBuf src, int
the number of bytes to transfer
length
)

Overrides io.netty.buffer.AbstractByteBuf.setBytes.

Transfers the specified source buffer's data to this buffer starting at the specified absolute index.
public CompositeByteBuf
setBytes(int index, byte[] src)

Overrides io.netty.buffer.AbstractByteBuf.setBytes.

Transfers the specified source array's data to this buffer starting at the specified absolute index.
public CompositeByteBuf
setChar(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setChar.

Sets the specified 2-byte UTF-16 character at the specified absolute index in this buffer.
public CompositeByteBuf
setDouble(int index, double value)

Overrides io.netty.buffer.AbstractByteBuf.setDouble.

Sets the specified 64-bit floating-point number at the specified absolute index in this buffer.
public CompositeByteBuf
setFloat(int index, float value)

Overrides io.netty.buffer.AbstractByteBuf.setFloat.

Sets the specified 32-bit floating-point number at the specified absolute index in this buffer.
public CompositeByteBuf
setIndex(int readerIndex, int writerIndex)

Overrides io.netty.buffer.AbstractByteBuf.setIndex.

Sets the readerIndex and writerIndex of this buffer in one shot.
public CompositeByteBuf
setInt(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setInt.

Sets the specified 32-bit integer at the specified absolute index in this buffer.
public CompositeByteBuf
setLong(int index, long value)

Overrides io.netty.buffer.AbstractByteBuf.setLong.

Sets the specified 64-bit long integer at the specified absolute index in this buffer.
public CompositeByteBuf
setMedium(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setMedium.

Sets the specified 24-bit medium integer at the specified absolute index in this buffer.
public CompositeByteBuf
setShort(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setShort.

Sets the specified 16-bit short integer at the specified absolute index in this buffer.
public CompositeByteBuf
setZero(int index, int
the number of NULs to write to the buffer
length
)

Overrides io.netty.buffer.AbstractByteBuf.setZero.

Fills this buffer with NUL (0x00) starting at the specified absolute index.
private void
shiftComps(int i, int count)

public CompositeByteBuf
skipBytes(int length)

Overrides io.netty.buffer.AbstractByteBuf.skipBytes.

Increases the current readerIndex by the specified length in this buffer.
public int
toByteIndex(int cIndex)

public int
toComponentIndex(int offset)

Return the index for the given offset

private int
toComponentIndex0(int offset)

public String
toString()

Overrides io.netty.buffer.AbstractByteBuf.toString.

Returns the string representation of this buffer.
public CompositeByteBuf
touch()

Overrides io.netty.buffer.AbstractReferenceCountedByteBuf.touch.

Implements io.netty.util.ReferenceCounted.touch.

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

Overrides io.netty.buffer.AbstractReferenceCountedByteBuf.touch.

Implements io.netty.util.ReferenceCounted.touch.

Records the current access location of this object with an additional arbitrary information for debugging purposes.
public ByteBuf
unwrap()

Implements abstract io.netty.buffer.ByteBuf.unwrap.

Return the underlying buffer instance if this buffer is a wrapper of another buffer.
private void
public CompositeByteBuf
writeBoolean(boolean value)

Overrides io.netty.buffer.AbstractByteBuf.writeBoolean.

Sets the specified boolean at the current writerIndex and increases the writerIndex by 1 in this buffer.
public CompositeByteBuf
writeByte(int value)

Overrides io.netty.buffer.AbstractByteBuf.writeByte.

Sets the specified byte at the current writerIndex and increases the writerIndex by 1 in this buffer.
public CompositeByteBuf
writeBytes(ByteBuf src)

Overrides io.netty.buffer.AbstractByteBuf.writeBytes.

Transfers the specified source buffer's data to this buffer starting at the current writerIndex until the source buffer becomes unreadable, and increases the writerIndex by the number of the transferred bytes.
public CompositeByteBuf
writeBytes(ByteBuf src, int
the number of bytes to transfer
length
)

Overrides io.netty.buffer.AbstractByteBuf.writeBytes.

Transfers the specified source buffer's data to this buffer starting at the current writerIndex and increases the writerIndex by the number of the transferred bytes (= length).
public CompositeByteBuf
writeBytes(ByteBuf src, int
the first index of the source
srcIndex
,
int
the number of bytes to transfer
length
)

Overrides io.netty.buffer.AbstractByteBuf.writeBytes.

Transfers the specified source buffer's data to this buffer starting at the current writerIndex and increases the writerIndex by the number of the transferred bytes (= length).
public CompositeByteBuf
writeBytes(byte[] src)

Overrides io.netty.buffer.AbstractByteBuf.writeBytes.

Transfers the specified source array's data to this buffer starting at the current writerIndex and increases the writerIndex by the number of the transferred bytes (= src.length).
public CompositeByteBuf
writeBytes(byte[] src, int
the first index of the source
srcIndex
,
int
the number of bytes to transfer
length
)

Overrides io.netty.buffer.AbstractByteBuf.writeBytes.

Transfers the specified source array's data to this buffer starting at the current writerIndex and increases the writerIndex by the number of the transferred bytes (= length).
public CompositeByteBuf
writeBytes(ByteBuffer src)

Overrides io.netty.buffer.AbstractByteBuf.writeBytes.

Transfers the specified source buffer's data to this buffer starting at the current writerIndex until the source buffer's position reaches its limit, and increases the writerIndex by the number of the transferred bytes.
public CompositeByteBuf
writeChar(int value)

Overrides io.netty.buffer.AbstractByteBuf.writeChar.

Sets the specified 2-byte UTF-16 character at the current writerIndex and increases the writerIndex by 2 in this buffer.
public CompositeByteBuf
writeDouble(double value)

Overrides io.netty.buffer.AbstractByteBuf.writeDouble.

Sets the specified 64-bit floating point number at the current writerIndex and increases the writerIndex by 8 in this buffer.
public CompositeByteBuf
writeFloat(float value)

Overrides io.netty.buffer.AbstractByteBuf.writeFloat.

Sets the specified 32-bit floating point number at the current writerIndex and increases the writerIndex by 4 in this buffer.
public CompositeByteBuf
writeInt(int value)

Overrides io.netty.buffer.AbstractByteBuf.writeInt.

Sets the specified 32-bit integer at the current writerIndex and increases the writerIndex by 4 in this buffer.
public CompositeByteBuf
writeLong(long value)

Overrides io.netty.buffer.AbstractByteBuf.writeLong.

Sets the specified 64-bit long integer at the current writerIndex and increases the writerIndex by 8 in this buffer.
public CompositeByteBuf
writeMedium(int value)

Overrides io.netty.buffer.AbstractByteBuf.writeMedium.

Sets the specified 24-bit medium integer at the current writerIndex and increases the writerIndex by 3 in this buffer.
public CompositeByteBuf
writerIndex(int writerIndex)

Overrides io.netty.buffer.AbstractByteBuf.writerIndex.

Sets the writerIndex of this buffer.
public CompositeByteBuf
writeShort(int value)

Overrides io.netty.buffer.AbstractByteBuf.writeShort.

Sets the specified 16-bit short integer at the current writerIndex and increases the writerIndex by 2 in this buffer.
public CompositeByteBuf
writeZero(int
the number of NULs to write to the buffer
length
)

Overrides io.netty.buffer.AbstractByteBuf.writeZero.

Fills this buffer with NUL (0x00) starting at the current writerIndex and increases the writerIndex by the specified length.
Inherited from io.netty.buffer.AbstractReferenceCountedByteBuf:
refCntreleasereleaseresetRefCntsetRefCnt