Unfortunately, you need to use BigInteger or write your own procedure.
Here is an unsigned class that helps with these workarounds
private static final BigInteger BI_2_64 = BigInteger.ONE.shiftLeft(64); public static String asString(long l) { return l >= 0 ? String.valueOf(l) : toBigInteger(l).toString(); } public static BigInteger toBigInteger(long l) { final BigInteger bi = BigInteger.valueOf(l); return l >= 0 ? bi : bi.add(BI_2_64); }
Peter Lawrey
source share