presto-spi/src/main/java/io/prestosql/spi/block/IntArrayBlockBuilder.java/IntArrayBlockBuilder/copyRegion
class IntArrayBlockBuilder:    @Override
    public Block copyRegion(int positionOffset, int length)
    {
        checkValidRegion(getPositionCount(), positionOffset, length);

        if (!hasNonNullValue) {
            return new RunLengthEncodedBlock(NULL_VALUE_BLOCK, length);
        }
        boolean[] newValueIsNull = null;
        if (hasNullValue) {
            newValueIsNull = Arrays.copyOfRange(valueIsNull, positionOffset, positionOffset + length);
        }
        int[] newValues = Arrays.copyOfRange(values, positionOffset, positionOffset + length);
        return new IntArrayBlock(0, length, newValueIsNull, newValues);
    }