CompositeByteBuf

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

class CompositeByteBuf : AbstractReferenceCountedByteBuf , Iterable!(ByteBuf) {}

Constructors

this
this(ByteBufAllocator alloc, bool direct, int maxNumComponents)
Undocumented in source.
this
this(ByteBufAllocator alloc, bool direct, int maxNumComponents, ByteBuf[] buffers)
Undocumented in source.
this
this(ByteBufAllocator alloc, bool direct, int maxNumComponents, ByteBuf[] buffers, int offset)
Undocumented in source.
this
this(ByteBufAllocator alloc, bool direct, int maxNumComponents, ByteWrapper!(T) wrapper, T[] buffers, int offset)
Undocumented in source.
this
this(ByteBufAllocator alloc)
Undocumented in source.

Members

Aliases

readerIndex
alias readerIndex = ByteBuf.readerIndex
Undocumented in source.
writerIndex
alias writerIndex = ByteBuf.writerIndex
Undocumented in source.

Functions

_getByte
byte _getByte(int index)
Undocumented in source. Be warned that the author may not have intended to support it.
_getInt
int _getInt(int index)
Undocumented in source. Be warned that the author may not have intended to support it.
_getIntLE
int _getIntLE(int index)
Undocumented in source. Be warned that the author may not have intended to support it.
_getLong
long _getLong(int index)
Undocumented in source. Be warned that the author may not have intended to support it.
_getLongLE
long _getLongLE(int index)
Undocumented in source. Be warned that the author may not have intended to support it.
_getShort
short _getShort(int index)
Undocumented in source. Be warned that the author may not have intended to support it.
_getShortLE
short _getShortLE(int index)
Undocumented in source. Be warned that the author may not have intended to support it.
_getUnsignedMedium
int _getUnsignedMedium(int index)
Undocumented in source. Be warned that the author may not have intended to support it.
_getUnsignedMediumLE
int _getUnsignedMediumLE(int index)
Undocumented in source. Be warned that the author may not have intended to support it.
_setByte
void _setByte(int index, int value)
Undocumented in source. Be warned that the author may not have intended to support it.
_setInt
void _setInt(int index, int value)
Undocumented in source. Be warned that the author may not have intended to support it.
_setIntLE
void _setIntLE(int index, int value)
Undocumented in source. Be warned that the author may not have intended to support it.
_setLong
void _setLong(int index, long value)
Undocumented in source. Be warned that the author may not have intended to support it.
_setLongLE
void _setLongLE(int index, long value)
Undocumented in source. Be warned that the author may not have intended to support it.
_setMedium
void _setMedium(int index, int value)
Undocumented in source. Be warned that the author may not have intended to support it.
_setMediumLE
void _setMediumLE(int index, int value)
Undocumented in source. Be warned that the author may not have intended to support it.
_setShort
void _setShort(int index, int value)
Undocumented in source. Be warned that the author may not have intended to support it.
_setShortLE
void _setShortLE(int index, int value)
Undocumented in source. Be warned that the author may not have intended to support it.
addComponent
CompositeByteBuf addComponent(ByteBuf buffer)

