// 
// Decompiled by Procyon v0.6.0
// 

package org.bouncycastle.asn1;

import java.io.IOException;

public class BERSequence extends ASN1Sequence
{
    public BERSequence() {
    }
    
    public BERSequence(final ASN1Encodable asn1Encodable) {
        super(asn1Encodable);
    }
    
    public BERSequence(final ASN1Encodable asn1Encodable, final ASN1Encodable asn1Encodable2) {
        super(asn1Encodable, asn1Encodable2);
    }
    
    public BERSequence(final ASN1EncodableVector asn1EncodableVector) {
        super(asn1EncodableVector);
    }
    
    public BERSequence(final ASN1Encodable[] array) {
        super(array);
    }
    
    @Override
    int encodedLength(final boolean b) throws IOException {
        int n = b ? 4 : 3;
        for (int i = 0; i < this.elements.length; ++i) {
            n += this.elements[i].toASN1Primitive().encodedLength(true);
        }
        return n;
    }
    
    @Override
    void encode(final ASN1OutputStream asn1OutputStream, final boolean b) throws IOException {
        asn1OutputStream.writeEncodingIL(b, 48, this.elements);
    }
    
    @Override
    ASN1BitString toASN1BitString() {
        return new BERBitString(this.getConstructedBitStrings());
    }
    
    @Override
    ASN1External toASN1External() {
        return ((ASN1Sequence)this.toDLObject()).toASN1External();
    }
    
    @Override
    ASN1OctetString toASN1OctetString() {
        return new BEROctetString(this.getConstructedOctetStrings());
    }
    
    @Override
    ASN1Set toASN1Set() {
        return new BERSet(false, this.toArrayInternal());
    }
}
