Package com.unboundid.asn1
Class ASN1Writer
- java.lang.Object
-
- com.unboundid.asn1.ASN1Writer
-
@ThreadSafety(level=COMPLETELY_THREADSAFE) public final class ASN1Writer extends java.lang.Object
This class provides an efficient mechanism for writing ASN.1 elements to output streams.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
writeElement(ASN1Element element, java.io.OutputStream outputStream)
Writes an encoded representation of the provided ASN.1 element to the given output stream.static void
writeElement(ASN1Element element, java.nio.ByteBuffer buffer)
Appends an encoded representation of the provided ASN.1 element to the given byte buffer.
-
-
-
Method Detail
-
writeElement
public static void writeElement(@NotNull ASN1Element element, @NotNull 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(@NotNull ASN1Element element, @NotNull 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.
-
-