public int intValueExact ()

Converts this BigInteger to an int, checking for lost information. If the value of this BigInteger is out of the range of the int type, then an ArithmeticException is thrown.

Returns:  this BigInteger converted to an int.

ArithmeticException    if the value of this will not exactly fit in an int.

See also:

Since:  1.8