public static long parseLong(byte[] data, int offset, int len)
            throws NumberFormatException {
        int radix = 10;
        long result = 0;
        boolean negative = false;
        //int i = 0, len = data.length;
        int i = offset;
        int to = offset + len;
        long limit = -Long.MAX_VALUE;
        long multmin;
        int digit;

        boolean ok = true;
        if (len > 0) {
            byte firstChar = data[i];
            if (firstChar < '0') { // Possible leading "+" or "-"
                if (firstChar == '-') {
                    negative = true;
                    limit = Long.MIN_VALUE;
                } else if (firstChar != '+')
                    throwNumberFormatException(data, offset, len);

                if (len == 1) // Cannot have lone "+" or "-"
                    throwNumberFormatException(data, offset, len);
                i++;
            }
            multmin = limit / radix;
            while (i < to) {
                // Accumulating negatively avoids surprises near MAX_VALUE
                digit = Character.digit(data[i++], radix);
                if (digit < 0) {
                    ok = false;
                    break;
                    //throwNumberFormatException(data, offset, len);
                }
                if (result < multmin) {
                    ok = false;
                    break;
                    //throwNumberFormatException(data, offset, len);
                }
                result *= radix;
                if (result < limit + digit) {
                    ok = false;
                    break;
                    //throwNumberFormatException(data, offset, len);
                }
                result -= digit;
            }
        } else {
            throwNumberFormatException(data, offset, len);
        }
        if (ok) {
            return negative ? result : -result;
        }

        // try floating point.
        return (long) parseDouble(data, offset, len);
    }
According to {@link Long#parseLong(String)}.
indexr-common/src/main/java/io/indexr/util/UTF8Util.java