1package org.bouncycastle.asn1;
2
3import java.io.IOException;
4import java.util.Enumeration;
5
6/**
7 * @deprecated use BERSequence
8 */
9public class BERConstructedSequence
10    extends DERConstructedSequence
11{
12    /*
13     */
14    void encode(
15        DEROutputStream out)
16        throws IOException
17    {
18        if (out instanceof ASN1OutputStream || out instanceof BEROutputStream)
19        {
20            out.write(SEQUENCE | CONSTRUCTED);
21            out.write(0x80);
22
23            Enumeration e = getObjects();
24            while (e.hasMoreElements())
25            {
26                out.writeObject(e.nextElement());
27            }
28
29            out.write(0x00);
30            out.write(0x00);
31        }
32        else
33        {
34            super.encode(out);
35        }
36    }
37}
38