Package io.servicetalk.buffer.api
Interface CompositeBuffer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default CompositeBuffer
addBuffer(Buffer buffer)
Add the givenBuffer
to this buffer and increment the writerIndex.CompositeBuffer
addBuffer(Buffer buffer, boolean incrementWriterIndex)
Add the givenBuffer
to this buffer.CompositeBuffer
capacity(int newCapacity)
Sets the capacity of this buffer.CompositeBuffer
clear()
Sets thereaderIndex
andwriterIndex
of this buffer to0
.CompositeBuffer
consolidate()
Consolidate the composedBuffer
s.CompositeBuffer
consolidate(int index, int count)
Consolidate the composedBuffer
s.CompositeBuffer
discardSomeReadBytes()
Discard allBuffer
s which have been read.CompositeBuffer
getBytes(int index, byte[] dst)
Transfers this buffer's data to the specified destination starting at the specified absoluteindex
.CompositeBuffer
getBytes(int index, byte[] dst, int dstIndex, int length)
Transfers this buffer's data to the specified destination starting at the specified absoluteindex
.CompositeBuffer
getBytes(int index, Buffer dst)
Transfers this buffer's data to the specified destination starting at the specified absoluteindex
until the destination becomes non-writable.CompositeBuffer
getBytes(int index, Buffer dst, int length)
Transfers this buffer's data to the specified destination starting at the specified absoluteindex
.CompositeBuffer
getBytes(int index, Buffer dst, int dstIndex, int length)
Transfers this buffer's data to the specified destination starting at the specified absoluteindex
.CompositeBuffer
getBytes(int index, java.nio.ByteBuffer dst)
Transfers this buffer's data to the specified destination starting at the specified absoluteindex
until the destination's position reaches its limit.CompositeBuffer
readerIndex(int readerIndex)
Sets thereaderIndex
of this buffer.CompositeBuffer
setBoolean(int index, boolean value)
Sets the specified boolean at the specified absoluteindex
in this buffer.CompositeBuffer
setByte(int index, int value)
Sets the specified byte at the specified absoluteindex
in this buffer.CompositeBuffer
setBytes(int index, byte[] src)
Transfers the specified source array's data to this buffer starting at the specified absoluteindex
.CompositeBuffer
setBytes(int index, byte[] src, int srcIndex, int length)
Transfers the specified source array's data to this buffer starting at the specified absoluteindex
.CompositeBuffer
setBytes(int index, Buffer src)
Transfers the specified source buffer's data to this buffer starting at the specified absoluteindex
until the source buffer becomes unreadable.CompositeBuffer
setBytes(int index, Buffer src, int length)
Transfers the specified source buffer's data to this buffer starting at the specified absoluteindex
.CompositeBuffer
setBytes(int index, Buffer src, int srcIndex, int length)
Transfers the specified source buffer's data to this buffer starting at the specified absoluteindex
.CompositeBuffer
setBytes(int index, java.nio.ByteBuffer src)
Transfers the specified source buffer's data to this buffer starting at the specified absoluteindex
until the source buffer's position reaches its limit.CompositeBuffer
setChar(int index, int value)
Sets the specified 2-byte UTF-16 character at the specified absoluteindex
in this buffer.CompositeBuffer
setDouble(int index, double value)
Sets the specified 64-bit floating-point number at the specified absoluteindex
in this buffer.CompositeBuffer
setFloat(int index, float value)
Sets the specified 32-bit floating-point number at the specified absoluteindex
in this buffer.CompositeBuffer
setInt(int index, int value)
Sets the specified 32-bit integer at the specified absoluteindex
in this buffer.CompositeBuffer
setIntLE(int index, int value)
Sets the specified 32-bit integer at the specified absoluteindex
in this buffer with Little Endian byte order .CompositeBuffer
setLong(int index, long value)
Sets the specified 64-bit long integer at the specified absoluteindex
in this buffer.CompositeBuffer
setLongLE(int index, long value)
Sets the specified 64-bit long integer at the specified absoluteindex
in this buffer in Little Endian Byte Order.CompositeBuffer
setMedium(int index, int value)
Sets the specified 24-bit medium integer at the specified absoluteindex
in this buffer.CompositeBuffer
setMediumLE(int index, int value)
Sets the specified 24-bit medium integer at the specified absoluteindex
in this buffer in the Little Endian Byte Order.CompositeBuffer
setShort(int index, int value)
Sets the specified 16-bit short integer at the specified absoluteindex
in this buffer.CompositeBuffer
setShortLE(int index, int value)
Sets the specified 16-bit short integer at the specified absoluteindex
in this buffer with the Little Endian Byte Order.CompositeBuffer
skipBytes(int length)
Increases the currentreaderIndex
by the specifiedlength
in this buffer.CompositeBuffer
writeAscii(java.lang.CharSequence seq)
Encode aCharSequence
in ASCII and write it to this buffer starting atwriterIndex
and increases thewriterIndex
by the number of the transferred bytes.CompositeBuffer
writeBoolean(boolean value)
Sets the specified boolean at the currentwriterIndex
and increases thewriterIndex
by1
in this buffer.CompositeBuffer
writeByte(int value)
Sets the specified byte at the currentwriterIndex
and increases thewriterIndex
by1
in this buffer.CompositeBuffer
writeBytes(byte[] src)
Transfers the specified source array's data to this buffer starting at the currentwriterIndex
and increases thewriterIndex
by the number of the transferred bytes (=src.length
).CompositeBuffer
writeBytes(byte[] src, int srcIndex, int length)
Transfers the specified source array's data to this buffer starting at the currentwriterIndex
and increases thewriterIndex
by the number of the transferred bytes (=length
).CompositeBuffer
writeBytes(Buffer src)
Transfers the specified source buffer's data to this buffer starting at the currentwriterIndex
until the source buffer becomes unreadable, and increases thewriterIndex
by the number of the transferred bytes.CompositeBuffer
writeBytes(Buffer src, int length)
Transfers the specified source buffer's data to this buffer starting at the currentwriterIndex
and increases thewriterIndex
by the number of the transferred bytes (=length
).CompositeBuffer
writeBytes(Buffer src, int srcIndex, int length)
Transfers the specified source buffer's data to this buffer starting at the currentwriterIndex
and increases thewriterIndex
by the number of the transferred bytes (=length
).CompositeBuffer
writeBytes(java.nio.ByteBuffer src)
Transfers the specified source buffer's data to this buffer starting at the currentwriterIndex
until the source buffer's position reaches its limit, and increases thewriterIndex
by the number of the transferred bytes.CompositeBuffer
writeChar(int value)
Sets the specified 2-byte UTF-16 character at the currentwriterIndex
and increases thewriterIndex
by2
in this buffer.CompositeBuffer
writeDouble(double value)
Sets the specified 64-bit floating point number at the currentwriterIndex
and increases thewriterIndex
by8
in this buffer.CompositeBuffer
writeFloat(float value)
Sets the specified 32-bit floating point number at the currentwriterIndex
and increases thewriterIndex
by4
in this buffer.CompositeBuffer
writeInt(int value)
Sets the specified 32-bit integer at the currentwriterIndex
and increases thewriterIndex
by4
in this buffer.CompositeBuffer
writeIntLE(int value)
Sets the specified 32-bit integer at the currentwriterIndex
in the Little Endian Byte Order and increases thewriterIndex
by4
in this buffer.CompositeBuffer
writeLong(long value)
Sets the specified 64-bit long integer at the currentwriterIndex
and increases thewriterIndex
by8
in this buffer.CompositeBuffer
writeLongLE(long value)
Sets the specified 64-bit long integer at the currentwriterIndex
in the Little Endian Byte Order and increases thewriterIndex
by8
in this buffer.CompositeBuffer
writeMedium(int value)
Sets the specified 24-bit medium integer at the currentwriterIndex
and increases thewriterIndex
by3
in this buffer.CompositeBuffer
writeMediumLE(int value)
Sets the specified 24-bit medium integer at the currentwriterIndex
in the Little Endian Byte Order and increases thewriterIndex
by3
in this buffer.CompositeBuffer
writerIndex(int writerIndex)
Sets thewriterIndex
of this buffer.CompositeBuffer
writeShort(int value)
Sets the specified 16-bit short integer at the currentwriterIndex
and increases thewriterIndex
by2
in this buffer.CompositeBuffer
writeShortLE(int value)
Sets the specified 16-bit short integer in the Little Endian Byte Order at the currentwriterIndex
and increases thewriterIndex
by2
in this buffer.CompositeBuffer
writeUtf8(java.lang.CharSequence seq)
Encode aCharSequence
in UTF-8 and write it to this buffer starting atwriterIndex
and increases thewriterIndex
by the number of the transferred bytes.-
Methods inherited from interface io.servicetalk.buffer.api.Buffer
array, arrayOffset, asReadOnly, bytesBefore, bytesBefore, bytesBefore, capacity, copy, copy, duplicate, ensureWritable, ensureWritable, equals, forEachByte, forEachByte, forEachByteDesc, forEachByteDesc, getBoolean, getByte, getChar, getDouble, getFloat, getInt, getIntLE, getLong, getLongLE, getMedium, getMediumLE, getShort, getShortLE, getUnsignedByte, getUnsignedInt, getUnsignedIntLE, getUnsignedMedium, getUnsignedMediumLE, getUnsignedShort, getUnsignedShortLE, hasArray, hashCode, indexOf, isDirect, isReadOnly, maxCapacity, maxWritableBytes, nioBufferCount, readableBytes, readBoolean, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readDouble, readerIndex, readFloat, readInt, readIntLE, readLong, readLongLE, readMedium, readMediumLE, readShort, readShortLE, readSlice, readUnsignedByte, readUnsignedInt, readUnsignedIntLE, readUnsignedMedium, readUnsignedMediumLE, readUnsignedShort, readUnsignedShortLE, setBytes, setBytesUntilEndStream, slice, slice, toNioBuffer, toNioBuffer, toNioBuffers, toNioBuffers, toString, toString, toString, tryEnsureWritable, writableBytes, writeBytes, writeBytesUntilEndStream, writerIndex, writeUtf8
-
-
-
-
Method Detail
-
addBuffer
default CompositeBuffer addBuffer(Buffer buffer)
Add the givenBuffer
to this buffer and increment the writerIndex.- Parameters:
buffer
- the buffer to add.- Returns:
- self.
-
addBuffer
CompositeBuffer addBuffer(Buffer buffer, boolean incrementWriterIndex)
Add the givenBuffer
to this buffer.- Parameters:
buffer
- the buffer to add.incrementWriterIndex
- iftrue
the writerIndex will be increment by the number of readableBytes of the given buffer.- Returns:
- self.
-
consolidate
CompositeBuffer consolidate()
Consolidate the composedBuffer
s.- Returns:
- self.
-
consolidate
CompositeBuffer consolidate(int index, int count)
Consolidate the composedBuffer
s.- Parameters:
index
- the index on which to start to compose.count
- the number of contained buffers to compose.- Returns:
- self.
-
discardSomeReadBytes
CompositeBuffer discardSomeReadBytes()
Discard allBuffer
s which have been read.- Returns:
- self.
-
capacity
CompositeBuffer capacity(int newCapacity)
Description copied from interface:Buffer
Sets the capacity of this buffer. If thenewCapacity
is less than the current capacity, the content of this buffer is truncated. If thenewCapacity
is greater than the current capacity, the buffer is appended with unspecified data whose length is(newCapacity - currentCapacity)
.
-
readerIndex
CompositeBuffer readerIndex(int readerIndex)
Description copied from interface:Buffer
Sets thereaderIndex
of this buffer.- Specified by:
readerIndex
in interfaceBuffer
- Parameters:
readerIndex
- the new readerIndex of this buffer.- Returns:
- itself.
-
writerIndex
CompositeBuffer writerIndex(int writerIndex)
Description copied from interface:Buffer
Sets thewriterIndex
of this buffer.- Specified by:
writerIndex
in interfaceBuffer
- Parameters:
writerIndex
- the new writerIndex of this buffer.- Returns:
- itself.
-
clear
CompositeBuffer clear()
Description copied from interface:Buffer
Sets thereaderIndex
andwriterIndex
of this buffer to0
.Please note that the behavior of this method is different from that of NIO buffer, which sets the
limit
to thecapacity
of the buffer.
-
getBytes
CompositeBuffer getBytes(int index, Buffer dst)
Description copied from interface:Buffer
Transfers this buffer's data to the specified destination starting at the specified absoluteindex
until the destination becomes non-writable. This method is basically same withBuffer.getBytes(int, Buffer, int, int)
, except that this method increases thewriterIndex
of the destination by the number of the transferred bytes whileBuffer.getBytes(int, Buffer, int, int)
does not. This method does not modifyreaderIndex
orwriterIndex
of the source buffer (i.e.this
).
-
getBytes
CompositeBuffer getBytes(int index, Buffer dst, int length)
Description copied from interface:Buffer
Transfers this buffer's data to the specified destination starting at the specified absoluteindex
. This method is basically same withBuffer.getBytes(int, Buffer, int, int)
, except that this method increases thewriterIndex
of the destination by the number of the transferred bytes whileBuffer.getBytes(int, Buffer, int, int)
does not. This method does not modifyreaderIndex
orwriterIndex
of the source buffer (i.e.this
).
-
getBytes
CompositeBuffer getBytes(int index, Buffer dst, int dstIndex, int length)
Description copied from interface:Buffer
Transfers this buffer's data to the specified destination starting at the specified absoluteindex
. This method does not modifyreaderIndex
orwriterIndex
of both the source (i.e.this
) and the destination.
-
getBytes
CompositeBuffer getBytes(int index, byte[] dst)
Description copied from interface:Buffer
Transfers this buffer's data to the specified destination starting at the specified absoluteindex
. This method does not modifyreaderIndex
orwriterIndex
of this buffer
-
getBytes
CompositeBuffer getBytes(int index, byte[] dst, int dstIndex, int length)
Description copied from interface:Buffer
Transfers this buffer's data to the specified destination starting at the specified absoluteindex
. This method does not modifyreaderIndex
orwriterIndex
of this buffer.
-
getBytes
CompositeBuffer getBytes(int index, java.nio.ByteBuffer dst)
Description copied from interface:Buffer
Transfers this buffer's data to the specified destination starting at the specified absoluteindex
until the destination's position reaches its limit. This method does not modifyreaderIndex
orwriterIndex
of this buffer while the destination'sposition
will be increased.
-
setBoolean
CompositeBuffer setBoolean(int index, boolean value)
Description copied from interface:Buffer
Sets the specified boolean at the specified absoluteindex
in this buffer. This method does not modifyreaderIndex
orwriterIndex
of this buffer.- Specified by:
setBoolean
in interfaceBuffer
- Parameters:
index
- absolute (@code index) in this buffer.value
- the value.- Returns:
- itself.
-
setByte
CompositeBuffer setByte(int index, int value)
Description copied from interface:Buffer
Sets the specified byte at the specified absoluteindex
in this buffer. The 24 high-order bits of the specified value are ignored. This method does not modifyreaderIndex
orwriterIndex
of this buffer.
-
setShort
CompositeBuffer setShort(int index, int value)
Description copied from interface:Buffer
Sets the specified 16-bit short integer at the specified absoluteindex
in this buffer. The 16 high-order bits of the specified value are ignored. This method does not modifyreaderIndex
orwriterIndex
of this buffer.
-
setShortLE
CompositeBuffer setShortLE(int index, int value)
Description copied from interface:Buffer
Sets the specified 16-bit short integer at the specified absoluteindex
in this buffer with the Little Endian Byte Order. The 16 high-order bits of the specified value are ignored. This method does not modifyreaderIndex
orwriterIndex
of this buffer.- Specified by:
setShortLE
in interfaceBuffer
- Parameters:
index
- absolute (@code index) in this buffer.value
- the value.- Returns:
- itself.
-
setMedium
CompositeBuffer setMedium(int index, int value)
Description copied from interface:Buffer
Sets the specified 24-bit medium integer at the specified absoluteindex
in this buffer. Please note that the most significant byte is ignored in the specified value. This method does not modifyreaderIndex
orwriterIndex
of this buffer.
-
setMediumLE
CompositeBuffer setMediumLE(int index, int value)
Description copied from interface:Buffer
Sets the specified 24-bit medium integer at the specified absoluteindex
in this buffer in the Little Endian Byte Order. Please note that the most significant byte is ignored in the specified value. This method does not modifyreaderIndex
orwriterIndex
of this buffer.- Specified by:
setMediumLE
in interfaceBuffer
- Parameters:
index
- absolute (@code index) in this buffer.value
- the value.- Returns:
- itself.
-
setInt
CompositeBuffer setInt(int index, int value)
Description copied from interface:Buffer
Sets the specified 32-bit integer at the specified absoluteindex
in this buffer. This method does not modifyreaderIndex
orwriterIndex
of this buffer.
-
setIntLE
CompositeBuffer setIntLE(int index, int value)
Description copied from interface:Buffer
Sets the specified 32-bit integer at the specified absoluteindex
in this buffer with Little Endian byte order . This method does not modifyreaderIndex
orwriterIndex
of this buffer.
-
setLong
CompositeBuffer setLong(int index, long value)
Description copied from interface:Buffer
Sets the specified 64-bit long integer at the specified absoluteindex
in this buffer. This method does not modifyreaderIndex
orwriterIndex
of this buffer.
-
setLongLE
CompositeBuffer setLongLE(int index, long value)
Description copied from interface:Buffer
Sets the specified 64-bit long integer at the specified absoluteindex
in this buffer in Little Endian Byte Order. This method does not modifyreaderIndex
orwriterIndex
of this buffer.
-
setChar
CompositeBuffer setChar(int index, int value)
Description copied from interface:Buffer
Sets the specified 2-byte UTF-16 character at the specified absoluteindex
in this buffer. The 16 high-order bits of the specified value are ignored. This method does not modifyreaderIndex
orwriterIndex
of this buffer.
-
setFloat
CompositeBuffer setFloat(int index, float value)
Description copied from interface:Buffer
Sets the specified 32-bit floating-point number at the specified absoluteindex
in this buffer. This method does not modifyreaderIndex
orwriterIndex
of this buffer.
-
setDouble
CompositeBuffer setDouble(int index, double value)
Description copied from interface:Buffer
Sets the specified 64-bit floating-point number at the specified absoluteindex
in this buffer. This method does not modifyreaderIndex
orwriterIndex
of this buffer.
-
setBytes
CompositeBuffer setBytes(int index, Buffer src)
Description copied from interface:Buffer
Transfers the specified source buffer's data to this buffer starting at the specified absoluteindex
until the source buffer becomes unreadable. This method is basically same withBuffer.setBytes(int, Buffer, int, int)
, except that this method increases thereaderIndex
of the source buffer by the number of the transferred bytes whileBuffer.setBytes(int, Buffer, int, int)
does not. This method does not modifyreaderIndex
orwriterIndex
of the source buffer (i.e.this
).
-
setBytes
CompositeBuffer setBytes(int index, Buffer src, int length)
Description copied from interface:Buffer
Transfers the specified source buffer's data to this buffer starting at the specified absoluteindex
. This method is basically same withBuffer.setBytes(int, Buffer, int, int)
, except that this method increases thereaderIndex
of the source buffer by the number of the transferred bytes whileBuffer.setBytes(int, Buffer, int, int)
does not. This method does not modifyreaderIndex
orwriterIndex
of the source buffer (i.e.this
).
-
setBytes
CompositeBuffer setBytes(int index, Buffer src, int srcIndex, int length)
Description copied from interface:Buffer
Transfers the specified source buffer's data to this buffer starting at the specified absoluteindex
. This method does not modifyreaderIndex
orwriterIndex
of both the source (i.e.this
) and the destination.
-
setBytes
CompositeBuffer setBytes(int index, byte[] src)
Description copied from interface:Buffer
Transfers the specified source array's data to this buffer starting at the specified absoluteindex
. This method does not modifyreaderIndex
orwriterIndex
of this buffer.
-
setBytes
CompositeBuffer setBytes(int index, byte[] src, int srcIndex, int length)
Description copied from interface:Buffer
Transfers the specified source array's data to this buffer starting at the specified absoluteindex
. This method does not modifyreaderIndex
orwriterIndex
of this buffer.
-
setBytes
CompositeBuffer setBytes(int index, java.nio.ByteBuffer src)
Description copied from interface:Buffer
Transfers the specified source buffer's data to this buffer starting at the specified absoluteindex
until the source buffer's position reaches its limit. This method does not modifyreaderIndex
orwriterIndex
of this buffer.
-
skipBytes
CompositeBuffer skipBytes(int length)
Description copied from interface:Buffer
Increases the currentreaderIndex
by the specifiedlength
in this buffer.
-
writeBoolean
CompositeBuffer writeBoolean(boolean value)
Description copied from interface:Buffer
Sets the specified boolean at the currentwriterIndex
and increases thewriterIndex
by1
in this buffer. Ifthis.writableBytes
is less than1
,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Specified by:
writeBoolean
in interfaceBuffer
- Parameters:
value
- the value to write.- Returns:
- self.
-
writeByte
CompositeBuffer writeByte(int value)
Description copied from interface:Buffer
Sets the specified byte at the currentwriterIndex
and increases thewriterIndex
by1
in this buffer. The 24 high-order bits of the specified value are ignored. Ifthis.writableBytes
is less than1
,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.
-
writeShort
CompositeBuffer writeShort(int value)
Description copied from interface:Buffer
Sets the specified 16-bit short integer at the currentwriterIndex
and increases thewriterIndex
by2
in this buffer. The 16 high-order bits of the specified value are ignored. Ifthis.writableBytes
is less than2
,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Specified by:
writeShort
in interfaceBuffer
- Parameters:
value
- the value to write.- Returns:
- self.
-
writeShortLE
CompositeBuffer writeShortLE(int value)
Description copied from interface:Buffer
Sets the specified 16-bit short integer in the Little Endian Byte Order at the currentwriterIndex
and increases thewriterIndex
by2
in this buffer. The 16 high-order bits of the specified value are ignored. Ifthis.writableBytes
is less than2
,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Specified by:
writeShortLE
in interfaceBuffer
- Parameters:
value
- the value to write.- Returns:
- self.
-
writeMedium
CompositeBuffer writeMedium(int value)
Description copied from interface:Buffer
Sets the specified 24-bit medium integer at the currentwriterIndex
and increases thewriterIndex
by3
in this buffer. Ifthis.writableBytes
is less than3
,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Specified by:
writeMedium
in interfaceBuffer
- Parameters:
value
- the value to write.- Returns:
- self.
-
writeMediumLE
CompositeBuffer writeMediumLE(int value)
Description copied from interface:Buffer
Sets the specified 24-bit medium integer at the currentwriterIndex
in the Little Endian Byte Order and increases thewriterIndex
by3
in this buffer. Ifthis.writableBytes
is less than3
,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Specified by:
writeMediumLE
in interfaceBuffer
- Parameters:
value
- the value to write.- Returns:
- self.
-
writeInt
CompositeBuffer writeInt(int value)
Description copied from interface:Buffer
Sets the specified 32-bit integer at the currentwriterIndex
and increases thewriterIndex
by4
in this buffer. Ifthis.writableBytes
is less than4
,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.
-
writeIntLE
CompositeBuffer writeIntLE(int value)
Description copied from interface:Buffer
Sets the specified 32-bit integer at the currentwriterIndex
in the Little Endian Byte Order and increases thewriterIndex
by4
in this buffer. Ifthis.writableBytes
is less than4
,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Specified by:
writeIntLE
in interfaceBuffer
- Parameters:
value
- the value to write.- Returns:
- self.
-
writeLong
CompositeBuffer writeLong(long value)
Description copied from interface:Buffer
Sets the specified 64-bit long integer at the currentwriterIndex
and increases thewriterIndex
by8
in this buffer. Ifthis.writableBytes
is less than8
,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.
-
writeLongLE
CompositeBuffer writeLongLE(long value)
Description copied from interface:Buffer
Sets the specified 64-bit long integer at the currentwriterIndex
in the Little Endian Byte Order and increases thewriterIndex
by8
in this buffer. Ifthis.writableBytes
is less than8
,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Specified by:
writeLongLE
in interfaceBuffer
- Parameters:
value
- the value to write.- Returns:
- self.
-
writeChar
CompositeBuffer writeChar(int value)
Description copied from interface:Buffer
Sets the specified 2-byte UTF-16 character at the currentwriterIndex
and increases thewriterIndex
by2
in this buffer. The 16 high-order bits of the specified value are ignored. Ifthis.writableBytes
is less than2
,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.
-
writeFloat
CompositeBuffer writeFloat(float value)
Description copied from interface:Buffer
Sets the specified 32-bit floating point number at the currentwriterIndex
and increases thewriterIndex
by4
in this buffer. Ifthis.writableBytes
is less than4
,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Specified by:
writeFloat
in interfaceBuffer
- Parameters:
value
- the value to write.- Returns:
- self.
-
writeDouble
CompositeBuffer writeDouble(double value)
Description copied from interface:Buffer
Sets the specified 64-bit floating point number at the currentwriterIndex
and increases thewriterIndex
by8
in this buffer. Ifthis.writableBytes
is less than8
,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Specified by:
writeDouble
in interfaceBuffer
- Parameters:
value
- the value to write.- Returns:
- self.
-
writeBytes
CompositeBuffer writeBytes(Buffer src)
Description copied from interface:Buffer
Transfers the specified source buffer's data to this buffer starting at the currentwriterIndex
until the source buffer becomes unreadable, and increases thewriterIndex
by the number of the transferred bytes. This method is basically same withBuffer.writeBytes(Buffer, int, int)
, except that this method increases thereaderIndex
of the source buffer by the number of the transferred bytes whileBuffer.writeBytes(Buffer, int, int)
does not. Ifthis.writableBytes
is less thansrc.readableBytes
,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Specified by:
writeBytes
in interfaceBuffer
- Parameters:
src
- the buffer to write.- Returns:
- self.
-
writeBytes
CompositeBuffer writeBytes(Buffer src, int length)
Description copied from interface:Buffer
Transfers the specified source buffer's data to this buffer starting at the currentwriterIndex
and increases thewriterIndex
by the number of the transferred bytes (=length
). This method is basically same withBuffer.writeBytes(Buffer, int, int)
, except that this method increases thereaderIndex
of the source buffer by the number of the transferred bytes (=length
) whileBuffer.writeBytes(Buffer, int, int)
does not. Ifthis.writableBytes
is less thanlength
,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Specified by:
writeBytes
in interfaceBuffer
- Parameters:
src
- the buffer to write.length
- the number of bytes to transfer- Returns:
- self.
-
writeBytes
CompositeBuffer writeBytes(Buffer src, int srcIndex, int length)
Description copied from interface:Buffer
Transfers the specified source buffer's data to this buffer starting at the currentwriterIndex
and increases thewriterIndex
by the number of the transferred bytes (=length
). Ifthis.writableBytes
is less thanlength
,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Specified by:
writeBytes
in interfaceBuffer
- Parameters:
src
- the buffer to write.srcIndex
- the first index of the sourcelength
- the number of bytes to transfer- Returns:
- self.
-
writeBytes
CompositeBuffer writeBytes(byte[] src)
Description copied from interface:Buffer
Transfers the specified source array's data to this buffer starting at the currentwriterIndex
and increases thewriterIndex
by the number of the transferred bytes (=src.length
). Ifthis.writableBytes
is less thansrc.length
,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Specified by:
writeBytes
in interfaceBuffer
- Parameters:
src
- the array to write.- Returns:
- self.
-
writeBytes
CompositeBuffer writeBytes(byte[] src, int srcIndex, int length)
Description copied from interface:Buffer
Transfers the specified source array's data to this buffer starting at the currentwriterIndex
and increases thewriterIndex
by the number of the transferred bytes (=length
). Ifthis.writableBytes
is less thanlength
,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Specified by:
writeBytes
in interfaceBuffer
- Parameters:
src
- the array to write.srcIndex
- the first index of the sourcelength
- the number of bytes to transfer- Returns:
- self.
-
writeBytes
CompositeBuffer writeBytes(java.nio.ByteBuffer src)
Description copied from interface:Buffer
Transfers the specified source buffer's data to this buffer starting at the currentwriterIndex
until the source buffer's position reaches its limit, and increases thewriterIndex
by the number of the transferred bytes. Ifthis.writableBytes
is less thansrc.remaining()
,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Specified by:
writeBytes
in interfaceBuffer
- Parameters:
src
- the source buffer to write.- Returns:
- self.
-
writeAscii
CompositeBuffer writeAscii(java.lang.CharSequence seq)
Description copied from interface:Buffer
Encode aCharSequence
in ASCII and write it to this buffer starting atwriterIndex
and increases thewriterIndex
by the number of the transferred bytes. Ifthis.writableBytes
is not large enough to write the whole sequence,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.- Specified by:
writeAscii
in interfaceBuffer
- Parameters:
seq
- the source of the data.- Returns:
- self.
-
writeUtf8
CompositeBuffer writeUtf8(java.lang.CharSequence seq)
Description copied from interface:Buffer
Encode aCharSequence
in UTF-8 and write it to this buffer starting atwriterIndex
and increases thewriterIndex
by the number of the transferred bytes. Ifthis.writableBytes
is not large enough to write the whole sequence,Buffer.ensureWritable(int)
will be called in an attempt to expand capacity to accommodate.
-
-