final class AdvancedLeakAwareCompositeByteBuf extends WrappedCompositeByteBuf
Modifier and Type | Field and Description |
---|---|
private ResourceLeak |
leak |
leakDetector, readerIndex, writerIndex
Constructor and Description |
---|
AdvancedLeakAwareCompositeByteBuf(CompositeByteBuf wrapped,
ResourceLeak leak) |
Modifier and Type | Method and Description |
---|---|
CompositeByteBuf |
addComponent(boolean increaseWriterIndex,
ByteBuf buffer)
|
CompositeByteBuf |
addComponent(boolean increaseWriterIndex,
int cIndex,
ByteBuf buffer)
Add the given
ByteBuf on the specific index and increase the writerIndex
if increaseWriterIndex is true . |
CompositeByteBuf |
addComponent(ByteBuf buffer)
Add the given
ByteBuf . |
CompositeByteBuf |
addComponent(int cIndex,
ByteBuf buffer)
Add the given
ByteBuf on the specific index. |
CompositeByteBuf |
addComponents(boolean increaseWriterIndex,
ByteBuf... buffers)
|
CompositeByteBuf |
addComponents(boolean increaseWriterIndex,
java.lang.Iterable<ByteBuf> buffers)
|
CompositeByteBuf |
addComponents(ByteBuf... buffers)
Add the given
ByteBuf s. |
CompositeByteBuf |
addComponents(int cIndex,
ByteBuf... buffers)
Add the given
ByteBuf s on the specific index |
CompositeByteBuf |
addComponents(int cIndex,
java.lang.Iterable<ByteBuf> buffers)
Add the given
ByteBuf s on the specific index
Be aware that this method does not increase the writerIndex of the CompositeByteBuf . |
CompositeByteBuf |
addComponents(java.lang.Iterable<ByteBuf> buffers)
Add the given
ByteBuf s. |
int |
bytesBefore(byte value)
Locates the first occurrence of the specified
value in this
buffer. |
int |
bytesBefore(int length,
byte value)
Locates the first occurrence of the specified
value in this
buffer. |
int |
bytesBefore(int index,
int length,
byte value)
Locates the first occurrence of the specified
value in this
buffer. |
CompositeByteBuf |
capacity(int newCapacity)
Adjusts the capacity of this buffer.
|
CompositeByteBuf |
consolidate()
Consolidate the composed
ByteBuf s |
CompositeByteBuf |
consolidate(int cIndex,
int numComponents)
Consolidate the composed
ByteBuf s |
ByteBuf |
copy()
Returns a copy of this buffer's readable bytes.
|
ByteBuf |
copy(int index,
int length)
Returns a copy of this buffer's sub-region.
|
java.util.List<ByteBuf> |
decompose(int offset,
int length)
Same with
AbstractByteBuf.slice(int, int) except that this method returns a list. |
CompositeByteBuf |
discardReadBytes()
Discards the bytes between the 0th index and
readerIndex . |
CompositeByteBuf |
discardReadComponents()
Discard all
ByteBuf s which are read. |
CompositeByteBuf |
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. |
ByteBuf |
duplicate()
Returns a buffer which shares the whole region of this buffer.
|
CompositeByteBuf |
ensureWritable(int minWritableBytes)
Makes sure the number of the writable bytes
is equal to or greater than the specified value.
|
int |
ensureWritable(int minWritableBytes,
boolean force)
Tries to make sure the number of the writable bytes
is equal to or greater than the specified value.
|
int |
forEachByte(ByteBufProcessor processor)
Iterates over the readable bytes of this buffer with the specified
processor in ascending order. |
int |
forEachByte(int index,
int length,
ByteBufProcessor processor)
Iterates over the specified area of this buffer with the specified
processor in ascending order. |
int |
forEachByteDesc(ByteBufProcessor processor)
Iterates over the readable bytes of this buffer with the specified
processor in descending order. |
int |
forEachByteDesc(int index,
int length,
ByteBufProcessor processor)
Iterates over the specified area of this buffer with the specified
processor in descending order. |
boolean |
getBoolean(int index)
Gets a boolean at the specified absolute (@code index) in this buffer.
|
byte |
getByte(int index)
Gets a byte at the specified absolute
index in this buffer. |
CompositeByteBuf |
getBytes(int index,
byte[] dst)
Transfers this buffer's data to the specified destination starting at
the specified absolute
index . |
CompositeByteBuf |
getBytes(int index,
byte[] dst,
int dstIndex,
int length)
Transfers this buffer's data to the specified destination starting at
the specified absolute
index . |
CompositeByteBuf |
getBytes(int index,
ByteBuf dst)
Transfers this buffer's data to the specified destination starting at
the specified absolute
index until the destination becomes
non-writable. |
CompositeByteBuf |
getBytes(int index,
java.nio.ByteBuffer dst)
Transfers this buffer's data to the specified destination starting at
the specified absolute
index until the destination's position
reaches its limit. |
CompositeByteBuf |
getBytes(int index,
ByteBuf dst,
int length)
Transfers this buffer's data to the specified destination starting at
the specified absolute
index . |
CompositeByteBuf |
getBytes(int index,
ByteBuf dst,
int dstIndex,
int length)
Transfers this buffer's data to the specified destination starting at
the specified absolute
index . |
int |
getBytes(int index,
java.nio.channels.GatheringByteChannel out,
int length)
Transfers this buffer's data to the specified channel starting at the
specified absolute
index . |
CompositeByteBuf |
getBytes(int index,
java.io.OutputStream out,
int length)
Transfers this buffer's data to the specified stream starting at the
specified absolute
index . |
char |
getChar(int index)
Gets a 2-byte UTF-16 character at the specified absolute
index in this buffer. |
double |
getDouble(int index)
Gets a 64-bit floating point number at the specified absolute
index in this buffer. |
float |
getFloat(int index)
Gets a 32-bit floating point number at the specified absolute
index in this buffer. |
int |
getInt(int index)
Gets a 32-bit integer at the specified absolute
index in
this buffer. |
long |
getLong(int index)
Gets a 64-bit long integer at the specified absolute
index in
this buffer. |
int |
getMedium(int index)
Gets a 24-bit medium integer at the specified absolute
index in
this buffer. |
short |
getShort(int index)
Gets a 16-bit short integer at the specified absolute
index in
this buffer. |
short |
getUnsignedByte(int index)
Gets an unsigned byte at the specified absolute
index in this
buffer. |
long |
getUnsignedInt(int index)
Gets an unsigned 32-bit integer at the specified absolute
index
in this buffer. |
int |
getUnsignedMedium(int index)
Gets an unsigned 24-bit medium integer at the specified absolute
index in this buffer. |
int |
getUnsignedShort(int index)
Gets an unsigned 16-bit short integer at the specified absolute
index in this buffer. |
int |
indexOf(int fromIndex,
int toIndex,
byte value)
Locates the first occurrence of the specified
value in this
buffer. |
java.nio.ByteBuffer |
internalNioBuffer(int index,
int length)
Internal use only: Exposes the internal NIO buffer.
|
java.util.Iterator<ByteBuf> |
iterator() |
java.nio.ByteBuffer |
nioBuffer()
Exposes this buffer's readable bytes as an NIO
ByteBuffer . |
java.nio.ByteBuffer |
nioBuffer(int index,
int length)
Exposes this buffer's sub-region as an NIO
ByteBuffer . |
int |
nioBufferCount()
Returns the maximum number of NIO
ByteBuffer s that consist this buffer. |
java.nio.ByteBuffer[] |
nioBuffers()
Exposes this buffer's readable bytes as an NIO
ByteBuffer 's. |
java.nio.ByteBuffer[] |
nioBuffers(int index,
int length)
Exposes this buffer's bytes as an NIO
ByteBuffer 's for the specified index and length
The returned buffer shares the content with this buffer, while changing the position and limit
of the returned NIO buffer does not affect the indexes and marks of this buffer. |
ByteBuf |
order(java.nio.ByteOrder endianness)
Returns a buffer with the specified
endianness which shares the whole region,
indexes, and marks of this buffer. |
boolean |
readBoolean()
Gets a boolean at the current
readerIndex and increases
the readerIndex by 1 in this buffer. |
byte |
readByte()
Gets a byte at the current
readerIndex and increases
the readerIndex by 1 in this buffer. |
CompositeByteBuf |
readBytes(byte[] dst)
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 ). |
CompositeByteBuf |
readBytes(byte[] dst,
int dstIndex,
int length)
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 ). |
CompositeByteBuf |
readBytes(ByteBuf dst)
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. |
CompositeByteBuf |
readBytes(java.nio.ByteBuffer dst)
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. |
CompositeByteBuf |
readBytes(ByteBuf dst,
int length)
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 ). |
CompositeByteBuf |
readBytes(ByteBuf dst,
int dstIndex,
int length)
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 ). |
int |
readBytes(java.nio.channels.GatheringByteChannel out,
int length)
Transfers this buffer's data to the specified stream starting at the
current
readerIndex . |
ByteBuf |
readBytes(int length)
Transfers this buffer's data to a newly created buffer starting at
the current
readerIndex and increases the readerIndex
by the number of the transferred bytes (= length ). |
CompositeByteBuf |
readBytes(java.io.OutputStream out,
int length)
Transfers this buffer's data to the specified stream starting at the
current
readerIndex . |
char |
readChar()
Gets a 2-byte UTF-16 character at the current
readerIndex
and increases the readerIndex by 2 in this buffer. |
double |
readDouble()
Gets a 64-bit floating point number at the current
readerIndex
and increases the readerIndex by 8 in this buffer. |
float |
readFloat()
Gets a 32-bit floating point number at the current
readerIndex
and increases the readerIndex by 4 in this buffer. |
int |
readInt()
Gets a 32-bit integer at the current
readerIndex
and increases the readerIndex by 4 in this buffer. |
long |
readLong()
Gets a 64-bit integer at the current
readerIndex
and increases the readerIndex by 8 in this buffer. |
int |
readMedium()
Gets a 24-bit medium integer at the current
readerIndex
and increases the readerIndex by 3 in this buffer. |
short |
readShort()
Gets a 16-bit short integer at the current
readerIndex
and increases the readerIndex by 2 in this buffer. |
ByteBuf |
readSlice(int length)
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 ). |
short |
readUnsignedByte()
Gets an unsigned byte at the current
readerIndex and increases
the readerIndex by 1 in this buffer. |
long |
readUnsignedInt()
Gets an unsigned 32-bit integer at the current
readerIndex
and increases the readerIndex by 4 in this buffer. |
int |
readUnsignedMedium()
Gets an unsigned 24-bit medium integer at the current
readerIndex
and increases the readerIndex by 3 in this buffer. |
int |
readUnsignedShort()
Gets an unsigned 16-bit short integer at the current
readerIndex
and increases the readerIndex by 2 in this buffer. |
boolean |
release()
Decreases the reference count by
1 and deallocates this object if the reference count reaches at
0 . |
boolean |
release(int decrement)
Decreases the reference count by the specified
decrement and deallocates this object if the reference
count reaches at 0 . |
CompositeByteBuf |
removeComponent(int cIndex)
Remove the
ByteBuf from the given index. |
CompositeByteBuf |
removeComponents(int cIndex,
int numComponents)
Remove the number of
ByteBuf s starting from the given index. |
CompositeByteBuf |
retain()
Increases the reference count by
1 . |
CompositeByteBuf |
retain(int increment)
Increases the reference count by the specified
increment . |
CompositeByteBuf |
setBoolean(int index,
boolean value)
Sets the specified boolean at the specified absolute
index in this
buffer. |
CompositeByteBuf |
setByte(int index,
int value)
Sets the specified byte at the specified absolute
index in this
buffer. |
CompositeByteBuf |
setBytes(int index,
byte[] src)
Transfers the specified source array's data to this buffer starting at
the specified absolute
index . |
CompositeByteBuf |
setBytes(int index,
byte[] src,
int srcIndex,
int length)
Transfers the specified source array's data to this buffer starting at
the specified absolute
index . |
CompositeByteBuf |
setBytes(int index,
ByteBuf src)
Transfers the specified source buffer's data to this buffer starting at
the specified absolute
index until the source buffer becomes
unreadable. |
CompositeByteBuf |
setBytes(int index,
java.nio.ByteBuffer src)
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. |
CompositeByteBuf |
setBytes(int index,
ByteBuf src,
int length)
Transfers the specified source buffer's data to this buffer starting at
the specified absolute
index . |
CompositeByteBuf |
setBytes(int index,
ByteBuf src,
int srcIndex,
int length)
Transfers the specified source buffer's data to this buffer starting at
the specified absolute
index . |
int |
setBytes(int index,
java.io.InputStream in,
int length)
Transfers the content of the specified source stream to this buffer
starting at the specified absolute
index . |
int |
setBytes(int index,
java.nio.channels.ScatteringByteChannel in,
int length)
Transfers the content of the specified source channel to this buffer
starting at the specified absolute
index . |
CompositeByteBuf |
setChar(int index,
int value)
Sets the specified 2-byte UTF-16 character at the specified absolute
index in this buffer. |
CompositeByteBuf |
setDouble(int index,
double value)
Sets the specified 64-bit floating-point number at the specified
absolute
index in this buffer. |
CompositeByteBuf |
setFloat(int index,
float value)
Sets the specified 32-bit floating-point number at the specified
absolute
index in this buffer. |
CompositeByteBuf |
setInt(int index,
int value)
Sets the specified 32-bit integer at the specified absolute
index in this buffer. |
CompositeByteBuf |
setLong(int index,
long value)
Sets the specified 64-bit long integer at the specified absolute
index in this buffer. |
CompositeByteBuf |
setMedium(int index,
int value)
Sets the specified 24-bit medium integer at the specified absolute
index in this buffer. |
CompositeByteBuf |
setShort(int index,
int value)
Sets the specified 16-bit short integer at the specified absolute
index in this buffer. |
CompositeByteBuf |
setZero(int index,
int length)
Fills this buffer with NUL (0x00) starting at the specified
absolute
index . |
CompositeByteBuf |
skipBytes(int length)
Increases the current
readerIndex by the specified
length in this buffer. |
ByteBuf |
slice()
Returns a slice of this buffer's readable bytes.
|
ByteBuf |
slice(int index,
int length)
Returns a slice of this buffer's sub-region.
|
java.lang.String |
toString(java.nio.charset.Charset charset)
Decodes this buffer's readable bytes into a string with the specified
character set name.
|
java.lang.String |
toString(int index,
int length,
java.nio.charset.Charset charset)
Decodes this buffer's sub-region into a string with the specified
character set.
|
CompositeByteBuf |
writeBoolean(boolean value)
Sets the specified boolean at the current
writerIndex
and increases the writerIndex by 1 in this buffer. |
CompositeByteBuf |
writeByte(int value)
Sets the specified byte at the current
writerIndex
and increases the writerIndex by 1 in this buffer. |
CompositeByteBuf |
writeBytes(byte[] src)
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 ). |
CompositeByteBuf |
writeBytes(byte[] src,
int srcIndex,
int length)
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 ). |
CompositeByteBuf |
writeBytes(ByteBuf src)
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. |
CompositeByteBuf |
writeBytes(java.nio.ByteBuffer src)
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. |
CompositeByteBuf |
writeBytes(ByteBuf src,
int length)
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 ). |
CompositeByteBuf |
writeBytes(ByteBuf src,
int srcIndex,
int length)
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 ). |
int |
writeBytes(java.io.InputStream in,
int length)
Transfers the content of the specified stream to this buffer
starting at the current
writerIndex and increases the
writerIndex by the number of the transferred bytes. |
int |
writeBytes(java.nio.channels.ScatteringByteChannel in,
int length)
Transfers the content of the specified channel to this buffer
starting at the current
writerIndex and increases the
writerIndex by the number of the transferred bytes. |
CompositeByteBuf |
writeChar(int value)
Sets the specified 2-byte UTF-16 character at the current
writerIndex and increases the writerIndex by 2
in this buffer. |
CompositeByteBuf |
writeDouble(double value)
Sets the specified 64-bit floating point number at the current
writerIndex and increases the writerIndex by 8
in this buffer. |
CompositeByteBuf |
writeFloat(float value)
Sets the specified 32-bit floating point number at the current
writerIndex and increases the writerIndex by 4
in this buffer. |
CompositeByteBuf |
writeInt(int value)
Sets the specified 32-bit integer at the current
writerIndex
and increases the writerIndex by 4 in this buffer. |
CompositeByteBuf |
writeLong(long value)
Sets the specified 64-bit long integer at the current
writerIndex and increases the writerIndex by 8
in this buffer. |
CompositeByteBuf |
writeMedium(int value)
Sets the specified 24-bit medium integer at the current
writerIndex and increases the writerIndex by 3
in this buffer. |
CompositeByteBuf |
writeShort(int value)
Sets the specified 16-bit short integer at the current
writerIndex and increases the writerIndex by 2
in this buffer. |
CompositeByteBuf |
writeZero(int length)
Fills this buffer with NUL (0x00) starting at the current
writerIndex and increases the writerIndex by the
specified length . |
_getByte, _getInt, _getLong, _getShort, _getUnsignedMedium, _setByte, _setInt, _setLong, _setMedium, _setShort, alloc, array, arrayOffset, capacity, clear, compareTo, component, componentAtOffset, deallocate, equals, hasArray, hashCode, hasMemoryAddress, internalComponent, internalComponentAtOffset, isDirect, isReadable, isReadable, isWritable, isWritable, markReaderIndex, markWriterIndex, maxCapacity, maxNumComponents, maxWritableBytes, memoryAddress, numComponents, order, readableBytes, readerIndex, readerIndex, refCnt, resetReaderIndex, resetWriterIndex, setIndex, toByteIndex, toComponentIndex, toString, unwrap, writableBytes, writerIndex, writerIndex
setRefCnt
adjustMarkers, checkDstIndex, checkIndex, checkIndex, checkIndex0, checkReadableBytes, checkSrcIndex, discardMarks, ensureAccessible, maxCapacity, newSwappedByteBuf, setIndex0
private final ResourceLeak leak
AdvancedLeakAwareCompositeByteBuf(CompositeByteBuf wrapped, ResourceLeak leak)
public ByteBuf order(java.nio.ByteOrder endianness)
ByteBuf
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.order
in class WrappedCompositeByteBuf
public ByteBuf slice()
ByteBuf
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 ByteBuf.retain()
and so the
reference count will NOT be increased.
slice
in class WrappedCompositeByteBuf
public ByteBuf slice(int index, int length)
ByteBuf
readerIndex
or writerIndex
of
this buffer.
Also be aware that this method will NOT call ByteBuf.retain()
and so the
reference count will NOT be increased.
slice
in class WrappedCompositeByteBuf
public ByteBuf duplicate()
ByteBuf
buf.slice(0, buf.capacity())
.
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 ByteBuf.retain()
and so the reference count will NOT be increased.
duplicate
in class WrappedCompositeByteBuf
public ByteBuf readSlice(int length)
ByteBuf
readerIndex
and increases the readerIndex
by the size
of the new slice (= length
).
Also be aware that this method will NOT call ByteBuf.retain()
and so the
reference count will NOT be increased.
readSlice
in class WrappedCompositeByteBuf
length
- the size of the new slicepublic CompositeByteBuf discardReadBytes()
ByteBuf
readerIndex
.
It moves the bytes between readerIndex
and writerIndex
to the 0th index, and sets readerIndex
and writerIndex
to 0
and oldWriterIndex - oldReaderIndex
respectively.
Please refer to the class documentation for more detailed explanation.
discardReadBytes
in class WrappedCompositeByteBuf
public CompositeByteBuf discardSomeReadBytes()
ByteBuf
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.discardSomeReadBytes
in class WrappedCompositeByteBuf
public CompositeByteBuf ensureWritable(int minWritableBytes)
ByteBuf
IllegalArgumentException
.ensureWritable
in class WrappedCompositeByteBuf
minWritableBytes
- the expected minimum number of writable bytespublic int ensureWritable(int minWritableBytes, boolean force)
ByteBuf
ByteBuf.ensureWritable(int)
,
this method does not raise an exception but returns a code.ensureWritable
in class WrappedCompositeByteBuf
minWritableBytes
- the expected minimum number of writable bytesforce
- When ByteBuf.writerIndex()
+ minWritableBytes
> ByteBuf.maxCapacity()
:
true
- the capacity of the buffer is expanded to ByteBuf.maxCapacity()
false
- the capacity of the buffer is unchanged0
if the buffer has enough writable bytes, and its capacity is unchanged.
1
if the buffer does not have enough bytes, and its capacity is unchanged.
2
if the buffer has enough writable bytes, and its capacity has been increased.
3
if the buffer does not have enough bytes, but its capacity has been
increased to its maximum.public boolean getBoolean(int index)
ByteBuf
readerIndex
or writerIndex
of this buffer.getBoolean
in class WrappedCompositeByteBuf
public byte getByte(int index)
ByteBuf
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.getByte
in class WrappedCompositeByteBuf
public short getUnsignedByte(int index)
ByteBuf
index
in this
buffer. This method does not modify readerIndex
or
writerIndex
of this buffer.getUnsignedByte
in class WrappedCompositeByteBuf
public short getShort(int index)
ByteBuf
index
in
this buffer. This method does not modify readerIndex
or
writerIndex
of this buffer.getShort
in class WrappedCompositeByteBuf
public int getUnsignedShort(int index)
ByteBuf
index
in this buffer. This method does not modify
readerIndex
or writerIndex
of this buffer.getUnsignedShort
in class WrappedCompositeByteBuf
public int getMedium(int index)
ByteBuf
index
in
this buffer. This method does not modify readerIndex
or
writerIndex
of this buffer.getMedium
in class WrappedCompositeByteBuf
public int getUnsignedMedium(int index)
ByteBuf
index
in this buffer. This method does not modify
readerIndex
or writerIndex
of this buffer.getUnsignedMedium
in class WrappedCompositeByteBuf
public int getInt(int index)
ByteBuf
index
in
this buffer. This method does not modify readerIndex
or
writerIndex
of this buffer.getInt
in class WrappedCompositeByteBuf
public long getUnsignedInt(int index)
ByteBuf
index
in this buffer. This method does not modify readerIndex
or
writerIndex
of this buffer.getUnsignedInt
in class WrappedCompositeByteBuf
public long getLong(int index)
ByteBuf
index
in
this buffer. This method does not modify readerIndex
or
writerIndex
of this buffer.getLong
in class WrappedCompositeByteBuf
public char getChar(int index)
ByteBuf
index
in this buffer. This method does not modify
readerIndex
or writerIndex
of this buffer.getChar
in class WrappedCompositeByteBuf
public float getFloat(int index)
ByteBuf
index
in this buffer. This method does not modify
readerIndex
or writerIndex
of this buffer.getFloat
in class WrappedCompositeByteBuf
public double getDouble(int index)
ByteBuf
index
in this buffer. This method does not modify
readerIndex
or writerIndex
of this buffer.getDouble
in class WrappedCompositeByteBuf
public CompositeByteBuf getBytes(int index, ByteBuf dst)
ByteBuf
index
until the destination becomes
non-writable. This method is basically same with
ByteBuf.getBytes(int, ByteBuf, int, int)
, except that this
method increases the writerIndex
of the destination by the
number of the transferred bytes while
ByteBuf.getBytes(int, ByteBuf, int, int)
does not.
This method does not modify readerIndex
or writerIndex
of
the source buffer (i.e. this
).getBytes
in class WrappedCompositeByteBuf
public CompositeByteBuf getBytes(int index, ByteBuf dst, int length)
ByteBuf
index
. This method is basically same
with ByteBuf.getBytes(int, ByteBuf, int, int)
, except that this
method increases the writerIndex
of the destination by the
number of the transferred bytes while
ByteBuf.getBytes(int, ByteBuf, int, int)
does not.
This method does not modify readerIndex
or writerIndex
of
the source buffer (i.e. this
).getBytes
in class WrappedCompositeByteBuf
length
- the number of bytes to transferpublic CompositeByteBuf getBytes(int index, ByteBuf dst, int dstIndex, int length)
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of both the source (i.e. this
) and the destination.getBytes
in class WrappedCompositeByteBuf
dstIndex
- the first index of the destinationlength
- the number of bytes to transferpublic CompositeByteBuf getBytes(int index, byte[] dst)
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of
this buffergetBytes
in class WrappedCompositeByteBuf
public CompositeByteBuf getBytes(int index, byte[] dst, int dstIndex, int length)
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of this buffer.getBytes
in class WrappedCompositeByteBuf
dstIndex
- the first index of the destinationlength
- the number of bytes to transferpublic CompositeByteBuf getBytes(int index, java.nio.ByteBuffer dst)
ByteBuf
index
until the destination's position
reaches its limit.
This method does not modify readerIndex
or writerIndex
of
this buffer while the destination's position
will be increased.getBytes
in class WrappedCompositeByteBuf
public CompositeByteBuf getBytes(int index, java.io.OutputStream out, int length) throws java.io.IOException
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of
this buffer.getBytes
in class WrappedCompositeByteBuf
length
- the number of bytes to transferjava.io.IOException
- if the specified stream threw an exception during I/Opublic int getBytes(int index, java.nio.channels.GatheringByteChannel out, int length) throws java.io.IOException
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of
this buffer.getBytes
in class WrappedCompositeByteBuf
length
- the maximum number of bytes to transferjava.io.IOException
- if the specified channel threw an exception during I/Opublic CompositeByteBuf setBoolean(int index, boolean value)
ByteBuf
index
in this
buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.setBoolean
in class WrappedCompositeByteBuf
public CompositeByteBuf setByte(int index, int value)
ByteBuf
index
in this
buffer. The 24 high-order bits of the specified value are ignored.
This method does not modify readerIndex
or writerIndex
of
this buffer.setByte
in class WrappedCompositeByteBuf
public CompositeByteBuf setShort(int index, int value)
ByteBuf
index
in this buffer. The 16 high-order bits of the specified
value are ignored.
This method does not modify readerIndex
or writerIndex
of
this buffer.setShort
in class WrappedCompositeByteBuf
public CompositeByteBuf setMedium(int index, int value)
ByteBuf
index
in this buffer. Please note that the most significant
byte is ignored in the specified value.
This method does not modify readerIndex
or writerIndex
of
this buffer.setMedium
in class WrappedCompositeByteBuf
public CompositeByteBuf setInt(int index, int value)
ByteBuf
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.setInt
in class WrappedCompositeByteBuf
public CompositeByteBuf setLong(int index, long value)
ByteBuf
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.setLong
in class WrappedCompositeByteBuf
public CompositeByteBuf setChar(int index, int value)
ByteBuf
index
in this buffer.
The 16 high-order bits of the specified value are ignored.
This method does not modify readerIndex
or writerIndex
of
this buffer.setChar
in class WrappedCompositeByteBuf
public CompositeByteBuf setFloat(int index, float value)
ByteBuf
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.setFloat
in class WrappedCompositeByteBuf
public CompositeByteBuf setDouble(int index, double value)
ByteBuf
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.setDouble
in class WrappedCompositeByteBuf
public CompositeByteBuf setBytes(int index, ByteBuf src)
ByteBuf
index
until the source buffer becomes
unreadable. This method is basically same with
ByteBuf.setBytes(int, ByteBuf, int, int)
, except that this
method increases the readerIndex
of the source buffer by
the number of the transferred bytes while
ByteBuf.setBytes(int, ByteBuf, int, int)
does not.
This method does not modify readerIndex
or writerIndex
of
the source buffer (i.e. this
).setBytes
in class WrappedCompositeByteBuf
public CompositeByteBuf setBytes(int index, ByteBuf src, int length)
ByteBuf
index
. This method is basically same
with ByteBuf.setBytes(int, ByteBuf, int, int)
, except that this
method increases the readerIndex
of the source buffer by
the number of the transferred bytes while
ByteBuf.setBytes(int, ByteBuf, int, int)
does not.
This method does not modify readerIndex
or writerIndex
of
the source buffer (i.e. this
).setBytes
in class WrappedCompositeByteBuf
length
- the number of bytes to transferpublic CompositeByteBuf setBytes(int index, ByteBuf src, int srcIndex, int length)
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of both the source (i.e. this
) and the destination.setBytes
in class WrappedCompositeByteBuf
srcIndex
- the first index of the sourcelength
- the number of bytes to transferpublic CompositeByteBuf setBytes(int index, byte[] src)
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of
this buffer.setBytes
in class WrappedCompositeByteBuf
public CompositeByteBuf setBytes(int index, byte[] src, int srcIndex, int length)
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of
this buffer.setBytes
in class WrappedCompositeByteBuf
public CompositeByteBuf setBytes(int index, java.nio.ByteBuffer src)
ByteBuf
index
until the source buffer's position
reaches its limit.
This method does not modify readerIndex
or writerIndex
of
this buffer.setBytes
in class WrappedCompositeByteBuf
public int setBytes(int index, java.io.InputStream in, int length) throws java.io.IOException
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of
this buffer.setBytes
in class WrappedCompositeByteBuf
length
- the number of bytes to transfer-1
if the specified channel is closed.java.io.IOException
- if the specified stream threw an exception during I/Opublic int setBytes(int index, java.nio.channels.ScatteringByteChannel in, int length) throws java.io.IOException
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of
this buffer.setBytes
in class WrappedCompositeByteBuf
length
- the maximum number of bytes to transfer-1
if the specified channel is closed.java.io.IOException
- if the specified channel threw an exception during I/Opublic CompositeByteBuf setZero(int index, int length)
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of
this buffer.setZero
in class WrappedCompositeByteBuf
length
- the number of NULs to write to the bufferpublic boolean readBoolean()
ByteBuf
readerIndex
and increases
the readerIndex
by 1
in this buffer.readBoolean
in class WrappedCompositeByteBuf
public byte readByte()
ByteBuf
readerIndex
and increases
the readerIndex
by 1
in this buffer.readByte
in class WrappedCompositeByteBuf
public short readUnsignedByte()
ByteBuf
readerIndex
and increases
the readerIndex
by 1
in this buffer.readUnsignedByte
in class WrappedCompositeByteBuf
public short readShort()
ByteBuf
readerIndex
and increases the readerIndex
by 2
in this buffer.readShort
in class WrappedCompositeByteBuf
public int readUnsignedShort()
ByteBuf
readerIndex
and increases the readerIndex
by 2
in this buffer.readUnsignedShort
in class WrappedCompositeByteBuf
public int readMedium()
ByteBuf
readerIndex
and increases the readerIndex
by 3
in this buffer.readMedium
in class WrappedCompositeByteBuf
public int readUnsignedMedium()
ByteBuf
readerIndex
and increases the readerIndex
by 3
in this buffer.readUnsignedMedium
in class WrappedCompositeByteBuf
public int readInt()
ByteBuf
readerIndex
and increases the readerIndex
by 4
in this buffer.readInt
in class WrappedCompositeByteBuf
public long readUnsignedInt()
ByteBuf
readerIndex
and increases the readerIndex
by 4
in this buffer.readUnsignedInt
in class WrappedCompositeByteBuf
public long readLong()
ByteBuf
readerIndex
and increases the readerIndex
by 8
in this buffer.readLong
in class WrappedCompositeByteBuf
public char readChar()
ByteBuf
readerIndex
and increases the readerIndex
by 2
in this buffer.readChar
in class WrappedCompositeByteBuf
public float readFloat()
ByteBuf
readerIndex
and increases the readerIndex
by 4
in this buffer.readFloat
in class WrappedCompositeByteBuf
public double readDouble()
ByteBuf
readerIndex
and increases the readerIndex
by 8
in this buffer.readDouble
in class WrappedCompositeByteBuf
public ByteBuf readBytes(int length)
ByteBuf
readerIndex
and increases the readerIndex
by the number of the transferred bytes (= length
).
The returned buffer's readerIndex
and writerIndex
are
0
and length
respectively.readBytes
in class WrappedCompositeByteBuf
length
- the number of bytes to transferpublic CompositeByteBuf readBytes(ByteBuf dst)
ByteBuf
readerIndex
until the destination becomes
non-writable, and increases the readerIndex
by the number of the
transferred bytes. This method is basically same with
ByteBuf.readBytes(ByteBuf, int, int)
, except that this method
increases the writerIndex
of the destination by the number of
the transferred bytes while ByteBuf.readBytes(ByteBuf, int, int)
does not.readBytes
in class WrappedCompositeByteBuf
public CompositeByteBuf readBytes(ByteBuf dst, int length)
ByteBuf
readerIndex
and increases the readerIndex
by the number of the transferred bytes (= length
). This method
is basically same with ByteBuf.readBytes(ByteBuf, int, int)
,
except that this method increases the writerIndex
of the
destination by the number of the transferred bytes (= length
)
while ByteBuf.readBytes(ByteBuf, int, int)
does not.readBytes
in class WrappedCompositeByteBuf
public CompositeByteBuf readBytes(ByteBuf dst, int dstIndex, int length)
ByteBuf
readerIndex
and increases the readerIndex
by the number of the transferred bytes (= length
).readBytes
in class WrappedCompositeByteBuf
dstIndex
- the first index of the destinationlength
- the number of bytes to transferpublic CompositeByteBuf readBytes(byte[] dst)
ByteBuf
readerIndex
and increases the readerIndex
by the number of the transferred bytes (= dst.length
).readBytes
in class WrappedCompositeByteBuf
public CompositeByteBuf readBytes(byte[] dst, int dstIndex, int length)
ByteBuf
readerIndex
and increases the readerIndex
by the number of the transferred bytes (= length
).readBytes
in class WrappedCompositeByteBuf
dstIndex
- the first index of the destinationlength
- the number of bytes to transferpublic CompositeByteBuf readBytes(java.nio.ByteBuffer dst)
ByteBuf
readerIndex
until the destination's position
reaches its limit, and increases the readerIndex
by the
number of the transferred bytes.readBytes
in class WrappedCompositeByteBuf
public CompositeByteBuf readBytes(java.io.OutputStream out, int length) throws java.io.IOException
ByteBuf
readerIndex
.readBytes
in class WrappedCompositeByteBuf
length
- the number of bytes to transferjava.io.IOException
- if the specified stream threw an exception during I/Opublic int readBytes(java.nio.channels.GatheringByteChannel out, int length) throws java.io.IOException
ByteBuf
readerIndex
.readBytes
in class WrappedCompositeByteBuf
length
- the maximum number of bytes to transferjava.io.IOException
- if the specified channel threw an exception during I/Opublic CompositeByteBuf skipBytes(int length)
ByteBuf
readerIndex
by the specified
length
in this buffer.skipBytes
in class WrappedCompositeByteBuf
public CompositeByteBuf writeBoolean(boolean value)
ByteBuf
writerIndex
and increases the writerIndex
by 1
in this buffer.writeBoolean
in class WrappedCompositeByteBuf
public CompositeByteBuf writeByte(int value)
ByteBuf
writerIndex
and increases the writerIndex
by 1
in this buffer.
The 24 high-order bits of the specified value are ignored.writeByte
in class WrappedCompositeByteBuf
public CompositeByteBuf writeShort(int value)
ByteBuf
writerIndex
and increases the writerIndex
by 2
in this buffer. The 16 high-order bits of the specified value are ignored.writeShort
in class WrappedCompositeByteBuf
public CompositeByteBuf writeMedium(int value)
ByteBuf
writerIndex
and increases the writerIndex
by 3
in this buffer.writeMedium
in class WrappedCompositeByteBuf
public CompositeByteBuf writeInt(int value)
ByteBuf
writerIndex
and increases the writerIndex
by 4
in this buffer.writeInt
in class WrappedCompositeByteBuf
public CompositeByteBuf writeLong(long value)
ByteBuf
writerIndex
and increases the writerIndex
by 8
in this buffer.writeLong
in class WrappedCompositeByteBuf
public CompositeByteBuf writeChar(int value)
ByteBuf
writerIndex
and increases the writerIndex
by 2
in this buffer. The 16 high-order bits of the specified value are ignored.writeChar
in class WrappedCompositeByteBuf
public CompositeByteBuf writeFloat(float value)
ByteBuf
writerIndex
and increases the writerIndex
by 4
in this buffer.writeFloat
in class WrappedCompositeByteBuf
public CompositeByteBuf writeDouble(double value)
ByteBuf
writerIndex
and increases the writerIndex
by 8
in this buffer.writeDouble
in class WrappedCompositeByteBuf
public CompositeByteBuf writeBytes(ByteBuf src)
ByteBuf
writerIndex
until the source buffer becomes
unreadable, and increases the writerIndex
by the number of
the transferred bytes. This method is basically same with
ByteBuf.writeBytes(ByteBuf, int, int)
, except that this method
increases the readerIndex
of the source buffer by the number of
the transferred bytes while ByteBuf.writeBytes(ByteBuf, int, int)
does not.writeBytes
in class WrappedCompositeByteBuf
public CompositeByteBuf writeBytes(ByteBuf src, int length)
ByteBuf
writerIndex
and increases the writerIndex
by the number of the transferred bytes (= length
). This method
is basically same with ByteBuf.writeBytes(ByteBuf, int, int)
,
except that this method increases the readerIndex
of the source
buffer by the number of the transferred bytes (= length
) while
ByteBuf.writeBytes(ByteBuf, int, int)
does not.writeBytes
in class WrappedCompositeByteBuf
length
- the number of bytes to transferpublic CompositeByteBuf writeBytes(ByteBuf src, int srcIndex, int length)
ByteBuf
writerIndex
and increases the writerIndex
by the number of the transferred bytes (= length
).writeBytes
in class WrappedCompositeByteBuf
srcIndex
- the first index of the sourcelength
- the number of bytes to transferpublic CompositeByteBuf writeBytes(byte[] src)
ByteBuf
writerIndex
and increases the writerIndex
by the number of the transferred bytes (= src.length
).writeBytes
in class WrappedCompositeByteBuf
public CompositeByteBuf writeBytes(byte[] src, int srcIndex, int length)
ByteBuf
writerIndex
and increases the writerIndex
by the number of the transferred bytes (= length
).writeBytes
in class WrappedCompositeByteBuf
srcIndex
- the first index of the sourcelength
- the number of bytes to transferpublic CompositeByteBuf writeBytes(java.nio.ByteBuffer src)
ByteBuf
writerIndex
until the source buffer's position
reaches its limit, and increases the writerIndex
by the
number of the transferred bytes.writeBytes
in class WrappedCompositeByteBuf
public int writeBytes(java.io.InputStream in, int length) throws java.io.IOException
ByteBuf
writerIndex
and increases the
writerIndex
by the number of the transferred bytes.writeBytes
in class WrappedCompositeByteBuf
length
- the number of bytes to transferjava.io.IOException
- if the specified stream threw an exception during I/Opublic int writeBytes(java.nio.channels.ScatteringByteChannel in, int length) throws java.io.IOException
ByteBuf
writerIndex
and increases the
writerIndex
by the number of the transferred bytes.writeBytes
in class WrappedCompositeByteBuf
length
- the maximum number of bytes to transferjava.io.IOException
- if the specified channel threw an exception during I/Opublic CompositeByteBuf writeZero(int length)
ByteBuf
writerIndex
and increases the writerIndex
by the
specified length
.writeZero
in class WrappedCompositeByteBuf
length
- the number of NULs to write to the bufferpublic int indexOf(int fromIndex, int toIndex, byte value)
ByteBuf
value
in this
buffer. The search takes place from the specified fromIndex
(inclusive) to the specified toIndex
(exclusive).
If fromIndex
is greater than toIndex
, the search is
performed in a reversed order.
This method does not modify readerIndex
or writerIndex
of
this buffer.
indexOf
in class WrappedCompositeByteBuf
-1
otherwise.public int bytesBefore(byte value)
ByteBuf
value
in this
buffer. The search takes place from the current readerIndex
(inclusive) to the current writerIndex
(exclusive).
This method does not modify readerIndex
or writerIndex
of
this buffer.
bytesBefore
in class WrappedCompositeByteBuf
readerIndex
and the first occurrence if found. -1
otherwise.public int bytesBefore(int length, byte value)
ByteBuf
value
in this
buffer. The search starts from the current readerIndex
(inclusive) and lasts for the specified length
.
This method does not modify readerIndex
or writerIndex
of
this buffer.
bytesBefore
in class WrappedCompositeByteBuf
readerIndex
and the first occurrence if found. -1
otherwise.public int bytesBefore(int index, int length, byte value)
ByteBuf
value
in this
buffer. The search starts from the specified index
(inclusive)
and lasts for the specified length
.
This method does not modify readerIndex
or writerIndex
of
this buffer.
bytesBefore
in class WrappedCompositeByteBuf
index
and the first occurrence if found. -1
otherwise.public int forEachByte(ByteBufProcessor processor)
ByteBuf
processor
in ascending order.forEachByte
in class WrappedCompositeByteBuf
-1
if the processor iterated to or beyond the end of the readable bytes.
The last-visited index If the ByteBufProcessor.process(byte)
returned false
.public int forEachByte(int index, int length, ByteBufProcessor processor)
ByteBuf
processor
in ascending order.
(i.e. index
, (index + 1)
, .. (index + length - 1)
)forEachByte
in class WrappedCompositeByteBuf
-1
if the processor iterated to or beyond the end of the specified area.
The last-visited index If the ByteBufProcessor.process(byte)
returned false
.public int forEachByteDesc(ByteBufProcessor processor)
ByteBuf
processor
in descending order.forEachByteDesc
in class WrappedCompositeByteBuf
-1
if the processor iterated to or beyond the beginning of the readable bytes.
The last-visited index If the ByteBufProcessor.process(byte)
returned false
.public int forEachByteDesc(int index, int length, ByteBufProcessor processor)
ByteBuf
processor
in descending order.
(i.e. (index + length - 1)
, (index + length - 2)
, ... index
)forEachByteDesc
in class WrappedCompositeByteBuf
-1
if the processor iterated to or beyond the beginning of the specified area.
The last-visited index If the ByteBufProcessor.process(byte)
returned false
.public ByteBuf copy()
ByteBuf
buf.copy(buf.readerIndex(), buf.readableBytes())
.
This method does not modify readerIndex
or writerIndex
of
this buffer.copy
in class WrappedCompositeByteBuf
public ByteBuf copy(int index, int length)
ByteBuf
readerIndex
or writerIndex
of
this buffer.copy
in class WrappedCompositeByteBuf
public int nioBufferCount()
ByteBuf
ByteBuffer
s that consist this buffer. Note that ByteBuf.nioBuffers()
or ByteBuf.nioBuffers(int, int)
might return a less number of ByteBuffer
s.nioBufferCount
in class WrappedCompositeByteBuf
-1
if this buffer has no underlying ByteBuffer
.
the number of the underlying ByteBuffer
s if this buffer has at least one underlying
ByteBuffer
. Note that this method does not return 0
to avoid confusion.ByteBuf.nioBuffer()
,
ByteBuf.nioBuffer(int, int)
,
ByteBuf.nioBuffers()
,
ByteBuf.nioBuffers(int, int)
public java.nio.ByteBuffer nioBuffer()
ByteBuf
ByteBuffer
. The returned buffer
shares the content with this buffer, while changing the position and limit of the returned
NIO buffer does not affect the indexes and marks of this buffer. This method is identical
to buf.nioBuffer(buf.readerIndex(), buf.readableBytes())
. This method does not
modify readerIndex
or writerIndex
of this buffer. Please note that the
returned NIO buffer will not see the changes of this buffer if this buffer is a dynamic
buffer and it adjusted its capacity.nioBuffer
in class WrappedCompositeByteBuf
ByteBuf.nioBufferCount()
,
ByteBuf.nioBuffers()
,
ByteBuf.nioBuffers(int, int)
public java.nio.ByteBuffer nioBuffer(int index, int length)
ByteBuf
ByteBuffer
. The returned buffer
shares the content with this buffer, while changing the position and limit of the returned
NIO buffer does not affect the indexes and marks of this buffer. This method does not
modify readerIndex
or writerIndex
of this buffer. Please note that the
returned NIO buffer will not see the changes of this buffer if this buffer is a dynamic
buffer and it adjusted its capacity.nioBuffer
in class WrappedCompositeByteBuf
ByteBuf.nioBufferCount()
,
ByteBuf.nioBuffers()
,
ByteBuf.nioBuffers(int, int)
public java.nio.ByteBuffer[] nioBuffers()
ByteBuf
ByteBuffer
's. The returned buffer
shares the content with this buffer, while changing the position and limit of the returned
NIO buffer does not affect the indexes and marks of this buffer. This method does not
modify readerIndex
or writerIndex
of this buffer. Please note that the
returned NIO buffer will not see the changes of this buffer if this buffer is a dynamic
buffer and it adjusted its capacity.nioBuffers
in class WrappedCompositeByteBuf
ByteBuf.nioBufferCount()
,
ByteBuf.nioBuffer()
,
ByteBuf.nioBuffer(int, int)
public java.nio.ByteBuffer[] nioBuffers(int index, int length)
ByteBuf
ByteBuffer
's for the specified index and length
The returned buffer shares the content with this buffer, while changing the position and limit
of the returned NIO buffer does not affect the indexes and marks of this buffer. This method does
not modify readerIndex
or writerIndex
of this buffer. Please note that the
returned NIO buffer will not see the changes of this buffer if this buffer is a dynamic
buffer and it adjusted its capacity.nioBuffers
in class WrappedCompositeByteBuf
ByteBuf.nioBufferCount()
,
ByteBuf.nioBuffer()
,
ByteBuf.nioBuffer(int, int)
public java.nio.ByteBuffer internalNioBuffer(int index, int length)
ByteBuf
internalNioBuffer
in class WrappedCompositeByteBuf
public java.lang.String toString(java.nio.charset.Charset charset)
ByteBuf
buf.toString(buf.readerIndex(), buf.readableBytes(), charsetName)
.
This method does not modify readerIndex
or writerIndex
of
this buffer.toString
in class WrappedCompositeByteBuf
public java.lang.String toString(int index, int length, java.nio.charset.Charset charset)
ByteBuf
readerIndex
or
writerIndex
of this buffer.toString
in class WrappedCompositeByteBuf
public CompositeByteBuf capacity(int newCapacity)
ByteBuf
newCapacity
is less than the current
capacity, the content of this buffer is truncated. If the newCapacity
is greater
than the current capacity, the buffer is appended with unspecified data whose length is
(newCapacity - currentCapacity)
.capacity
in class WrappedCompositeByteBuf
public CompositeByteBuf addComponent(ByteBuf buffer)
CompositeByteBuf
ByteBuf
.
Be aware that this method does not increase the writerIndex
of the CompositeByteBuf
.
If you need to have it increased use CompositeByteBuf.addComponent(boolean, ByteBuf)
.
ReferenceCounted.release()
ownership of buffer
is transfered to this CompositeByteBuf
.
addComponent
in class WrappedCompositeByteBuf
buffer
- the ByteBuf
to add. ReferenceCounted.release()
ownership is transfered to this
CompositeByteBuf
.public CompositeByteBuf addComponents(ByteBuf... buffers)
CompositeByteBuf
ByteBuf
s.
Be aware that this method does not increase the writerIndex
of the CompositeByteBuf
.
If you need to have it increased use CompositeByteBuf.addComponents(boolean, ByteBuf[])
.
ReferenceCounted.release()
ownership of all ByteBuf
objects in buffers
is transfered to this
CompositeByteBuf
.
addComponents
in class WrappedCompositeByteBuf
buffers
- the ByteBuf
s to add. ReferenceCounted.release()
ownership of all ReferenceCounted.release()
ownership of all ByteBuf
objects is transfered to this CompositeByteBuf
.public CompositeByteBuf addComponents(java.lang.Iterable<ByteBuf> buffers)
CompositeByteBuf
ByteBuf
s.
Be aware that this method does not increase the writerIndex
of the CompositeByteBuf
.
If you need to have it increased use CompositeByteBuf.addComponents(boolean, Iterable)
.
ReferenceCounted.release()
ownership of all ByteBuf
objects in buffers
is transfered to this
CompositeByteBuf
.
addComponents
in class WrappedCompositeByteBuf
buffers
- the ByteBuf
s to add. ReferenceCounted.release()
ownership of all ReferenceCounted.release()
ownership of all ByteBuf
objects is transfered to this CompositeByteBuf
.public CompositeByteBuf addComponent(int cIndex, ByteBuf buffer)
CompositeByteBuf
ByteBuf
on the specific index.
Be aware that this method does not increase the writerIndex
of the CompositeByteBuf
.
If you need to have it increased use CompositeByteBuf.addComponent(boolean, int, ByteBuf)
.
ReferenceCounted.release()
ownership of buffer
is transfered to this CompositeByteBuf
.
addComponent
in class WrappedCompositeByteBuf
cIndex
- the index on which the ByteBuf
will be added.buffer
- the ByteBuf
to add. ReferenceCounted.release()
ownership is transfered to this
CompositeByteBuf
.public CompositeByteBuf addComponents(int cIndex, ByteBuf... buffers)
CompositeByteBuf
ByteBuf
s on the specific index
Be aware that this method does not increase the writerIndex
of the CompositeByteBuf
.
If you need to have it increased you need to handle it by your own.
ReferenceCounted.release()
ownership of all ByteBuf
objects in buffers
is transfered to this
CompositeByteBuf
.
addComponents
in class WrappedCompositeByteBuf
cIndex
- the index on which the ByteBuf
will be added. ReferenceCounted.release()
ownership of all
ReferenceCounted.release()
ownership of all ByteBuf
objects is transfered to this
CompositeByteBuf
.buffers
- the ByteBuf
s to add. ReferenceCounted.release()
ownership of all ReferenceCounted.release()
ownership of all ByteBuf
objects is transfered to this CompositeByteBuf
.public CompositeByteBuf addComponents(int cIndex, java.lang.Iterable<ByteBuf> buffers)
CompositeByteBuf
ByteBuf
s on the specific index
Be aware that this method does not increase the writerIndex
of the CompositeByteBuf
.
If you need to have it increased you need to handle it by your own.
ReferenceCounted.release()
ownership of all ByteBuf
objects in buffers
is transfered to this
CompositeByteBuf
.
addComponents
in class WrappedCompositeByteBuf
cIndex
- the index on which the ByteBuf
will be added.buffers
- the ByteBuf
s to add. ReferenceCounted.release()
ownership of all
ReferenceCounted.release()
ownership of all ByteBuf
objects is transfered to this
CompositeByteBuf
.public CompositeByteBuf addComponent(boolean increaseWriterIndex, ByteBuf buffer)
CompositeByteBuf
ByteBuf
and increase the writerIndex
if increaseWriterIndex
is
true
.
ReferenceCounted.release()
ownership of buffer
is transfered to this CompositeByteBuf
.addComponent
in class WrappedCompositeByteBuf
buffer
- the ByteBuf
to add. ReferenceCounted.release()
ownership is transfered to this
CompositeByteBuf
.public CompositeByteBuf addComponents(boolean increaseWriterIndex, ByteBuf... buffers)
CompositeByteBuf
ByteBuf
s and increase the writerIndex
if increaseWriterIndex
is
true
.
ReferenceCounted.release()
ownership of all ByteBuf
objects in buffers
is transfered to this
CompositeByteBuf
.addComponents
in class WrappedCompositeByteBuf
buffers
- the ByteBuf
s to add. ReferenceCounted.release()
ownership of all ReferenceCounted.release()
ownership of all ByteBuf
objects is transfered to this CompositeByteBuf
.public CompositeByteBuf addComponents(boolean increaseWriterIndex, java.lang.Iterable<ByteBuf> buffers)
CompositeByteBuf
ByteBuf
s and increase the writerIndex
if increaseWriterIndex
is
true
.
ReferenceCounted.release()
ownership of all ByteBuf
objects in buffers
is transfered to this
CompositeByteBuf
.addComponents
in class WrappedCompositeByteBuf
buffers
- the ByteBuf
s to add. ReferenceCounted.release()
ownership of all ReferenceCounted.release()
ownership of all ByteBuf
objects is transfered to this CompositeByteBuf
.public CompositeByteBuf addComponent(boolean increaseWriterIndex, int cIndex, ByteBuf buffer)
CompositeByteBuf
ByteBuf
on the specific index and increase the writerIndex
if increaseWriterIndex
is true
.
ReferenceCounted.release()
ownership of buffer
is transfered to this CompositeByteBuf
.addComponent
in class WrappedCompositeByteBuf
cIndex
- the index on which the ByteBuf
will be added.buffer
- the ByteBuf
to add. ReferenceCounted.release()
ownership is transfered to this
CompositeByteBuf
.public CompositeByteBuf removeComponent(int cIndex)
CompositeByteBuf
ByteBuf
from the given index.removeComponent
in class WrappedCompositeByteBuf
cIndex
- the index on from which the ByteBuf
will be removepublic CompositeByteBuf removeComponents(int cIndex, int numComponents)
CompositeByteBuf
ByteBuf
s starting from the given index.removeComponents
in class WrappedCompositeByteBuf
cIndex
- the index on which the ByteBuf
s will be started to removednumComponents
- the number of components to removepublic java.util.Iterator<ByteBuf> iterator()
iterator
in interface java.lang.Iterable<ByteBuf>
iterator
in class WrappedCompositeByteBuf
public java.util.List<ByteBuf> decompose(int offset, int length)
CompositeByteBuf
AbstractByteBuf.slice(int, int)
except that this method returns a list.decompose
in class WrappedCompositeByteBuf
public CompositeByteBuf consolidate()
CompositeByteBuf
ByteBuf
sconsolidate
in class WrappedCompositeByteBuf
public CompositeByteBuf discardReadComponents()
CompositeByteBuf
ByteBuf
s which are read.discardReadComponents
in class WrappedCompositeByteBuf
public CompositeByteBuf consolidate(int cIndex, int numComponents)
CompositeByteBuf
ByteBuf
sconsolidate
in class WrappedCompositeByteBuf
cIndex
- the index on which to start to composenumComponents
- the number of components to composepublic CompositeByteBuf retain()
ReferenceCounted
1
.retain
in interface ReferenceCounted
retain
in class WrappedCompositeByteBuf
public CompositeByteBuf retain(int increment)
ReferenceCounted
increment
.retain
in interface ReferenceCounted
retain
in class WrappedCompositeByteBuf
public boolean release()
ReferenceCounted
1
and deallocates this object if the reference count reaches at
0
.release
in interface ReferenceCounted
release
in class WrappedCompositeByteBuf
true
if and only if the reference count became 0
and this object has been deallocatedpublic boolean release(int decrement)
ReferenceCounted
decrement
and deallocates this object if the reference
count reaches at 0
.release
in interface ReferenceCounted
release
in class WrappedCompositeByteBuf
true
if and only if the reference count became 0
and this object has been deallocated