private static BigInteger toUnsignedBigInteger(long i) {
        if (i >= 0L)
            return BigInteger.valueOf(i);
        else {
            int upper = (int) (i >>> 32);
            int lower = (int) i;

            // return (upper << 32) + lower
            return (BigInteger.valueOf(Integer.toUnsignedLong(upper))).shiftLeft(32).
                add(BigInteger.valueOf(Integer.toUnsignedLong(lower)));
        }
    }
private static BigInteger toUnsignedBigInteger ( long i ) { if ( i >= 0L ) return BigInteger . valueOf ( i ) ; else { int upper = ( int ) ( i > > > 32 ) ; int lower = ( int ) i ; return ( BigInteger . valueOf ( Integer . toUnsignedLong ( upper ) ) ) . shiftLeft ( 32 ) . add ( BigInteger . valueOf ( Integer . toUnsignedLong ( lower ) ) ) ; } }
Return a BigInteger equal to the unsigned value of the
argument.