public static Object bgl_string_to_integer_obj(byte[] s, int r) { String str = newstring(s); Object res; try { res = BINT(Convert.ToInt32(str, r)); } catch (OverflowException e) { res = new bignum(new BigInteger(str, r)); } return res; }