001package org.apache.commons.ssl.org.bouncycastle.asn1; 002 003import java.io.IOException; 004 005/** 006 * A NULL object. 007 */ 008public class DERNull 009 extends ASN1Null 010{ 011 public static final DERNull INSTANCE = new DERNull(); 012 013 private static final byte[] zeroBytes = new byte[0]; 014 015 /** 016 * @deprecated use DERNull.INSTANCE 017 */ 018 public DERNull() 019 { 020 } 021 022 boolean isConstructed() 023 { 024 return false; 025 } 026 027 int encodedLength() 028 { 029 return 2; 030 } 031 032 void encode( 033 ASN1OutputStream out) 034 throws IOException 035 { 036 out.writeEncoded(BERTags.NULL, zeroBytes); 037 } 038}