public interface CompositeByteBuf extends ByteBuf, Iterable<ByteBuf>
Modifier and Type | Method and Description |
---|---|
CompositeByteBuf |
addComponent(ByteBuf buffer)
Add the given
ByteBuf . |
CompositeByteBuf |
addComponent(int cIndex,
ByteBuf buffer)
Add the given
ByteBuf on the specific index. |
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,
Iterable<ByteBuf> buffers)
Add the given
ByteBuf s on the specific index |
CompositeByteBuf |
addComponents(Iterable<ByteBuf> buffers)
Add the given
ByteBuf s. |
CompositeByteBuf |
capacity(int newCapacity)
Adjusts the capacity of this buffer.
|
CompositeByteBuf |
clear()
Sets the
readerIndex and writerIndex of this buffer to
0 . |
ByteBuf |
component(int cIndex)
Return the
ByteBuf on the specified index |
ByteBuf |
componentAtOffset(int offset)
Return the
ByteBuf on the specified index |
CompositeByteBuf |
consolidate()
Consolidate the composed
ByteBuf s |
CompositeByteBuf |
consolidate(int cIndex,
int numComponents)
Consolidate the composed
ByteBuf s |
List<ByteBuf> |
decompose(int offset,
int length)
Same with
ByteBuf.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. |
CompositeByteBuf |
ensureWritable(int minWritableBytes)
Makes sure the number of the writable bytes
is equal to or greater than the specified value.
|
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,
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 . |
CompositeByteBuf |
getBytes(int index,
OutputStream out,
int length)
Transfers this buffer's data to the specified stream starting at the
specified absolute
index . |
CompositeByteBuf |
markReaderIndex()
Marks the current
readerIndex in this buffer. |
CompositeByteBuf |
markWriterIndex()
Marks the current
writerIndex in this buffer. |
int |
maxNumComponents()
Return the max number of
ByteBuf 's that are composed in this instance |
int |
numComponents()
Return the current number of
ByteBuf 's that are composed in this instance |
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(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 ). |
CompositeByteBuf |
readBytes(OutputStream out,
int length)
Transfers this buffer's data to the specified stream starting at the
current
readerIndex . |
CompositeByteBuf |
readerIndex(int readerIndex)
Sets the
readerIndex of this buffer. |
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 |
resetReaderIndex()
Repositions the current
readerIndex to the marked
readerIndex in this buffer. |
CompositeByteBuf |
resetWriterIndex()
Repositions the current
writerIndex to the marked
writerIndex in this buffer. |
CompositeByteBuf |
resumeIntermediaryDeallocations()
Resumes the intermediary deallocation of the internal memory block of this buffer, suspended by
ByteBuf.suspendIntermediaryDeallocations() . |
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,
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 . |
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 |
setIndex(int readerIndex,
int writerIndex)
Sets the
readerIndex and writerIndex of this buffer
in one shot. |
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. |
CompositeByteBuf |
suspendIntermediaryDeallocations()
Suspends the intermediary deallocation of the internal memory block of this buffer until asked via
ByteBuf.resumeIntermediaryDeallocations() . |
int |
toByteIndex(int cIndex) |
int |
toComponentIndex(int offset)
Return the index for the given offset
|
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(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 ). |
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 |
writerIndex(int writerIndex)
Sets the
writerIndex of 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 . |
alloc, array, arrayOffset, bytesBefore, bytesBefore, bytesBefore, bytesBefore, bytesBefore, bytesBefore, capacity, compareTo, copy, copy, duplicate, ensureWritable, ensureWritableBytes, equals, getBoolean, getByte, getBytes, getChar, getDouble, getFloat, getInt, getLong, getMedium, getShort, getUnsignedByte, getUnsignedInt, getUnsignedMedium, getUnsignedShort, hasArray, hashCode, hasMemoryAddress, indexOf, indexOf, isDirect, isReadable, isWritable, maxCapacity, maxWritableBytes, memoryAddress, nioBuffer, nioBuffer, nioBufferCount, nioBuffers, nioBuffers, order, order, readable, readableBytes, readBoolean, readByte, readBytes, readBytes, readChar, readDouble, readerIndex, readFloat, readInt, readLong, readMedium, readShort, readSlice, readUnsignedByte, readUnsignedInt, readUnsignedMedium, readUnsignedShort, setBytes, setBytes, slice, slice, toString, toString, toString, unwrap, writable, writableBytes, writeBytes, writeBytes, writerIndex
isReadable, isWritable, type
refCnt, release, release
CompositeByteBuf addComponent(ByteBuf buffer)
ByteBuf
.buffer
- the ByteBuf
to addCompositeByteBuf addComponent(int cIndex, ByteBuf buffer)
ByteBuf
on the specific index.cIndex
- the index on which the ByteBuf
will be addedbuffer
- the ByteBuf
to addIndexOutOfBoundsException
- if the index is invalidCompositeByteBuf addComponents(ByteBuf... buffers)
ByteBuf
s.buffers
- the ByteBuf
s to addCompositeByteBuf addComponents(Iterable<ByteBuf> buffers)
ByteBuf
s.buffers
- the ByteBuf
s to addCompositeByteBuf addComponents(int cIndex, ByteBuf... buffers)
ByteBuf
s on the specific indexcIndex
- the index on which the ByteBuf
will be added.buffers
- the ByteBuf
s to addIndexOutOfBoundsException
- if the index is invalidCompositeByteBuf addComponents(int cIndex, Iterable<ByteBuf> buffers)
ByteBuf
s on the specific indexcIndex
- the index on which the ByteBuf
will be added.buffers
- the ByteBuf
s to addIndexOutOfBoundsException
- if the index is invalidCompositeByteBuf removeComponent(int cIndex)
ByteBuf
from the given index.cIndex
- the index on from which the ByteBuf
will be removeIndexOutOfBoundsException
- if the index is invalidCompositeByteBuf removeComponents(int cIndex, int numComponents)
ByteBuf
s starting from the given index.cIndex
- the index on which the ByteBuf
s will be started to removednumComponents
- the number of components to removeIndexOutOfBoundsException
- if the index is invalidint numComponents()
ByteBuf
's that are composed in this instanceint maxNumComponents()
ByteBuf
's that are composed in this instanceByteBuf component(int cIndex)
ByteBuf
on the specified indexcIndex
- the index for which the ByteBuf
should be returnedByteBuf
on the specified indexIndexOutOfBoundsException
- if the index is invalidByteBuf componentAtOffset(int offset)
ByteBuf
on the specified indexoffset
- the offset for which the ByteBuf
should be returnedByteBuf
on the specified indexIndexOutOfBoundsException
- if the offset is invalidCompositeByteBuf discardReadComponents()
ByteBuf
s which are read.CompositeByteBuf consolidate()
ByteBuf
sCompositeByteBuf consolidate(int cIndex, int numComponents)
ByteBuf
scIndex
- the index on which to start to composenumComponents
- the number of components to composeIndexOutOfBoundsException
- if the offset is invalidint toComponentIndex(int offset)
int toByteIndex(int cIndex)
List<ByteBuf> decompose(int offset, int length)
ByteBuf.slice(int, int)
except that this method returns a list.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)
.CompositeByteBuf readerIndex(int readerIndex)
ByteBuf
readerIndex
of this buffer.readerIndex
in interface ByteBuf
CompositeByteBuf writerIndex(int writerIndex)
ByteBuf
writerIndex
of this buffer.writerIndex
in interface ByteBuf
CompositeByteBuf setIndex(int readerIndex, int writerIndex)
ByteBuf
readerIndex
and writerIndex
of this buffer
in one shot. This method is useful when you have to worry about the
invocation order of ByteBuf.readerIndex(int)
and ByteBuf.writerIndex(int)
methods. For example, the following code will fail:
// Create a buffer whose readerIndex, writerIndex and capacity are // 0, 0 and 8 respectively.The following code will also fail:ByteBuf
buf =Unpooled
.buffer(8); // IndexOutOfBoundsException is thrown because the specified // readerIndex (2) cannot be greater than the current writerIndex (0). buf.readerIndex(2); buf.writerIndex(4);
// Create a buffer whose readerIndex, writerIndex and capacity are // 0, 8 and 8 respectively.By contrast, this method guarantees that it never throws anByteBuf
buf =Unpooled
.wrappedBuffer(new byte[8]); // readerIndex becomes 8. buf.readLong(); // IndexOutOfBoundsException is thrown because the specified // writerIndex (4) cannot be less than the current readerIndex (8). buf.writerIndex(4); buf.readerIndex(2);
IndexOutOfBoundsException
as long as the specified
indexes meet basic constraints, regardless what the current index
values of the buffer are:
// No matter what the current state of the buffer is, the following // call always succeeds as long as the capacity of the buffer is not // less than 4. buf.setIndex(2, 4);
CompositeByteBuf clear()
ByteBuf
readerIndex
and writerIndex
of this buffer to
0
.
This method is identical to setIndex(0, 0)
.
Please note that the behavior of this method is different
from that of NIO buffer, which sets the limit
to
the capacity
of the buffer.
CompositeByteBuf markReaderIndex()
ByteBuf
readerIndex
in this buffer. You can
reposition the current readerIndex
to the marked
readerIndex
by calling ByteBuf.resetReaderIndex()
.
The initial value of the marked readerIndex
is 0
.markReaderIndex
in interface ByteBuf
CompositeByteBuf resetReaderIndex()
ByteBuf
readerIndex
to the marked
readerIndex
in this buffer.resetReaderIndex
in interface ByteBuf
CompositeByteBuf markWriterIndex()
ByteBuf
writerIndex
in this buffer. You can
reposition the current writerIndex
to the marked
writerIndex
by calling ByteBuf.resetWriterIndex()
.
The initial value of the marked writerIndex
is 0
.markWriterIndex
in interface ByteBuf
CompositeByteBuf resetWriterIndex()
ByteBuf
writerIndex
to the marked
writerIndex
in this buffer.resetWriterIndex
in interface ByteBuf
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 interface ByteBuf
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 interface ByteBuf
CompositeByteBuf ensureWritable(int minWritableBytes)
ByteBuf
IllegalArgumentException
.ensureWritable
in interface ByteBuf
minWritableBytes
- the expected minimum number of writable bytesCompositeByteBuf 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
).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
).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.CompositeByteBuf getBytes(int index, byte[] dst)
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of
this bufferCompositeByteBuf getBytes(int index, byte[] dst, int dstIndex, int length)
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of this buffer.CompositeByteBuf getBytes(int index, 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.CompositeByteBuf getBytes(int index, OutputStream out, int length) throws IOException
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of
this buffer.getBytes
in interface ByteBuf
length
- the number of bytes to transferIOException
- if the specified stream threw an exception during I/OCompositeByteBuf setBoolean(int index, boolean value)
ByteBuf
index
in this
buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.setBoolean
in interface ByteBuf
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.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.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.CompositeByteBuf setInt(int index, int value)
ByteBuf
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.CompositeByteBuf setLong(int index, long value)
ByteBuf
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.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.CompositeByteBuf setFloat(int index, float value)
ByteBuf
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.CompositeByteBuf setDouble(int index, double value)
ByteBuf
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.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
).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
).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.CompositeByteBuf setBytes(int index, byte[] src)
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of
this buffer.CompositeByteBuf setBytes(int index, byte[] src, int srcIndex, int length)
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of
this buffer.CompositeByteBuf setBytes(int index, ByteBuffer src)
ByteBuf
index
until the source buffer's position
reaches its limit.
This method does not modify readerIndex
or writerIndex
of
this buffer.CompositeByteBuf setZero(int index, int length)
ByteBuf
index
.
This method does not modify readerIndex
or writerIndex
of
this buffer.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.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.CompositeByteBuf readBytes(ByteBuf dst, int dstIndex, int length)
ByteBuf
readerIndex
and increases the readerIndex
by the number of the transferred bytes (= length
).CompositeByteBuf readBytes(byte[] dst)
ByteBuf
readerIndex
and increases the readerIndex
by the number of the transferred bytes (= dst.length
).CompositeByteBuf readBytes(byte[] dst, int dstIndex, int length)
ByteBuf
readerIndex
and increases the readerIndex
by the number of the transferred bytes (= length
).CompositeByteBuf readBytes(ByteBuffer dst)
ByteBuf
readerIndex
until the destination's position
reaches its limit, and increases the readerIndex
by the
number of the transferred bytes.CompositeByteBuf readBytes(OutputStream out, int length) throws IOException
ByteBuf
readerIndex
.readBytes
in interface ByteBuf
length
- the number of bytes to transferIOException
- if the specified stream threw an exception during I/OCompositeByteBuf skipBytes(int length)
ByteBuf
readerIndex
by the specified
length
in this buffer.CompositeByteBuf writeBoolean(boolean value)
ByteBuf
writerIndex
and increases the writerIndex
by 1
in this buffer.writeBoolean
in interface ByteBuf
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.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 interface ByteBuf
CompositeByteBuf writeMedium(int value)
ByteBuf
writerIndex
and increases the writerIndex
by 3
in this buffer.writeMedium
in interface ByteBuf
CompositeByteBuf writeInt(int value)
ByteBuf
writerIndex
and increases the writerIndex
by 4
in this buffer.CompositeByteBuf writeLong(long value)
ByteBuf
writerIndex
and increases the writerIndex
by 8
in this buffer.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.CompositeByteBuf writeFloat(float value)
ByteBuf
writerIndex
and increases the writerIndex
by 4
in this buffer.writeFloat
in interface ByteBuf
CompositeByteBuf writeDouble(double value)
ByteBuf
writerIndex
and increases the writerIndex
by 8
in this buffer.writeDouble
in interface ByteBuf
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 interface ByteBuf
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 interface ByteBuf
length
- the number of bytes to transferCompositeByteBuf writeBytes(ByteBuf src, int srcIndex, int length)
ByteBuf
writerIndex
and increases the writerIndex
by the number of the transferred bytes (= length
).writeBytes
in interface ByteBuf
srcIndex
- the first index of the sourcelength
- the number of bytes to transferCompositeByteBuf writeBytes(byte[] src)
ByteBuf
writerIndex
and increases the writerIndex
by the number of the transferred bytes (= src.length
).writeBytes
in interface ByteBuf
CompositeByteBuf writeBytes(byte[] src, int srcIndex, int length)
ByteBuf
writerIndex
and increases the writerIndex
by the number of the transferred bytes (= length
).writeBytes
in interface ByteBuf
srcIndex
- the first index of the sourcelength
- the number of bytes to transferCompositeByteBuf writeBytes(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 interface ByteBuf
CompositeByteBuf writeZero(int length)
ByteBuf
writerIndex
and increases the writerIndex
by the
specified length
.CompositeByteBuf suspendIntermediaryDeallocations()
ByteBuf
ByteBuf.resumeIntermediaryDeallocations()
. An intermediary deallocation is usually made when the capacity of
a buffer changes.suspendIntermediaryDeallocations
in interface ByteBuf
CompositeByteBuf resumeIntermediaryDeallocations()
ByteBuf
ByteBuf.suspendIntermediaryDeallocations()
.resumeIntermediaryDeallocations
in interface ByteBuf
CompositeByteBuf retain(int increment)
ReferenceCounted
increment
.CompositeByteBuf retain()
ReferenceCounted
1
.Copyright © 2008-2013 The Netty Project. All Rights Reserved.