ByteBuf.setBytes

Transfers the specified source buffer's data to this buffer starting at the specified absolute {@code index}. This method is basically same with {@link #setBytes(int, ByteBuf, int, int)}, except that this method increases the {@code readerIndex} of the source buffer by the number of the transferred bytes while {@link #setBytes(int, ByteBuf, int, int)} does not. This method does not modify {@code readerIndex} or {@code writerIndex} of the source buffer (i.e. {@code this}).

@param length the number of bytes to transfer

@throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0}, if {@code index + length} is greater than {@code this.capacity}, or if {@code length} is greater than {@code src.readableBytes}

Meta