public String toString(int rdx)
public String toString()
    public String toString(int rdx)    {        if (magnitude == null)        {            return "null";        }        else if (sign == 0)        {            return "0";        }        String s = new String();        String h;        if (rdx == 16)        {            for (int i = 0; i < magnitude.length; i++)            {                h = "0000000" + Integer.toHexString(magnitude[i]);                h = h.substring(h.length() - 8);                s = s + h;            }        }        else        {            // This is algorithm 1a from chapter 4.4 in Seminumerical Algorithms, slow but it works            Stack S = new Stack();            BigInteger base = new BigInteger(Integer.toString(rdx, rdx), rdx);            // The sign is handled separatly.            // Notice however that for this to work, radix 16 _MUST_ be a special case,            // unless we want to enter a recursion well. In their infinite wisdom, why did not             // the Sun engineers made a c'tor for BigIntegers taking a BigInteger as parameter?            // (Answer: Becuase Sun's BigIntger is clonable, something bouncycastle's isn't.)            BigInteger u = new BigInteger(this.abs().toString(16), 16);            BigInteger b;            // For speed, maye these test should look directly a u.magnitude.length?            while (!u.equals(BigInteger.ZERO))            {                b = u.mod(base);                if (b.equals(BigInteger.ZERO))                    S.push("0");                else                    S.push(Integer.toString(b.magnitude[0], rdx));                u = u.divide(base);            }            // Then pop the stack            while (!S.empty())                s = s + S.pop();        }        // Strip leading zeros.        while (s.length() > 1 && s.charAt(0) == '0')            s = s.substring(1);        if (s.length() == 0)            s = "0";        else if (sign == -1)            s = "-" + s;        return s;    }