Interface CompositeBuffer

  • All Superinterfaces:
    Buffer

    public interface CompositeBuffer
    extends Buffer
    A virtual Buffer which shows multiple buffers as a single merged buffer.
    • Method Detail

      • addBuffer

        default CompositeBuffer addBuffer​(Buffer buffer)
        Add the given Buffer to this buffer and increment the writerIndex.
        Parameters:
        buffer - the buffer to add.
        Returns:
        self.
      • addBuffer

        CompositeBuffer addBuffer​(Buffer buffer,
                                  boolean incrementWriterIndex)
        Add the given Buffer to this buffer.
        Parameters:
        buffer - the buffer to add.
        incrementWriterIndex - if true the writerIndex will be increment by the number of readableBytes of the given buffer.
        Returns:
        self.
      • consolidate

        CompositeBuffer consolidate()
        Consolidate the composed Buffers.
        Returns:
        self.
      • consolidate

        CompositeBuffer consolidate​(int index,
                                    int count)
        Consolidate the composed Buffers.
        Parameters:
        index - the index on which to start to compose.
        count - the number of contained buffers to compose.
        Returns:
        self.
      • discardSomeReadBytes

        CompositeBuffer discardSomeReadBytes()
        Discard all Buffers which have been read.
        Returns:
        self.
      • capacity

        CompositeBuffer capacity​(int newCapacity)
        Description copied from interface: Buffer
        Sets the capacity of this buffer. If the 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).
        Specified by:
        capacity in interface Buffer
        Parameters:
        newCapacity - the new capacity.
        Returns:
        itself.
      • readerIndex

        CompositeBuffer readerIndex​(int readerIndex)
        Description copied from interface: Buffer
        Sets the readerIndex of this buffer.
        Specified by:
        readerIndex in interface Buffer
        Parameters:
        readerIndex - the new readerIndex of this buffer.
        Returns:
        itself.
      • writerIndex

        CompositeBuffer writerIndex​(int writerIndex)
        Description copied from interface: Buffer
        Sets the writerIndex of this buffer.
        Specified by:
        writerIndex in interface Buffer
        Parameters:
        writerIndex - the new writerIndex of this buffer.
        Returns:
        itself.
      • clear

        CompositeBuffer clear()
        Description copied from interface: Buffer
        Sets the readerIndex and writerIndex of this buffer to 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.

        Specified by:
        clear in interface Buffer
        Returns:
        this.
      • 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 absolute index until the destination becomes non-writable. This method is basically same with Buffer.getBytes(int, Buffer, int, int), except that this method increases the writerIndex of the destination by the number of the transferred bytes while Buffer.getBytes(int, Buffer, int, int) does not. This method does not modify readerIndex or writerIndex of the source buffer (i.e. this).
        Specified by:
        getBytes in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        dst - the destination buffer.
        Returns:
        itself.
      • 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 absolute index. This method is basically same with Buffer.getBytes(int, Buffer, int, int), except that this method increases the writerIndex of the destination by the number of the transferred bytes while Buffer.getBytes(int, Buffer, int, int) does not. This method does not modify readerIndex or writerIndex of the source buffer (i.e. this).
        Specified by:
        getBytes in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        dst - the destination buffer.
        length - the number of bytes to transfer
        Returns:
        itself.
      • 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 absolute index. This method does not modify readerIndex or writerIndex of both the source (i.e. this) and the destination.
        Specified by:
        getBytes in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        dst - the destination buffer.
        dstIndex - the first index of the destination
        length - the number of bytes to transfer
        Returns:
        itself.
      • 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 absolute index. This method does not modify readerIndex or writerIndex of this buffer
        Specified by:
        getBytes in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        dst - the destination array.
        Returns:
        itself.
      • 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 absolute index. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        getBytes in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        dst - the destination array.
        dstIndex - the first index of the destination
        length - the number of bytes to transfer
        Returns:
        itself.
      • 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 absolute 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.
        Specified by:
        getBytes in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        dst - the destination buffer.
        Returns:
        itself.
      • setBoolean

        CompositeBuffer setBoolean​(int index,
                                   boolean value)
        Description copied from interface: Buffer
        Sets the specified boolean at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setBoolean in interface Buffer
        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 absolute 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.
        Specified by:
        setByte in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        value - the value.
        Returns:
        itself.
      • setShort

        CompositeBuffer setShort​(int index,
                                 int value)
        Description copied from interface: Buffer
        Sets the specified 16-bit short integer at the specified absolute 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.
        Specified by:
        setShort in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        value - the value.
        Returns:
        itself.
      • setShortLE

        CompositeBuffer setShortLE​(int index,
                                   int value)
        Description copied from interface: Buffer
        Sets the specified 16-bit short integer at the specified absolute index in this buffer with the Little Endian Byte Order. The 16 high-order bits of the specified value are ignored. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setShortLE in interface Buffer
        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 absolute 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.
        Specified by:
        setMedium in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        value - the value.
        Returns:
        itself.
      • setMediumLE

        CompositeBuffer setMediumLE​(int index,
                                    int value)
        Description copied from interface: Buffer
        Sets the specified 24-bit medium integer at the specified absolute index 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 modify readerIndex or writerIndex of this buffer.
        Specified by:
        setMediumLE in interface Buffer
        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 absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setInt in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        value - the value.
        Returns:
        itself.
      • setIntLE

        CompositeBuffer setIntLE​(int index,
                                 int value)
        Description copied from interface: Buffer
        Sets the specified 32-bit integer at the specified absolute index in this buffer with Little Endian byte order . This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setIntLE in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        value - the value.
        Returns:
        itself.
      • setLong

        CompositeBuffer setLong​(int index,
                                long value)
        Description copied from interface: Buffer
        Sets the specified 64-bit long integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setLong in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        value - the value.
        Returns:
        itself.
      • setLongLE

        CompositeBuffer setLongLE​(int index,
                                  long value)
        Description copied from interface: Buffer
        Sets the specified 64-bit long integer at the specified absolute index in this buffer in Little Endian Byte Order. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setLongLE in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        value - the value.
        Returns:
        itself.
      • setChar

        CompositeBuffer setChar​(int index,
                                int value)
        Description copied from interface: Buffer
        Sets the specified 2-byte UTF-16 character at the specified absolute 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.
        Specified by:
        setChar in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        value - the value.
        Returns:
        itself.
      • setFloat

        CompositeBuffer setFloat​(int index,
                                 float value)
        Description copied from interface: Buffer
        Sets the specified 32-bit floating-point number at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setFloat in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        value - the value.
        Returns:
        itself.
      • setDouble

        CompositeBuffer setDouble​(int index,
                                  double value)
        Description copied from interface: Buffer
        Sets the specified 64-bit floating-point number at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setDouble in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        value - the value.
        Returns:
        itself.
      • 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 absolute index until the source buffer becomes unreadable. This method is basically same with Buffer.setBytes(int, Buffer, int, int), except that this method increases the readerIndex of the source buffer by the number of the transferred bytes while Buffer.setBytes(int, Buffer, int, int) does not. This method does not modify readerIndex or writerIndex of the source buffer (i.e. this).
        Specified by:
        setBytes in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        src - the source buffer.
        Returns:
        itself.
      • 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 absolute index. This method is basically same with Buffer.setBytes(int, Buffer, int, int), except that this method increases the readerIndex of the source buffer by the number of the transferred bytes while Buffer.setBytes(int, Buffer, int, int) does not. This method does not modify readerIndex or writerIndex of the source buffer (i.e. this).
        Specified by:
        setBytes in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        src - the source buffer.
        length - the number of bytes to transfer
        Returns:
        itself.
      • 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 absolute index. This method does not modify readerIndex or writerIndex of both the source (i.e. this) and the destination.
        Specified by:
        setBytes in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        src - the source buffer.
        srcIndex - the first index of the source
        length - the number of bytes to transfer
        Returns:
        itself.
      • 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 absolute index. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setBytes in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        src - the source array.
        Returns:
        itself.
      • 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 absolute index. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setBytes in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        src - the source array.
        srcIndex - the first index of the source
        length - the number of bytes to transfer
        Returns:
        itself.
      • 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 absolute index until the source buffer's position reaches its limit. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setBytes in interface Buffer
        Parameters:
        index - absolute (@code index) in this buffer.
        src - the source buffer.
        Returns:
        itself.
      • skipBytes

        CompositeBuffer skipBytes​(int length)
        Description copied from interface: Buffer
        Increases the current readerIndex by the specified length in this buffer.
        Specified by:
        skipBytes in interface Buffer
        Parameters:
        length - number of bytes.
        Returns:
        self.
      • writeBoolean

        CompositeBuffer writeBoolean​(boolean value)
        Description copied from interface: Buffer
        Sets the specified boolean at the current writerIndex and increases the writerIndex by 1 in this buffer. If this.writableBytes is less than 1, Buffer.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
        Specified by:
        writeBoolean in interface Buffer
        Parameters:
        value - the value to write.
        Returns:
        self.
      • writeByte

        CompositeBuffer writeByte​(int value)
        Description copied from interface: Buffer
        Sets the specified byte at the current writerIndex and increases the writerIndex by 1 in this buffer. The 24 high-order bits of the specified value are ignored. If this.writableBytes is less than 1, Buffer.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
        Specified by:
        writeByte in interface Buffer
        Parameters:
        value - the value to write.
        Returns:
        self.
      • writeShort

        CompositeBuffer writeShort​(int value)
        Description copied from interface: Buffer
        Sets the specified 16-bit short integer at the current writerIndex and increases the writerIndex by 2 in this buffer. The 16 high-order bits of the specified value are ignored. If this.writableBytes is less than 2, Buffer.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
        Specified by:
        writeShort in interface Buffer
        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 current writerIndex and increases the writerIndex by 2 in this buffer. The 16 high-order bits of the specified value are ignored. If this.writableBytes is less than 2, Buffer.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
        Specified by:
        writeShortLE in interface Buffer
        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 current writerIndex and increases the writerIndex by 3 in this buffer. If this.writableBytes is less than 3, Buffer.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
        Specified by:
        writeMedium in interface Buffer
        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 current writerIndex in the Little Endian Byte Order and increases the writerIndex by 3 in this buffer. If this.writableBytes is less than 3, Buffer.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
        Specified by:
        writeMediumLE in interface Buffer
        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 current writerIndex and increases the writerIndex by 4 in this buffer. If this.writableBytes is less than 4, Buffer.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
        Specified by:
        writeInt in interface Buffer
        Parameters:
        value - the value to write.
        Returns:
        self.
      • writeIntLE

        CompositeBuffer writeIntLE​(int value)
        Description copied from interface: Buffer
        Sets the specified 32-bit integer at the current writerIndex in the Little Endian Byte Order and increases the writerIndex by 4 in this buffer. If this.writableBytes is less than 4, Buffer.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
        Specified by:
        writeIntLE in interface Buffer
        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 current writerIndex and increases the writerIndex by 8 in this buffer. If this.writableBytes is less than 8, Buffer.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
        Specified by:
        writeLong in interface Buffer
        Parameters:
        value - the value to write.
        Returns:
        self.
      • writeLongLE

        CompositeBuffer writeLongLE​(long value)
        Description copied from interface: Buffer
        Sets the specified 64-bit long integer at the current writerIndex in the Little Endian Byte Order and increases the writerIndex by 8 in this buffer. If this.writableBytes is less than 8, Buffer.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
        Specified by:
        writeLongLE in interface Buffer
        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 current writerIndex and increases the writerIndex by 2 in this buffer. The 16 high-order bits of the specified value are ignored. If this.writableBytes is less than 2, Buffer.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
        Specified by:
        writeChar in interface Buffer
        Parameters:
        value - the value to write.
        Returns:
        self.
      • writeFloat

        CompositeBuffer writeFloat​(float value)
        Description copied from interface: Buffer
        Sets the specified 32-bit floating point number at the current writerIndex and increases the writerIndex by 4 in this buffer. If this.writableBytes is less than 4, Buffer.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
        Specified by:
        writeFloat in interface Buffer
        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 current writerIndex and increases the writerIndex by 8 in this buffer. If this.writableBytes is less than 8, Buffer.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
        Specified by:
        writeDouble in interface Buffer
        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 current writerIndex until the source buffer becomes unreadable, and increases the writerIndex by the number of the transferred bytes. This method is basically same with Buffer.writeBytes(Buffer, int, int), except that this method increases the readerIndex of the source buffer by the number of the transferred bytes while Buffer.writeBytes(Buffer, int, int) does not. If this.writableBytes is less than src.readableBytes, Buffer.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
        Specified by:
        writeBytes in interface Buffer
        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 current writerIndex and increases the writerIndex by the number of the transferred bytes (= length). This method is basically same with Buffer.writeBytes(Buffer, int, int), except that this method increases the readerIndex of the source buffer by the number of the transferred bytes (= length) while Buffer.writeBytes(Buffer, int, int) does not. If this.writableBytes is less than length, Buffer.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
        Specified by:
        writeBytes in interface Buffer
        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 current writerIndex and increases the writerIndex by the number of the transferred bytes (= length). If this.writableBytes is less than length, Buffer.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
        Specified by:
        writeBytes in interface Buffer
        Parameters:
        src - the buffer to write.
        srcIndex - the first index of the source
        length - 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 current writerIndex and increases the writerIndex by the number of the transferred bytes (= src.length). If this.writableBytes is less than src.length, Buffer.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
        Specified by:
        writeBytes in interface Buffer
        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 current writerIndex and increases the writerIndex by the number of the transferred bytes (= length). If this.writableBytes is less than length, Buffer.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
        Specified by:
        writeBytes in interface Buffer
        Parameters:
        src - the array to write.
        srcIndex - the first index of the source
        length - 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 current writerIndex until the source buffer's position reaches its limit, and increases the writerIndex by the number of the transferred bytes. If this.writableBytes is less than src.remaining(), Buffer.ensureWritable(int) will be called in an attempt to expand capacity to accommodate.
        Specified by:
        writeBytes in interface Buffer
        Parameters:
        src - the source buffer to write.
        Returns:
        self.
      • writeAscii

        CompositeBuffer writeAscii​(java.lang.CharSequence seq)
        Description copied from interface: Buffer
        Encode a CharSequence in ASCII and write it to this buffer starting at writerIndex and increases the writerIndex by the number of the transferred bytes. If this.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 interface Buffer
        Parameters:
        seq - the source of the data.
        Returns:
        self.
      • writeUtf8

        CompositeBuffer writeUtf8​(java.lang.CharSequence seq)
        Description copied from interface: Buffer
        Encode a CharSequence in UTF-8 and write it to this buffer starting at writerIndex and increases the writerIndex by the number of the transferred bytes. If this.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:
        writeUtf8 in interface Buffer
        Parameters:
        seq - the source of the data.
        Returns:
        self.