com.unboundid.asn1
Class ASN1Writer

java.lang.Object
  extended by com.unboundid.asn1.ASN1Writer

public final class ASN1Writer
extends java.lang.Object

This class provides an efficient mechanism for writing ASN.1 elements to output streams.


Method Summary
static void writeElement(ASN1Element element, java.nio.ByteBuffer buffer)
          Appends an encoded representation of the provided ASN.1 element to the given byte buffer.
static void writeElement(ASN1Element element, java.io.OutputStream outputStream)
          Writes an encoded representation of the provided ASN.1 element to the given output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

writeElement

public static void writeElement(ASN1Element element,
                                java.io.OutputStream outputStream)
                         throws java.io.IOException
Writes an encoded representation of the provided ASN.1 element to the given output stream.

Parameters:
element - The ASN.1 element to be written.
outputStream - The output stream to which the encoded representation of the element should be written.
Throws:
java.io.IOException - If a problem occurs while writing the element.

writeElement

public static void writeElement(ASN1Element element,
                                java.nio.ByteBuffer buffer)
                         throws java.nio.BufferOverflowException
Appends an encoded representation of the provided ASN.1 element to the given byte buffer. When this method completes, the position will be at the beginning of the written element, and the limit will be at the end.

Parameters:
element - The ASN.1 element to be written.
buffer - The buffer to which the element should be added.
Throws:
java.nio.BufferOverflowException - If the provided buffer does not have enough space between the position and the limit to hold the encoded element.