@@ -0,0 +1,962 @@
+class TestVarint %7B%0A    // Hex print helper%0A    final protected static char%5B%5D hexArray = %220123456789ABCDEF%22.toCharArray();%0A    public static String bytesToHex(byte%5B%5D bytes) %7B%0A        char%5B%5D hexChars = new char%5Bbytes.length * 2%5D;%0A        for ( int j = 0; j %3C bytes.length; j++ ) %7B%0A            int v = bytes%5Bj%5D & 0xFF;%0A            hexChars%5Bj * 2%5D = hexArray%5Bv %3E%3E%3E 4%5D;%0A            hexChars%5Bj * 2 + 1%5D = hexArray%5Bv & 0x0F%5D;%0A        %7D%0A        return new String(hexChars);%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        if (args.length %3E 0) %7B%0A            System.out.println(%0A                    bytesToHex(%0A                        new java.math.BigInteger(args%5B0%5D).toByteArray()%0A                    )%0A            );%0A        %7D else %7B%0A            System.out.println(%22Encode Java BigInteger Varints & print them as hex%22);%0A            System.out.println(%22Usage: java TestVarint %3Cn%3E%22);%0A            System.out.println(%22  where n is a number%22);%0A        %7D%0A    %7D%0A%7D%0A

Add a Java BigInteger varint to hex utility