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

package org.bouncycastle.asn1;

import java.io.IOException;

public class DLBitString extends ASN1BitString
{
    public DLBitString(final byte[] array) {
        this(array, 0);
    }
    
    public DLBitString(final byte b, final int n) {
        super(b, n);
    }
    
    public DLBitString(final byte[] array, final int n) {
        super(array, n);
    }
    
    public DLBitString(final int n) {
        super(ASN1BitString.getBytes(n), ASN1BitString.getPadBits(n));
    }
    
    public DLBitString(final ASN1Encodable asn1Encodable) throws IOException {
        super(asn1Encodable.toASN1Primitive().getEncoded("DER"), 0);
    }
    
    DLBitString(final byte[] array, final boolean b) {
        super(array, b);
    }
    
    @Override
    boolean encodeConstructed() {
        return false;
    }
    
    @Override
    int encodedLength(final boolean b) {
        return ASN1OutputStream.getLengthOfEncodingDL(b, this.contents.length);
    }
    
    @Override
    void encode(final ASN1OutputStream asn1OutputStream, final boolean b) throws IOException {
        asn1OutputStream.writeEncodingDL(b, 3, this.contents);
    }
    
    @Override
    ASN1Primitive toDLObject() {
        return this;
    }
    
    static int encodedLength(final boolean b, final int n) {
        return ASN1OutputStream.getLengthOfEncodingDL(b, n);
    }
    
    static void encode(final ASN1OutputStream asn1OutputStream, final boolean b, final byte[] array, final int n, final int n2) throws IOException {
        asn1OutputStream.writeEncodingDL(b, 3, array, n, n2);
    }
    
    static void encode(final ASN1OutputStream asn1OutputStream, final boolean b, final byte b2, final byte[] array, final int n, final int n2) throws IOException {
        asn1OutputStream.writeEncodingDL(b, 3, b2, array, n, n2);
    }
}
