1 17 18 package org.apache.geronimo.util.asn1; 19 20 import java.io.IOException ; 21 import java.io.OutputStream ; 22 23 public class ASN1OutputStream 24 extends DEROutputStream 25 { 26 public ASN1OutputStream( 27 OutputStream os) 28 { 29 super(os); 30 } 31 32 public void writeObject( 33 Object obj) 34 throws IOException  35 { 36 if (obj == null) 37 { 38 writeNull(); 39 } 40 else if (obj instanceof DERObject) 41 { 42 ((DERObject)obj).encode(this); 43 } 44 else if (obj instanceof DEREncodable) 45 { 46 ((DEREncodable)obj).getDERObject().encode(this); 47 } 48 else 49 { 50 throw new IOException ("object not ASN1Encodable"); 51 } 52 } 53 } 54 | Popular Tags |