Package io.servicetalk.buffer.api
Interface CompositeBuffer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default CompositeBufferaddBuffer(Buffer buffer)Add the givenBufferto this buffer and increment the writerIndex.CompositeBufferaddBuffer(Buffer buffer, boolean incrementWriterIndex)Add the givenBufferto this buffer.CompositeBuffercapacity(int newCapacity)Sets the capacity of this buffer.CompositeBufferclear()Sets thereaderIndexandwriterIndexof this buffer to0.CompositeBufferconsolidate()Consolidate the composedBuffers.CompositeBufferconsolidate(int index, int count)Consolidate the composedBuffers.CompositeBufferdiscardSomeReadBytes()Discard allBuffers which have been read.CompositeBuffergetBytes(int index, byte[] dst)Transfers this buffer's data to the specified destination starting at the specified absoluteindex.CompositeBuffergetBytes(int index, byte[] dst, int dstIndex, int length)Transfers this buffer's data to the specified destination starting at the specified absoluteindex.CompositeBuffergetBytes(int index, Buffer dst)Transfers this buffer's data to the specified destination starting at the specified absoluteindexuntil the destination becomes non-writable.CompositeBuffergetBytes(int index, Buffer dst, int length)Transfers this buffer's data to the specified destination starting at the specified absoluteindex.CompositeBuffergetBytes(int index, Buffer dst, int dstIndex, int length)Transfers this buffer's data to the specified destination starting at the specified absoluteindex.CompositeBuffergetBytes(int index, java.nio.ByteBuffer dst)Transfers this buffer's data to the specified destination starting at the specified absoluteindexuntil the destination's position reaches its limit.CompositeBufferreaderIndex(int readerIndex)Sets thereaderIndexof this buffer.CompositeBuffersetBoolean(int index, boolean value)Sets the specified boolean at the specified absoluteindexin this buffer.CompositeBuffersetByte(int index, int value)Sets the specified byte at the specified absoluteindexin this buffer.CompositeBuffersetBytes(int index, byte[] src)Transfers the specified source array's data to this buffer starting at the specified absoluteindex.CompositeBuffersetBytes(int index, byte[] src, int srcIndex, int length)Transfers the specified source array's data to this buffer starting at the specified absoluteindex.CompositeBuffersetBytes(int index, Buffer src)Transfers the specified source buffer's data to this buffer starting at the specified absoluteindexuntil the source buffer becomes unreadable.CompositeBuffersetBytes(int index, Buffer src, int length)Transfers the specified source buffer's data to this buffer starting at the specified absoluteindex.CompositeBuffersetBytes(int index, Buffer src, int srcIndex, int length)Transfers the specified source buffer's data to this buffer starting at the specified absoluteindex.CompositeBuffersetBytes(int index, java.nio.ByteBuffer src)Transfers the specified source buffer's data to this buffer starting at the specified absoluteindexuntil the source buffer's position reaches its limit.CompositeBuffersetChar(int index, int value)Sets the specified 2-byte UTF-16 character at the specified absoluteindexin this buffer.CompositeBuffersetDouble(int index, double value)Sets the specified 64-bit floating-point number at the specified absoluteindexin this buffer.CompositeBuffersetFloat(int index, float value)Sets the specified 32-bit floating-point number at the specified absoluteindexin this buffer.CompositeBuffersetInt(int index, int value)Sets the specified 32-bit integer at the specified absoluteindexin this buffer.CompositeBuffersetIntLE(int index, int value)Sets the specified 32-bit integer at the specified absoluteindexin this buffer with Little Endian byte order .CompositeBuffersetLong(int index, long value)Sets the specified 64-bit long integer at the specified absoluteindexin this buffer.CompositeBuffersetLongLE(int index, long value)Sets the specified 64-bit long integer at the specified absoluteindexin this buffer in Little Endian Byte Order.CompositeBuffersetMedium(int index, int value)Sets the specified 24-bit medium integer at the specified absoluteindexin this buffer.CompositeBuffersetMediumLE(int index, int value)Sets the specified 24-bit medium integer at the specified absoluteindexin this buffer in the Little Endian Byte Order.CompositeBuffersetShort(int index, int value)Sets the specified 16-bit short integer at the specified absoluteindexin this buffer.CompositeBuffersetShortLE(int index, int value)Sets the specified 16-bit short integer at the specified absoluteindexin this buffer with the Little Endian Byte Order.CompositeBufferskipBytes(int length)Increases the currentreaderIndexby the specifiedlengthin this buffer.CompositeBufferwriteAscii(java.lang.CharSequence seq)Encode aCharSequencein ASCII and write it to this buffer starting atwriterIndexand increases thewriterIndexby the number of the transferred bytes.CompositeBufferwriteBoolean(boolean value)Sets the specified boolean at the currentwriterIndexand increases thewriterIndexby1in this buffer.CompositeBufferwriteByte(int value)Sets the specified byte at the currentwriterIndexand increases thewriterIndexby1in this buffer.CompositeBufferwriteBytes(byte[] src)Transfers the specified source array's data to this buffer starting at the currentwriterIndexand increases thewriterIndexby the number of the transferred bytes (=src.length).CompositeBufferwriteBytes(byte[] src, int srcIndex, int length)Transfers the specified source array's data to this buffer starting at the currentwriterIndexand increases thewriterIndexby the number of the transferred bytes (=length).CompositeBufferwriteBytes(Buffer src)Transfers the specified source buffer's data to this buffer starting at the currentwriterIndexuntil the source buffer becomes unreadable, and increases thewriterIndexby the number of the transferred bytes.CompositeBufferwriteBytes(Buffer src, int length)Transfers the specified source buffer's data to this buffer starting at the currentwriterIndexand increases thewriterIndexby the number of the transferred bytes (=length).CompositeBufferwriteBytes(Buffer src, int srcIndex, int length)Transfers the specified source buffer's data to this buffer starting at the currentwriterIndexand increases thewriterIndexby the number of the transferred bytes (=length).CompositeBufferwriteBytes(java.nio.ByteBuffer src)Transfers the specified source buffer's data to this buffer starting at the currentwriterIndexuntil the source buffer's position reaches its limit, and increases thewriterIndexby the number of the transferred bytes.CompositeBufferwriteChar(int value)Sets the specified 2-byte UTF-16 character at the currentwriterIndexand increases thewriterIndexby2in this buffer.CompositeBufferwriteDouble(double value)Sets the specified 64-bit floating point number at the currentwriterIndexand increases thewriterIndexby8in this buffer.CompositeBufferwriteFloat(float value)Sets the specified 32-bit floating point number at the currentwriterIndexand increases thewriterIndexby4in this buffer.CompositeBufferwriteInt(int value)Sets the specified 32-bit integer at the currentwriterIndexand increases thewriterIndexby4in this buffer.CompositeBufferwriteIntLE(int value)Sets the specified 32-bit integer at the currentwriterIndexin the Little Endian Byte Order and increases thewriterIndexby4in this buffer.CompositeBufferwriteLong(long value)Sets the specified 64-bit long integer at the currentwriterIndexand increases thewriterIndexby8in this buffer.CompositeBufferwriteLongLE(long value)Sets the specified 64-bit long integer at the currentwriterIndexin the Little Endian Byte Order and increases thewriterIndexby8in this buffer.CompositeBufferwriteMedium(int value)Sets the specified 24-bit medium integer at the currentwriterIndexand increases thewriterIndexby3in this buffer.CompositeBufferwriteMediumLE(int value)Sets the specified 24-bit medium integer at the currentwriterIndexin the Little Endian Byte Order and increases thewriterIndexby3in this buffer.CompositeBufferwriterIndex(int writerIndex)Sets thewriterIndexof this buffer.CompositeBufferwriteShort(int value)Sets the specified 16-bit short integer at the currentwriterIndexand increases thewriterIndexby2in this buffer.CompositeBufferwriteShortLE(int value)Sets the specified 16-bit short integer in the Little Endian Byte Order at the currentwriterIndexand increases thewriterIndexby2in this buffer.CompositeBufferwriteUtf8(java.lang.CharSequence seq)Encode aCharSequencein UTF-8 and write it to this buffer starting atwriterIndexand increases thewriterIndexby 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 givenBufferto this buffer and increment the writerIndex.- Parameters:
buffer- the buffer to add.- Returns:
- self.
-
addBuffer
CompositeBuffer addBuffer(Buffer buffer, boolean incrementWriterIndex)
Add the givenBufferto this buffer.- Parameters:
buffer- the buffer to add.incrementWriterIndex- iftruethe writerIndex will be increment by the number of readableBytes of the given buffer.- Returns:
- self.
-
consolidate
CompositeBuffer consolidate()
Consolidate the composedBuffers.- Returns:
- self.
-
consolidate
CompositeBuffer consolidate(int index, int count)
Consolidate the composedBuffers.- Parameters:
index- the index on which to start to compose.count- the number of contained buffers to compose.- Returns:
- self.
-
discardSomeReadBytes
CompositeBuffer discardSomeReadBytes()
Discard allBuffers which have been read.- Returns:
- self.
-
capacity
CompositeBuffer capacity(int newCapacity)
Description copied from interface:BufferSets the capacity of this buffer. If thenewCapacityis less than the current capacity, the content of this buffer is truncated. If thenewCapacityis 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:BufferSets thereaderIndexof this buffer.- Specified by:
readerIndexin interfaceBuffer- Parameters:
readerIndex- the new readerIndex of this buffer.- Returns:
- itself.
-
writerIndex
CompositeBuffer writerIndex(int writerIndex)
Description copied from interface:BufferSets thewriterIndexof this buffer.- Specified by:
writerIndexin interfaceBuffer- Parameters:
writerIndex- the new writerIndex of this buffer.- Returns:
- itself.
-
clear
CompositeBuffer clear()
Description copied from interface:BufferSets thereaderIndexandwriterIndexof this buffer to0.Please note that the behavior of this method is different from that of NIO buffer, which sets the
limitto thecapacityof the buffer.
-
getBytes
CompositeBuffer getBytes(int index, Buffer dst)
Description copied from interface:BufferTransfers this buffer's data to the specified destination starting at the specified absoluteindexuntil the destination becomes non-writable. This method is basically same withBuffer.getBytes(int, Buffer, int, int), except that this method increases thewriterIndexof the destination by the number of the transferred bytes whileBuffer.getBytes(int, Buffer, int, int)does not. This method does not modifyreaderIndexorwriterIndexof the source buffer (i.e.this).
-
getBytes
CompositeBuffer getBytes(int index, Buffer dst, int length)
Description copied from interface:BufferTransfers 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 thewriterIndexof the destination by the number of the transferred bytes whileBuffer.getBytes(int, Buffer, int, int)does not. This method does not modifyreaderIndexorwriterIndexof the source buffer (i.e.this).
-
getBytes
CompositeBuffer getBytes(int index, Buffer dst, int dstIndex, int length)
Description copied from interface:BufferTransfers this buffer's data to the specified destination starting at the specified absoluteindex. This method does not modifyreaderIndexorwriterIndexof both the source (i.e.this) and the destination.
-
getBytes
CompositeBuffer getBytes(int index, byte[] dst)
Description copied from interface:BufferTransfers this buffer's data to the specified destination starting at the specified absoluteindex. This method does not modifyreaderIndexorwriterIndexof this buffer
-
getBytes
CompositeBuffer getBytes(int index, byte[] dst, int dstIndex, int length)
Description copied from interface:BufferTransfers this buffer's data to the specified destination starting at the specified absoluteindex. This method does not modifyreaderIndexorwriterIndexof this buffer.
-
getBytes
CompositeBuffer getBytes(int index, java.nio.ByteBuffer dst)
Description copied from interface:BufferTransfers this buffer's data to the specified destination starting at the specified absoluteindexuntil the destination's position reaches its limit. This method does not modifyreaderIndexorwriterIndexof this buffer while the destination'spositionwill be increased.
-
setBoolean
CompositeBuffer setBoolean(int index, boolean value)
Description copied from interface:BufferSets the specified boolean at the specified absoluteindexin this buffer. This method does not modifyreaderIndexorwriterIndexof this buffer.- Specified by:
setBooleanin 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:BufferSets the specified byte at the specified absoluteindexin this buffer. The 24 high-order bits of the specified value are ignored. This method does not modifyreaderIndexorwriterIndexof this buffer.
-
setShort
CompositeBuffer setShort(int index, int value)
Description copied from interface:BufferSets the specified 16-bit short integer at the specified absoluteindexin this buffer. The 16 high-order bits of the specified value are ignored. This method does not modifyreaderIndexorwriterIndexof this buffer.
-
setShortLE
CompositeBuffer setShortLE(int index, int value)
Description copied from interface:BufferSets the specified 16-bit short integer at the specified absoluteindexin this buffer with the Little Endian Byte Order. The 16 high-order bits of the specified value are ignored. This method does not modifyreaderIndexorwriterIndexof this buffer.- Specified by:
setShortLEin 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:BufferSets the specified 24-bit medium integer at the specified absoluteindexin this buffer. Please note that the most significant byte is ignored in the specified value. This method does not modifyreaderIndexorwriterIndexof this buffer.
-
setMediumLE
CompositeBuffer setMediumLE(int index, int value)
Description copied from interface:BufferSets the specified 24-bit medium integer at the specified absoluteindexin 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 modifyreaderIndexorwriterIndexof this buffer.- Specified by:
setMediumLEin 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:BufferSets the specified 32-bit integer at the specified absoluteindexin this buffer. This method does not modifyreaderIndexorwriterIndexof this buffer.
-
setIntLE
CompositeBuffer setIntLE(int index, int value)
Description copied from interface:BufferSets the specified 32-bit integer at the specified absoluteindexin this buffer with Little Endian byte order . This method does not modifyreaderIndexorwriterIndexof this buffer.
-
setLong
CompositeBuffer setLong(int index, long value)
Description copied from interface:BufferSets the specified 64-bit long integer at the specified absoluteindexin this buffer. This method does not modifyreaderIndexorwriterIndexof this buffer.
-
setLongLE
CompositeBuffer setLongLE(int index, long value)
Description copied from interface:BufferSets the specified 64-bit long integer at the specified absoluteindexin this buffer in Little Endian Byte Order. This method does not modifyreaderIndexorwriterIndexof this buffer.
-
setChar
CompositeBuffer setChar(int index, int value)
Description copied from interface:BufferSets the specified 2-byte UTF-16 character at the specified absoluteindexin this buffer. The 16 high-order bits of the specified value are ignored. This method does not modifyreaderIndexorwriterIndexof this buffer.
-
setFloat
CompositeBuffer setFloat(int index, float value)
Description copied from interface:BufferSets the specified 32-bit floating-point number at the specified absoluteindexin this buffer. This method does not modifyreaderIndexorwriterIndexof this buffer.
-
setDouble
CompositeBuffer setDouble(int index, double value)
Description copied from interface:BufferSets the specified 64-bit floating-point number at the specified absoluteindexin this buffer. This method does not modifyreaderIndexorwriterIndexof this buffer.
-
setBytes
CompositeBuffer setBytes(int index, Buffer src)
Description copied from interface:BufferTransfers the specified source buffer's data to this buffer starting at the specified absoluteindexuntil the source buffer becomes unreadable. This method is basically same withBuffer.setBytes(int, Buffer, int, int), except that this method increases thereaderIndexof the source buffer by the number of the transferred bytes whileBuffer.setBytes(int, Buffer, int, int)does not. This method does not modifyreaderIndexorwriterIndexof the source buffer (i.e.this).
-
setBytes
CompositeBuffer setBytes(int index, Buffer src, int length)
Description copied from interface:BufferTransfers 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 thereaderIndexof the source buffer by the number of the transferred bytes whileBuffer.setBytes(int, Buffer, int, int)does not. This method does not modifyreaderIndexorwriterIndexof the source buffer (i.e.this).
-
setBytes
CompositeBuffer setBytes(int index, Buffer src, int srcIndex, int length)
Description copied from interface:BufferTransfers the specified source buffer's data to this buffer starting at the specified absoluteindex. This method does not modifyreaderIndexorwriterIndexof both the source (i.e.this) and the destination.
-
setBytes
CompositeBuffer setBytes(int index, byte[] src)
Description copied from interface:BufferTransfers the specified source array's data to this buffer starting at the specified absoluteindex. This method does not modifyreaderIndexorwriterIndexof this buffer.
-
setBytes
CompositeBuffer setBytes(int index, byte[] src, int srcIndex, int length)
Description copied from interface:BufferTransfers the specified source array's data to this buffer starting at the specified absoluteindex. This method does not modifyreaderIndexorwriterIndexof this buffer.
-
setBytes
CompositeBuffer setBytes(int index, java.nio.ByteBuffer src)
Description copied from interface:BufferTransfers the specified source buffer's data to this buffer starting at the specified absoluteindexuntil the source buffer's position reaches its limit. This method does not modifyreaderIndexorwriterIndexof this buffer.
-
skipBytes
CompositeBuffer skipBytes(int length)
Description copied from interface:BufferIncreases the currentreaderIndexby the specifiedlengthin this buffer.
-
writeBoolean
CompositeBuffer writeBoolean(boolean value)
Description copied from interface:BufferSets the specified boolean at the currentwriterIndexand increases thewriterIndexby1in this buffer. Ifthis.writableBytesis less than1,Buffer.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Specified by:
writeBooleanin interfaceBuffer- Parameters:
value- the value to write.- Returns:
- self.
-
writeByte
CompositeBuffer writeByte(int value)
Description copied from interface:BufferSets the specified byte at the currentwriterIndexand increases thewriterIndexby1in this buffer. The 24 high-order bits of the specified value are ignored. Ifthis.writableBytesis 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:BufferSets the specified 16-bit short integer at the currentwriterIndexand increases thewriterIndexby2in this buffer. The 16 high-order bits of the specified value are ignored. Ifthis.writableBytesis less than2,Buffer.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Specified by:
writeShortin interfaceBuffer- Parameters:
value- the value to write.- Returns:
- self.
-
writeShortLE
CompositeBuffer writeShortLE(int value)
Description copied from interface:BufferSets the specified 16-bit short integer in the Little Endian Byte Order at the currentwriterIndexand increases thewriterIndexby2in this buffer. The 16 high-order bits of the specified value are ignored. Ifthis.writableBytesis less than2,Buffer.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Specified by:
writeShortLEin interfaceBuffer- Parameters:
value- the value to write.- Returns:
- self.
-
writeMedium
CompositeBuffer writeMedium(int value)
Description copied from interface:BufferSets the specified 24-bit medium integer at the currentwriterIndexand increases thewriterIndexby3in this buffer. Ifthis.writableBytesis less than3,Buffer.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Specified by:
writeMediumin interfaceBuffer- Parameters:
value- the value to write.- Returns:
- self.
-
writeMediumLE
CompositeBuffer writeMediumLE(int value)
Description copied from interface:BufferSets the specified 24-bit medium integer at the currentwriterIndexin the Little Endian Byte Order and increases thewriterIndexby3in this buffer. Ifthis.writableBytesis less than3,Buffer.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Specified by:
writeMediumLEin interfaceBuffer- Parameters:
value- the value to write.- Returns:
- self.
-
writeInt
CompositeBuffer writeInt(int value)
Description copied from interface:BufferSets the specified 32-bit integer at the currentwriterIndexand increases thewriterIndexby4in this buffer. Ifthis.writableBytesis 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:BufferSets the specified 32-bit integer at the currentwriterIndexin the Little Endian Byte Order and increases thewriterIndexby4in this buffer. Ifthis.writableBytesis less than4,Buffer.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Specified by:
writeIntLEin interfaceBuffer- Parameters:
value- the value to write.- Returns:
- self.
-
writeLong
CompositeBuffer writeLong(long value)
Description copied from interface:BufferSets the specified 64-bit long integer at the currentwriterIndexand increases thewriterIndexby8in this buffer. Ifthis.writableBytesis 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:BufferSets the specified 64-bit long integer at the currentwriterIndexin the Little Endian Byte Order and increases thewriterIndexby8in this buffer. Ifthis.writableBytesis less than8,Buffer.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Specified by:
writeLongLEin interfaceBuffer- Parameters:
value- the value to write.- Returns:
- self.
-
writeChar
CompositeBuffer writeChar(int value)
Description copied from interface:BufferSets the specified 2-byte UTF-16 character at the currentwriterIndexand increases thewriterIndexby2in this buffer. The 16 high-order bits of the specified value are ignored. Ifthis.writableBytesis 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:BufferSets the specified 32-bit floating point number at the currentwriterIndexand increases thewriterIndexby4in this buffer. Ifthis.writableBytesis less than4,Buffer.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Specified by:
writeFloatin interfaceBuffer- Parameters:
value- the value to write.- Returns:
- self.
-
writeDouble
CompositeBuffer writeDouble(double value)
Description copied from interface:BufferSets the specified 64-bit floating point number at the currentwriterIndexand increases thewriterIndexby8in this buffer. Ifthis.writableBytesis less than8,Buffer.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Specified by:
writeDoublein interfaceBuffer- Parameters:
value- the value to write.- Returns:
- self.
-
writeBytes
CompositeBuffer writeBytes(Buffer src)
Description copied from interface:BufferTransfers the specified source buffer's data to this buffer starting at the currentwriterIndexuntil the source buffer becomes unreadable, and increases thewriterIndexby the number of the transferred bytes. This method is basically same withBuffer.writeBytes(Buffer, int, int), except that this method increases thereaderIndexof the source buffer by the number of the transferred bytes whileBuffer.writeBytes(Buffer, int, int)does not. Ifthis.writableBytesis less thansrc.readableBytes,Buffer.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Specified by:
writeBytesin interfaceBuffer- Parameters:
src- the buffer to write.- Returns:
- self.
-
writeBytes
CompositeBuffer writeBytes(Buffer src, int length)
Description copied from interface:BufferTransfers the specified source buffer's data to this buffer starting at the currentwriterIndexand increases thewriterIndexby the number of the transferred bytes (=length). This method is basically same withBuffer.writeBytes(Buffer, int, int), except that this method increases thereaderIndexof the source buffer by the number of the transferred bytes (=length) whileBuffer.writeBytes(Buffer, int, int)does not. Ifthis.writableBytesis less thanlength,Buffer.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Specified by:
writeBytesin 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:BufferTransfers the specified source buffer's data to this buffer starting at the currentwriterIndexand increases thewriterIndexby the number of the transferred bytes (=length). Ifthis.writableBytesis less thanlength,Buffer.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Specified by:
writeBytesin 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:BufferTransfers the specified source array's data to this buffer starting at the currentwriterIndexand increases thewriterIndexby the number of the transferred bytes (=src.length). Ifthis.writableBytesis less thansrc.length,Buffer.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Specified by:
writeBytesin interfaceBuffer- Parameters:
src- the array to write.- Returns:
- self.
-
writeBytes
CompositeBuffer writeBytes(byte[] src, int srcIndex, int length)
Description copied from interface:BufferTransfers the specified source array's data to this buffer starting at the currentwriterIndexand increases thewriterIndexby the number of the transferred bytes (=length). Ifthis.writableBytesis less thanlength,Buffer.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Specified by:
writeBytesin 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:BufferTransfers the specified source buffer's data to this buffer starting at the currentwriterIndexuntil the source buffer's position reaches its limit, and increases thewriterIndexby the number of the transferred bytes. Ifthis.writableBytesis less thansrc.remaining(),Buffer.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Specified by:
writeBytesin interfaceBuffer- Parameters:
src- the source buffer to write.- Returns:
- self.
-
writeAscii
CompositeBuffer writeAscii(java.lang.CharSequence seq)
Description copied from interface:BufferEncode aCharSequencein ASCII and write it to this buffer starting atwriterIndexand increases thewriterIndexby the number of the transferred bytes. Ifthis.writableBytesis not large enough to write the whole sequence,Buffer.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.- Specified by:
writeAsciiin interfaceBuffer- Parameters:
seq- the source of the data.- Returns:
- self.
-
writeUtf8
CompositeBuffer writeUtf8(java.lang.CharSequence seq)
Description copied from interface:BufferEncode aCharSequencein UTF-8 and write it to this buffer starting atwriterIndexand increases thewriterIndexby the number of the transferred bytes. Ifthis.writableBytesis not large enough to write the whole sequence,Buffer.ensureWritable(int)will be called in an attempt to expand capacity to accommodate.
-
-