Code example for BigInteger

Methods: toByteArray

0
        baos.write(b.length);
        baos.write(b, 0, b.length);
 
        baos.write(2);
        System.arraycopy(sig, 20, tmp, 0, 20);
        BigInteger s = new BigInteger(1, tmp);
        b = s.toByteArray();
        baos.write(b.length);
        baos.write(b, 0, b.length);
        byte[] rv = baos.toByteArray();
        rv[1] = (byte) (rv.length - 2);
        //System.out.println("post TO asn1\n" + net.i2p.util.HexDump.dump(rv)); 
        return rv;
    } 
 
    /** 
     *  See above. 
     *  @since 0.8.7 
     */ 
    private static byte[] aSN1ToSigBytes(byte[] asn) {
        //System.out.println("pre from asn1\n" + net.i2p.util.HexDump.dump(asn));