package org.bouncycastle.asn1.util;

import java.io.FileInputStream;

import org.bouncycastle.asn1.ASN1InputStream;

/**
 * Command line ASN.1 Dump utility.
 * <p>
 *     Usage: org.bouncycastle.asn1.util.Dump ber_encoded_file
 * </p>
 */
public class Dump
{
    public static void main(
        String args[])
        throws Exception
    {
        FileInputStream fIn = new FileInputStream(args[0]);
        ASN1InputStream bIn = new ASN1InputStream(fIn);
        Object          obj = null;

        while ((obj = bIn.readObject()) != null)
        {
            System.out.println(ASN1Dump.dumpAsString(obj));
        }

        fIn.close();
    }
}

@@ -395,16 +395,43 @@
 gs%5B0%5D);%0A
+%0A        try%0A        %7B%0A    
         
@@ -490,24 +490,19 @@
     
+    
 Object 
-         
 obj 
@@ -518,16 +518,20 @@
         
+    
 while ((
@@ -563,34 +563,42 @@
 = null)%0A        
+   
+ 
 %7B%0A
+    
             Syst
@@ -653,11 +653,54 @@
     
+ 
-%7D%0A%0A
+   %7D%0A        %7D%0A        finally%0A        %7B%0A    
     
@@ -716,16 +716,26 @@
 lose();%0A
+        %7D%0A
     %7D%0A%7D%0A

put close() in a finally block.