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

        return new ByteArrayHttpData(Arrays.copyOfRange(data, offset, offset + length));
    }
Creates a new instance from the specified byte array, {@code offset} and {@code length} by first copying
it.

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

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