List of utility methods to do BigInteger Parse
BigInteger | getBigInteger(byte[] payload, int offset, int length) get Big Integer byte[] arr = new byte[length + 1]; arr[0] = 0; for (int i = 0; i < length; i++) { arr[i + 1] = payload[offset + length - 1 - i]; return new BigInteger(arr); |
BigInteger | getBigInteger(Console console, Function get Big Integer if (validator == null) validator = value -> true; String answer; BigInteger value; do { answer = readLine(console); try { value = new BigInteger(answer); ... |
BigInteger | getBigInteger(Number number) get Big Integer BigInteger bigInteger = null; if (isByteShortIntegerOrLong(number)) { bigInteger = BigInteger.valueOf(number.longValue()); } else if (isFloatOrDouble(number)) { bigInteger = new BigDecimal(number.doubleValue()).toBigInteger(); } else if (number instanceof BigInteger) { bigInteger = (BigInteger) number; } else if (number instanceof BigDecimal) { ... |
BigInteger | getBigInteger(Number value) Utility method used to convert a Number into a BigInteger. BigInteger result = null; if (value != null) { if (value instanceof BigInteger) { result = (BigInteger) value; } else { result = BigInteger.valueOf(Math.round(value.doubleValue())); return (result); |
BigInteger | getBigInteger(String value) Get big integer from a string. BigInteger bint = null; try { bint = new BigInteger(value); } catch (NumberFormatException e) { return null; return bint; |
BigInteger[] | getBigIntegerArrayFromByteArray(byte[] buf) Convert a byte[] into an instance of our value class. long[] d = getLongArrayFromByteArray(buf); BigInteger[] a = new BigInteger[d.length]; for (int i = 0; i < a.length; i++) { a[i] = BigInteger.valueOf(d[i]); return a; |
BigInteger | getBigIntegerValue(final Integer value) Returns the BigInteger value of the Integer value passed if the value passed is not null, otherwise returns null. BigInteger result = null; if (value != null) { result = BigInteger.valueOf(value); return result; |
String | getBinaryNumberInString(BigInteger integerNumber) This method gets the binary representation of any integer number. The binary representation is returned in String format return integerNumber.toString(BINARY_RADIX);
|
BigInteger | toBigInteger(String bigInteger) Wandelt einen String in einen BigInteger um if (null == bigInteger) return null; BigInteger value = null; try { value = new BigInteger(bigInteger); } catch (NumberFormatException e) { return value; ... |
BigInteger | toBigInteger(String s) to Big Integer return new BigInteger(s); |