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

package org.bouncycastle.asn1;

import java.io.IOException;
import java.io.OutputStream;

class DLOutputStream extends ASN1OutputStream
{
    DLOutputStream(final OutputStream outputStream) {
        super(outputStream);
    }
    
    @Override
    DLOutputStream getDLSubStream() {
        return this;
    }
    
    @Override
    void writeElements(final ASN1Encodable[] array) throws IOException {
        for (int i = 0; i < array.length; ++i) {
            array[i].toASN1Primitive().toDLObject().encode(this, true);
        }
    }
    
    @Override
    void writePrimitive(final ASN1Primitive asn1Primitive, final boolean b) throws IOException {
        asn1Primitive.toDLObject().encode(this, b);
    }
    
    @Override
    void writePrimitives(final ASN1Primitive[] array) throws IOException {
        for (int length = array.length, i = 0; i < length; ++i) {
            array[i].toDLObject().encode(this, true);
        }
    }
}