Add the given {@link ByteBuf}. <p> Be aware that this method does not increase the {@code writerIndex} of the {@link CompositeByteBuf}. If you need to have it increased use {@link #addComponent(bool, ByteBuf)}. <p> {@link ByteBuf#release()} ownership of {@code buffer} is transferred to this {@link CompositeByteBuf}. @param buffer the {@link ByteBuf} to add. {@link ByteBuf#release()} ownership is transferred to this {@link CompositeByteBuf}.

addComponent
CompositeByteBuf addComponent(int cIndex, ByteBuf buffer)

Add the given {@link ByteBuf} on the specific index. <p> Be aware that this method does not increase the {@code writerIndex} of the {@link CompositeByteBuf}. If you need to have it increased use {@link #addComponent(bool, int, ByteBuf)}. <p> {@link ByteBuf#release()} ownership of {@code buffer} is transferred to this {@link CompositeByteBuf}. @param cIndex the index on which the {@link ByteBuf} will be added. @param buffer the {@link ByteBuf} to add. {@link ByteBuf#release()} ownership is transferred to this {@link CompositeByteBuf}.

addComponent
CompositeByteBuf addComponent(bool increaseWriterIndex, ByteBuf buffer)

Add the given {@link ByteBuf} and increase the {@code writerIndex} if {@code increaseWriterIndex} is {@code true}.

addComponent
CompositeByteBuf addComponent(bool increaseWriterIndex, int cIndex, ByteBuf buffer)

Add the given {@link ByteBuf} on the specific index and increase the {@code writerIndex} if {@code increaseWriterIndex} is {@code true}.

addComponents
CompositeByteBuf addComponents(ByteBuf[] buffers)

Add the given {@link ByteBuf}s. <p> Be aware that this method does not increase the {@code writerIndex} of the {@link CompositeByteBuf}. If you need to have it increased use {@link #addComponents(bool, ByteBuf[])}. <p> {@link ByteBuf#release()} ownership of all {@link ByteBuf} objects in {@code buffers} is transferred to this {@link CompositeByteBuf}. @param buffers the {@link ByteBuf}s to add. {@link ByteBuf#release()} ownership of all {@link ByteBuf#release()} ownership of all {@link ByteBuf} objects is transferred to this {@link CompositeByteBuf}.

addComponents
CompositeByteBuf addComponents(Iterable!(ByteBuf) buffers)

Add the given {@link ByteBuf}s. <p> Be aware that this method does not increase the {@code writerIndex} of the {@link CompositeByteBuf}. If you need to have it increased use {@link #addComponents(bool, Iterable)}. <p> {@link ByteBuf#release()} ownership of all {@link ByteBuf} objects in {@code buffers} is transferred to this {@link CompositeByteBuf}. @param buffers the {@link ByteBuf}s to add. {@link ByteBuf#release()} ownership of all {@link ByteBuf#release()} ownership of all {@link ByteBuf} objects is transferred to this {@link CompositeByteBuf}.

addComponents
CompositeByteBuf addComponents(bool increaseWriterIndex, ByteBuf[] buffers)

Add the given {@link ByteBuf}s and increase the {@code writerIndex} if {@code increaseWriterIndex} is {@code true}.

addComponents
CompositeByteBuf addComponents(bool increaseWriterIndex, Iterable!(ByteBuf) buffers)

Add the given {@link ByteBuf}s and increase the {@code writerIndex} if {@code increaseWriterIndex} is {@code true}.

addComponents
CompositeByteBuf addComponents(int cIndex, ByteBuf[] buffers)

Add the given {@link ByteBuf}s on the specific index <p> Be aware that this method does not increase the {@code writerIndex} of the {@link CompositeByteBuf}. If you need to have it increased you need to handle it by your own. <p> {@link ByteBuf#release()} ownership of all {@link ByteBuf} objects in {@code buffers} is transferred to this {@link CompositeByteBuf}. @param cIndex the index on which the {@link ByteBuf} will be added. {@link ByteBuf#release()} ownership of all {@link ByteBuf#release()} ownership of all {@link ByteBuf} objects is transferred to this {@link CompositeByteBuf}. @param buffers the {@link ByteBuf}s to add. {@link ByteBuf#release()} ownership of all {@link ByteBuf#release()} ownership of all {@link ByteBuf} objects is transferred to this {@link CompositeByteBuf}.

addComponents
CompositeByteBuf addComponents(int cIndex, Iterable!(ByteBuf) buffers)

Add the given {@link ByteBuf}s on the specific index

addFlattenedComponents
CompositeByteBuf addFlattenedComponents(bool increaseWriterIndex, ByteBuf buffer)

Add the given {@link ByteBuf} and increase the {@code writerIndex} if {@code increaseWriterIndex} is {@code true}. If the provided buffer is a {@link CompositeByteBuf} itself, a "shallow copy" of its readable components will be performed. Thus the actual number of new components added may vary and in particular will be zero if the provided buffer is not readable. <p> {@link ByteBuf#release()} ownership of {@code buffer} is transferred to this {@link CompositeByteBuf}. @param buffer the {@link ByteBuf} to add. {@link ByteBuf#release()} ownership is transferred to this {@link CompositeByteBuf}.

alloc
ByteBufAllocator alloc()
Undocumented in source. Be warned that the author may not have intended to support it.
array
byte[] array()
Undocumented in source. Be warned that the author may not have intended to support it.
arrayOffset
int arrayOffset()
Undocumented in source. Be warned that the author may not have intended to support it.
capacity
int capacity()
Undocumented in source. Be warned that the author may not have intended to support it.
capacity
CompositeByteBuf capacity(int newCapacity)
Undocumented in source. Be warned that the author may not have intended to support it.
clear
CompositeByteBuf clear()
Undocumented in source. Be warned that the author may not have intended to support it.
component
ByteBuf component(int cIndex)

Return the {@link ByteBuf} on the specified index

componentAtOffset
ByteBuf componentAtOffset(int offset)

Return the {@link ByteBuf} on the specified index

consolidate
CompositeByteBuf consolidate()

Consolidate the composed {@link ByteBuf}s

consolidate
CompositeByteBuf consolidate(int cIndex, int numComponents)

Consolidate the composed {@link ByteBuf}s

copy
ByteBuf copy(int index, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
deallocate
void deallocate()
Undocumented in source. Be warned that the author may not have intended to support it.
decompose
List!(ByteBuf) decompose(int offset, int length)

Same with {@link #slice(int, int)} except that this method returns a list.

discardReadBytes
CompositeByteBuf discardReadBytes()
Undocumented in source. Be warned that the author may not have intended to support it.
discardReadComponents
CompositeByteBuf discardReadComponents()

Discard all {@link ByteBuf}s which are read.

discardSomeReadBytes
CompositeByteBuf discardSomeReadBytes()
Undocumented in source. Be warned that the author may not have intended to support it.
ensureWritable
CompositeByteBuf ensureWritable(int minWritableBytes)
Undocumented in source. Be warned that the author may not have intended to support it.
forEachByteAsc0
int forEachByteAsc0(int start, int end, ByteProcessor processor)
Undocumented in source. Be warned that the author may not have intended to support it.
forEachByteDesc0
int forEachByteDesc0(int rStart, int rEnd, ByteProcessor processor)
Undocumented in source. Be warned that the author may not have intended to support it.
getByte
byte getByte(int index)
Undocumented in source. Be warned that the author may not have intended to support it.
getBytes
CompositeByteBuf getBytes(int index, byte[] dst, int dstIndex, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
getBytes
CompositeByteBuf getBytes(int index, ByteBuffer dst)
Undocumented in source. Be warned that the author may not have intended to support it.
getBytes
CompositeByteBuf getBytes(int index, ByteBuf dst, int dstIndex, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
getBytes
CompositeByteBuf getBytes(int index, OutputStream output, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
getBytes
CompositeByteBuf getBytes(int index, ByteBuf dst)
Undocumented in source. Be warned that the author may not have intended to support it.
getBytes
CompositeByteBuf getBytes(int index, ByteBuf dst, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
getBytes
CompositeByteBuf getBytes(int index, byte[] dst)
Undocumented in source. Be warned that the author may not have intended to support it.
hasArray
bool hasArray()
Undocumented in source. Be warned that the author may not have intended to support it.
hasMemoryAddress
bool hasMemoryAddress()
Undocumented in source. Be warned that the author may not have intended to support it.
internalComponent
ByteBuf internalComponent(int cIndex)

Return the internal {@link ByteBuf} on the specified index. Note that updating the indexes of the returned buffer will lead to an undefined behavior of this buffer.

internalComponentAtOffset
ByteBuf internalComponentAtOffset(int offset)

Return the internal {@link ByteBuf} on the specified offset. Note that updating the indexes of the returned buffer will lead to an undefined behavior of this buffer.

internalNioBuffer
ByteBuffer internalNioBuffer(int index, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
isAccessible
bool isAccessible()
Undocumented in source. Be warned that the author may not have intended to support it.
isDirect
bool isDirect()
Undocumented in source. Be warned that the author may not have intended to support it.
iterator
InputRange!(ByteBuf) iterator()
Undocumented in source. Be warned that the author may not have intended to support it.
markReaderIndex
CompositeByteBuf markReaderIndex()
Undocumented in source. Be warned that the author may not have intended to support it.
markWriterIndex
CompositeByteBuf markWriterIndex()
Undocumented in source. Be warned that the author may not have intended to support it.
maxNumComponents
int maxNumComponents()

Return the max number of {@link ByteBuf}'s that are composed in this instance

memoryAddress
long memoryAddress()
Undocumented in source. Be warned that the author may not have intended to support it.
nioBuffer
ByteBuffer nioBuffer(int index, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
nioBufferCount
int nioBufferCount()
Undocumented in source. Be warned that the author may not have intended to support it.
nioBuffers
ByteBuffer[] nioBuffers(int index, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
nioBuffers
ByteBuffer[] nioBuffers()
Undocumented in source. Be warned that the author may not have intended to support it.
numComponents
int numComponents()

Return the current number of {@link ByteBuf}'s that are composed in this instance

opApply
int opApply(int delegate(ref ByteBuf) dg)
Undocumented in source. Be warned that the author may not have intended to support it.
order
ByteOrder order()
Undocumented in source. Be warned that the author may not have intended to support it.
readBytes
CompositeByteBuf readBytes(ByteBuf dst)
Undocumented in source. Be warned that the author may not have intended to support it.
readBytes
CompositeByteBuf readBytes(ByteBuf dst, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
readBytes
CompositeByteBuf readBytes(ByteBuf dst, int dstIndex, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
readBytes
CompositeByteBuf readBytes(byte[] dst)
Undocumented in source. Be warned that the author may not have intended to support it.
readBytes
CompositeByteBuf readBytes(byte[] dst, int dstIndex, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
readBytes
CompositeByteBuf readBytes(ByteBuffer dst)
Undocumented in source. Be warned that the author may not have intended to support it.
readBytes
CompositeByteBuf readBytes(OutputStream output, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
readerIndex
CompositeByteBuf readerIndex(int index)
Undocumented in source. Be warned that the author may not have intended to support it.
removeComponent
CompositeByteBuf removeComponent(int cIndex)

Remove the {@link ByteBuf} from the given index.

removeComponents
CompositeByteBuf removeComponents(int cIndex, int numComponents)

Remove the number of {@link ByteBuf}s starting from the given index.

resetReaderIndex
CompositeByteBuf resetReaderIndex()
Undocumented in source. Be warned that the author may not have intended to support it.
resetWriterIndex
CompositeByteBuf resetWriterIndex()
Undocumented in source. Be warned that the author may not have intended to support it.
retain
CompositeByteBuf retain(int increment)
Undocumented in source. Be warned that the author may not have intended to support it.
retain
CompositeByteBuf retain()
Undocumented in source. Be warned that the author may not have intended to support it.
setBoolean
CompositeByteBuf setBoolean(int index, bool value)
Undocumented in source. Be warned that the author may not have intended to support it.
setByte
CompositeByteBuf setByte(int index, int value)
Undocumented in source. Be warned that the author may not have intended to support it.
setBytes
CompositeByteBuf setBytes(int index, byte[] src, int srcIndex, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
setBytes
CompositeByteBuf setBytes(int index, ByteBuffer src)
Undocumented in source. Be warned that the author may not have intended to support it.
setBytes
CompositeByteBuf setBytes(int index, ByteBuf src, int srcIndex, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
setBytes
int setBytes(int index, InputStream input, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
setBytes
CompositeByteBuf setBytes(int index, ByteBuf src)
Undocumented in source. Be warned that the author may not have intended to support it.
setBytes
CompositeByteBuf setBytes(int index, ByteBuf src, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
setBytes
CompositeByteBuf setBytes(int index, byte[] src)
Undocumented in source. Be warned that the author may not have intended to support it.
setChar
CompositeByteBuf setChar(int index, int value)
Undocumented in source. Be warned that the author may not have intended to support it.
setDouble
CompositeByteBuf setDouble(int index, double value)
Undocumented in source. Be warned that the author may not have intended to support it.
setFloat
CompositeByteBuf setFloat(int index, float value)
Undocumented in source. Be warned that the author may not have intended to support it.
setIndex
CompositeByteBuf setIndex(int rIndex, int wIndex)
Undocumented in source. Be warned that the author may not have intended to support it.
setInt
CompositeByteBuf setInt(int index, int value)
Undocumented in source. Be warned that the author may not have intended to support it.
setLong
CompositeByteBuf setLong(int index, long value)
Undocumented in source. Be warned that the author may not have intended to support it.
setMedium
CompositeByteBuf setMedium(int index, int value)
Undocumented in source. Be warned that the author may not have intended to support it.
setShort
CompositeByteBuf setShort(int index, int value)
Undocumented in source. Be warned that the author may not have intended to support it.
setZero
CompositeByteBuf setZero(int index, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
skipBytes
CompositeByteBuf skipBytes(int length)
Undocumented in source. Be warned that the author may not have intended to support it.
toByteIndex
int toByteIndex(int cIndex)
Undocumented in source. Be warned that the author may not have intended to support it.
toComponentIndex
int toComponentIndex(int offset)

Return the index for the given offset

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.
touch
CompositeByteBuf touch(Object hint)
Undocumented in source. Be warned that the author may not have intended to support it.
touch
CompositeByteBuf touch()
Undocumented in source. Be warned that the author may not have intended to support it.
unwrap
ByteBuf unwrap()
Undocumented in source. Be warned that the author may not have intended to support it.
writeBoolean
CompositeByteBuf writeBoolean(bool value)
Undocumented in source. Be warned that the author may not have intended to support it.
writeByte
CompositeByteBuf writeByte(int value)
Undocumented in source. Be warned that the author may not have intended to support it.
writeBytes
CompositeByteBuf writeBytes(ByteBuf src)
Undocumented in source. Be warned that the author may not have intended to support it.
writeBytes
CompositeByteBuf writeBytes(ByteBuf src, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
writeBytes
CompositeByteBuf writeBytes(ByteBuf src, int srcIndex, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
writeBytes
CompositeByteBuf writeBytes(byte[] src)
Undocumented in source. Be warned that the author may not have intended to support it.
writeBytes
CompositeByteBuf writeBytes(byte[] src, int srcIndex, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
writeBytes
CompositeByteBuf writeBytes(ByteBuffer src)
Undocumented in source. Be warned that the author may not have intended to support it.
writeChar
CompositeByteBuf writeChar(int value)
Undocumented in source. Be warned that the author may not have intended to support it.
writeDouble
CompositeByteBuf writeDouble(double value)
Undocumented in source. Be warned that the author may not have intended to support it.
writeFloat
CompositeByteBuf writeFloat(float value)
Undocumented in source. Be warned that the author may not have intended to support it.
writeInt
CompositeByteBuf writeInt(int value)
Undocumented in source. Be warned that the author may not have intended to support it.
writeLong
CompositeByteBuf writeLong(long value)
Undocumented in source. Be warned that the author may not have intended to support it.
writeMedium
CompositeByteBuf writeMedium(int value)
Undocumented in source. Be warned that the author may not have intended to support it.
writeShort
CompositeByteBuf writeShort(int value)
Undocumented in source. Be warned that the author may not have intended to support it.
writeZero
CompositeByteBuf writeZero(int length)
Undocumented in source. Be warned that the author may not have intended to support it.
writerIndex
CompositeByteBuf writerIndex(int index)
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

BYTE_ARRAY_WRAPPER
ByteWrapper!(byte[]) BYTE_ARRAY_WRAPPER()
Undocumented in source. Be warned that the author may not have intended to support it.
BYTE_BUFFER_WRAPPER
ByteWrapper!(ByteBuffer) BYTE_BUFFER_WRAPPER()
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From AbstractReferenceCountedByteBuf

IntegerFieldUpdater
alias IntegerFieldUpdater = AtomicIntegerFieldUpdater!(AbstractReferenceCountedByteBuf, "_refCnt")
Undocumented in source.
RefCntUpdater
alias RefCntUpdater = ReferenceCountUpdater!(AbstractReferenceCountedByteBuf, "_refCnt")
Undocumented in source.
isAccessible
bool isAccessible()
Undocumented in source. Be warned that the author may not have intended to support it.
refCnt
int refCnt()
Undocumented in source. Be warned that the author may not have intended to support it.
setRefCnt
void setRefCnt(int refCnt)

An unsafe operation intended for use by a subclass that sets the reference count of the buffer directly

resetRefCnt
void resetRefCnt()

An unsafe operation intended for use by a subclass that resets the reference count of the buffer to 1

retain
ByteBuf retain()
Undocumented in source. Be warned that the author may not have intended to support it.
retain
ByteBuf retain(int increment)
Undocumented in source. Be warned that the author may not have intended to support it.
touch
ByteBuf touch()
Undocumented in source. Be warned that the author may not have intended to support it.
touch
ByteBuf touch(Object hint)
Undocumented in source. Be warned that the author may not have intended to support it.
release
bool release()
Undocumented in source. Be warned that the author may not have intended to support it.
release
bool release(int decrement)
Undocumented in source. Be warned that the author may not have intended to support it.
deallocate
void deallocate()

Called once {@link #refCnt()} is equals 0.

Meta