presto-rcfile/src/main/java/io/prestosql/rcfile/text/LongEncoding.java/LongEncoding/parseLong
class LongEncoding:    private static long parseLong(Slice slice, int start, int length)
    {
        if (slice.equals(start, length, MIN_LONG, 0, MIN_LONG.length())) {
            return Long.MIN_VALUE;
        }

        int limit = start + length;

        int sign;
        if (slice.getByte(start) == '-') {
            sign = -1;
            start++;
        }
        else {
            sign = 1;
        }

        long value = slice.getByte(start) - ((int) '0');
        start++;
        while (start < limit) {
            value = value * 10 + (slice.getByte(start) - ((int) '0'));
            start++;
        }

        return value * sign;
    }