1 package org.bouncycastle.asn1;
5 public class DEROutputStream
6 extends FilterOutputStream implements DERTags
8 public DEROutputStream(
14 private void writeLength(
23 while ((val >>>= 8) != 0)
28 write((byte)(size | 0x80));
30 for (int i = (size - 1) * 8; i >= 0; i -= 8)
32 write((byte)(length >> i));
47 writeLength(bytes.length);
51 protected void writeNull()
58 public void writeObject(
66 else if (obj instanceof DERObject)
68 ((DERObject)obj).encode(this);
70 else if (obj instanceof DEREncodable)
72 ((DEREncodable)obj).getDERObject().encode(this);
76 throw new IOException("object not DEREncodable");