1 17 18 package org.apache.geronimo.util.asn1; 19 20 import java.io.IOException ; 21 import java.util.Enumeration ; 22 23 public class BERSet 24 extends DERSet 25 { 26 29 public BERSet() 30 { 31 } 32 33 36 public BERSet( 37 DEREncodable obj) 38 { 39 super(obj); 40 } 41 42 45 public BERSet( 46 DEREncodableVector v) 47 { 48 super(v, true); 49 } 50 51 54 BERSet( 55 DEREncodableVector v, 56 boolean needsSorting) 57 { 58 super(v, needsSorting); 59 } 60 61 63 void encode( 64 DEROutputStream out) 65 throws IOException 66 { 67 if (out instanceof ASN1OutputStream || out instanceof BEROutputStream) 68 { 69 out.write(SET | CONSTRUCTED); 70 out.write(0x80); 71 72 Enumeration e = getObjects(); 73 while (e.hasMoreElements()) 74 { 75 out.writeObject(e.nextElement()); 76 } 77 78 out.write(0x00); 79 out.write(0x00); 80 } 81 else 82 { 83 super.encode(out); 84 } 85 } 86 } 87 | Popular Tags |