Java BigInteger Parse ToBigInteger(String s)

Here you can find the source of ToBigInteger(String s)

Description

To Big Integer

License

Apache License

Declaration

private static final BigInteger ToBigInteger(String s) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.math.BigInteger;

public class Main {
    private static final BigInteger ToBigInteger(String s) {

        if (ToString(s).isEmpty()) {
            return null;
        }//from  www .  j av  a  2  s .c o  m

        return new BigInteger(ToString(s));
    }

    public static final BigInteger ToBigInteger(Object o) {
        return ToBigInteger(ToString(o));
    }

    public static final String ToString(Object o) {
        return o != null ? o.toString() : "";
    }

    public static final String ToString(String s) {
        return s != null ? s : "";
    }
}

Related

  1. getBigIntegerArrayFromByteArray(byte[] buf)
  2. getBigIntegerValue(final Integer value)
  3. getBinaryNumberInString(BigInteger integerNumber)
  4. toBigInteger(String bigInteger)
  5. toBigInteger(String s)
  6. toBigInteger(String text)
  7. toBigInteger(String value, BigInteger defaultValue)
  8. toBigIntegerString(byte[] bytes, boolean signed, boolean littleEndian)