private static String unsignedLongToString(long x, int radix)
    {
        if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX)
        {
            throw new IllegalArgumentException("Invalid radix: " + radix);
        }
        if (x == 0)
        {
            // Simply return "0"
            return "0";
        }
        else
        {
            char[] buf = new char[64];
            int i = buf.length;
            if (x < 0)
            {
                // Separate off the last digit using unsigned division. That will leave
                // a number that is nonnegative as a signed integer.
                long quotient = divide(x, radix);
                long rem = x - quotient * radix;
                buf[--i] = Character.forDigit((int) rem, radix);
                x = quotient;
            }
            // Simple modulo/division approach
            while (x > 0)
            {
                buf[--i] = Character.forDigit((int) (x % radix), radix);
                x /= radix;
            }
            // Generate string
            return new String(buf, i, buf.length - i);
        }
    }
Returns a string representation of {@code x} for the given radix, where {@code x} is treated as unsigned.

@param x
           the value to convert to a string.
@param radix
           the radix to use while working with {@code x}
@throws IllegalArgumentException
            if {@code radix} is not between {@link Character#MIN_RADIX} and {@link Character#MAX_RADIX}.
protostuff-api/src/main/java/io/protostuff/UnsignedNumberUtil.java