code: static int parseIntFromReference(final String text, final int start, final int end, final int radix) {
          int result = 0;
          for (int i = start; i < end; i++) {
              final char c = text.charAt(i);
              int n = -1;
              for (int j = 0; j < HEXA_CHARS_UPPER.length; j++) {
                  if (c == HEXA_CHARS_UPPER[j] || c == HEXA_CHARS_LOWER[j]) {
                      n = j;
                      break;
                  }
              }
              result *= radix;
              if (result < 0) {
                  return 0xFFFD;
              }
              result += n;
              if (result < 0) {
                  return 0xFFFD;
              }
          }
          return result;
      }
docs: /*
  This methods (the two versions) are used instead of Integer.parseInt(str,radix) in order to avoid the need
  to create substrings of the text being unescaped to feed such method.
  -  No need to check all chars are within the radix limits - reference parsing code will already have done so.