ByteBuf.readBytes

Transfers this buffer's data to the specified destination starting at the current {@code readerIndex} and increases the {@code readerIndex} by the number of the transferred bytes (= {@code length}). This method is basically same with {@link #readBytes(ByteBuf, int, int)}, except that this method increases the {@code writerIndex} of the destination by the number of the transferred bytes (= {@code length}) while {@link #readBytes(ByteBuf, int, int)} does not.

@throws IndexOutOfBoundsException if {@code length} is greater than {@code this.readableBytes} or if {@code length} is greater than {@code dst.writableBytes}

Meta