docs: public static final int parseInt(CharSequence cs, int radix, int beginIndex, int endIndex)
      {
          int size = Integer.SIZE;
          int end = endIndex;
          boolean twoComp = false;
          if (radix < 0)
          {
              twoComp = true;
              radix = -radix;
              check(cs, size, beginIndex, endIndex);
          }
          else
          {
              check(cs, radix, NumberRanges.IntRange, beginIndex, endIndex);
          }
          int result = 0;
          int sign = -1;
          int index = beginIndex;
          int cp = Character.codePointAt(cs, index);
          if (cp == '+')
          {
              if (twoComp)
              {
                  throw new NumberFormatException("no signs for 2-complement "+cs.subSequence(beginIndex, endIndex));
              }
              index++;
          }
          if (cp == '-')
          {
              if (twoComp)
              {
                  throw new NumberFormatException("no signs for 2-complement "+cs.subSequence(beginIndex, endIndex));
              }
              sign = 1;
              index++;
          }
          if (index >= end)
          {
              throw new NumberFormatException("unparsable number "+cs.subSequence(beginIndex, endIndex));
          }
          int count = Character.codePointCount(cs, index, end);
          if (count == size)
          {
              twoComp = false;
          }
          while (index < end)
          {
              result *= radix;
              cp = Character.codePointAt(cs, index);
              int digit = Character.digit(cp, radix);
              if (digit == -1)
              {
                  throw new NumberFormatException("unparsable number "+cs.subSequence(beginIndex, endIndex));
              }
              result -= digit;
              if (Character.isBmpCodePoint(cp))
              {
                  index++;
              }
              else
              {
                  index += 2;
              }
          }
          if (!twoComp || -result < (1<<(count-1)))
          {
              return sign*result;
          }
          else
          {
              return -result + (-1<<count);
          }
      }