    001package org.apache.commons.ssl.asn1;
    002
    003import java.io.IOException;
    004
    005/** A BER NULL object. */
    006public class BERNull
    007    extends DERNull {
    008    public static final BERNull INSTANCE = new BERNull();
    009
    010    public BERNull() {
    011    }
    012
    013    void encode(
    014        DEROutputStream out)
    015        throws IOException {
    016        if (out instanceof ASN1OutputStream || out instanceof BEROutputStream) {
    017            out.write(NULL);
    018        } else {
    019            super.encode(out);
    020        }
    021    }
    022}