1package org.bouncycastle.asn1;
2
3import java.io.IOException;
4
5/**
6 * A NULL object.
7 */
8public class DERNull
9    extends ASN1Null
10{
11    public static final DERNull INSTANCE = new DERNull();
12
13    private static final byte[]  zeroBytes = new byte[0];
14
15    /**
16     * @deprecated use DERNull.INSTANCE
17     */
18    // Android-changed: Reduce visibility to protected.
19    protected DERNull()
20    {
21    }
22
23    boolean isConstructed()
24    {
25        return false;
26    }
27
28    int encodedLength()
29    {
30        return 2;
31    }
32
33    void encode(
34        ASN1OutputStream out)
35        throws IOException
36    {
37        out.writeEncoded(BERTags.NULL, zeroBytes);
38    }
39}
40