001package org.apache.commons.ssl.org.bouncycastle.asn1;
002
003import java.io.IOException;
004import java.io.OutputStream;
005
006public class BERSequenceGenerator
007    extends BERGenerator
008{
009    public BERSequenceGenerator(
010        OutputStream out) 
011        throws IOException
012    {
013        super(out);
014
015        writeBERHeader(BERTags.CONSTRUCTED | BERTags.SEQUENCE);
016    }
017
018    public BERSequenceGenerator(
019        OutputStream out,
020        int tagNo,
021        boolean isExplicit) 
022        throws IOException
023    {
024        super(out, tagNo, isExplicit);
025        
026        writeBERHeader(BERTags.CONSTRUCTED | BERTags.SEQUENCE);
027    }
028
029    public void addObject(
030        ASN1Encodable object)
031        throws IOException
032    {
033        object.toASN1Primitive().encode(new BEROutputStream(_out));
034    }
035    
036    public void close() 
037        throws IOException
038    {
039        writeBEREnd();
040    }
041}