code: protected int digit(int pos, int base) {
          char c = ch;
          if ('0' <= c && c <= '9')
              return Character.digit(c, base); //a fast common case
          int codePoint = peekSurrogates();
          int result = codePoint >= 0 ? Character.digit(codePoint, base) : Character.digit(c, base);
          if (result >= 0 && c > 0x7f) {
              log.error(pos + 1, "illegal.nonascii.digit");
              if (codePoint >= 0)
                  scanChar();
              ch = "0123456789abcdef".charAt(result);
          }
          return result;
      }
docs: Convert an ASCII digit from its base (8, 10, or 16)
  to its value.