Here you can find the source of isLong(BigInteger number)
private static boolean isLong(BigInteger number)
//package com.java2s; //License from project: Apache License import java.math.BigInteger; public class Main { private static boolean isLong(BigInteger number) { long i = number.longValue(); BigInteger b = new BigInteger(String.valueOf(i)); return number.equals(b); }/*from ww w . j a v a2s .c om*/ }