presto-spi/src/main/java/io/prestosql/spi/block/BlockUtil.java/BlockUtil/checkArrayRange
class BlockUtil:    static void checkArrayRange(int[] array, int offset, int length)
    {
        requireNonNull(array, "array is null");
        if (offset < 0 || length < 0 || offset + length > array.length) {
            throw new IndexOutOfBoundsException(format("Invalid offset %s and length %s in array with %s elements", offset, length, array.length));
        }
    }