If you use this class for keeping Integer values and convert them into int type you need checking the returned value if it is too big for integer. According to specification, soft warning is shown but many developers omit this information mostly.
intValue
public int intValue()
Converts this BigInteger to an
int
. This conversion is analogous to a narrowing primitive conversion from long
to int
as defined in section 5.1.3 of The Java™ Language Specification: if this BigInteger is too big to fit in an int
, only the low-order 32 bits are returned. Note that this conversion can lose information about the overall magnitude of the BigInteger value as well as return a result with the opposite sign.