Package com.unboundid.asn1
Class ASN1Writer
java.lang.Object
com.unboundid.asn1.ASN1Writer
This class provides an efficient mechanism for writing ASN.1 elements to
output streams.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidwriteElement(ASN1Element element, OutputStream outputStream) Writes an encoded representation of the provided ASN.1 element to the given output stream.static voidwriteElement(ASN1Element element, ByteBuffer buffer) Appends an encoded representation of the provided ASN.1 element to the given byte buffer.
-
Method Details
-
writeElement
public static void writeElement(@NotNull ASN1Element element, @NotNull OutputStream outputStream) throws 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:
IOException- If a problem occurs while writing the element.
-
writeElement
public static void writeElement(@NotNull ASN1Element element, @NotNull ByteBuffer buffer) throws 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:
BufferOverflowException- If the provided buffer does not have enough space between the position and the limit to hold the encoded element.
-