presto-orc/src/main/java/io/prestosql/orc/stream/LongInputStream.java/LongInputStream/sum
class LongInputStream:    default long sum(int items)
            throws IOException
    {
        long sum = 0;
        for (int i = 0; i < items; i++) {
            sum += next();
        }
        return sum;
    }