1 17 18 package org.apache.geronimo.util.asn1; 19 20 import java.io.ByteArrayOutputStream ; 21 import java.io.IOException ; 22 import java.util.Enumeration ; 23 24 27 public class DERConstructedSequence 28 extends ASN1Sequence 29 { 30 public void addObject( 31 DEREncodable obj) 32 { 33 super.addObject(obj); 34 } 35 36 public int getSize() 37 { 38 return size(); 39 } 40 41 49 void encode( 50 DEROutputStream out) 51 throws IOException 52 { 53 ByteArrayOutputStream bOut = new ByteArrayOutputStream (); 54 DEROutputStream dOut = new DEROutputStream(bOut); 55 Enumeration e = this.getObjects(); 56 57 while (e.hasMoreElements()) 58 { 59 Object obj = e.nextElement(); 60 61 dOut.writeObject(obj); 62 } 63 64 dOut.close(); 65 66 byte[] bytes = bOut.toByteArray(); 67 68 out.writeEncoded(SEQUENCE | CONSTRUCTED, bytes); 69 } 70 } 71 | Popular Tags |