static HttpData wrap(byte[] data, int offset, int length) {
        requireNonNull(data, "data");
        if (offset < 0 || length < 0 || offset > data.length - length) {
            throw new IndexOutOfBoundsException(
                    "offset: " + offset + ", length: " + length + ", data.length: " + data.length);
        }
        if (length == 0) {
            return empty();
        }

        if (data.length == length) {
            return new ByteArrayHttpData(data);
        }

        return new ByteBufHttpData(Unpooled.wrappedBuffer(data, offset, length), false);
    }
Creates a new instance from the specified byte array, {@code offset} and {@code length}.
The array is not copied; any changes made in the array later will be visible to {@link HttpData}.

@return a new {@link HttpData}. {@link #empty()} if {@code length} is 0.

@throws IndexOutOfBoundsException if {@code offset} and {@code length} are out of bounds
core/src/main/java/com/linecorp/armeria/common/HttpData.java