• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.bouncycastle.asn1;
2 
3 import java.io.IOException;
4 import java.io.OutputStream;
5 
6 /**
7  * Stream that outputs encoding based on distinguished encoding rules.
8  */
9 public class DEROutputStream
10     extends ASN1OutputStream
11 {
DEROutputStream( OutputStream os)12     public DEROutputStream(
13         OutputStream    os)
14     {
15         super(os);
16     }
17 
writeObject( ASN1Encodable obj)18     public void writeObject(
19         ASN1Encodable obj)
20         throws IOException
21     {
22         if (obj != null)
23         {
24             obj.toASN1Primitive().toDERObject().encode(this);
25         }
26         else
27         {
28             throw new IOException("null object detected");
29         }
30     }
31 
getDERSubStream()32     ASN1OutputStream getDERSubStream()
33     {
34         return this;
35     }
36 
getDLSubStream()37     ASN1OutputStream getDLSubStream()
38     {
39         return this;
40     }
41 }
42