FileDocCategorySizeDatePackage
BigIntegers.javaAPI DocAndroid 1.5 API727Wed May 06 22:41:06 BST 2009org.bouncycastle.util

BigIntegers

public final class BigIntegers extends Object
BigInteger utilities.

Fields Summary
Constructors Summary
Methods Summary
public static byte[]asUnsignedByteArray(java.math.BigInteger value)
Return the passed in value as an unsigned byte array.

param
value value to be converted.
return
a byte array without a leading zero byte if present in the signed encoding.

        byte[] bytes = value.toByteArray();
        
        if (bytes[0] == 0)
        {
            byte[] tmp = new byte[bytes.length - 1];
            
            System.arraycopy(bytes, 1, tmp, 0, tmp.length);
            
            return tmp;
        }
        
        return bytes;