Package org.forgerock.opendj.io
Class AbstractASN1Writer
java.lang.Object
org.forgerock.opendj.io.AbstractASN1Writer
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,ASN1Writer
An abstract
ASN1Writer which can be used as the basis for
implementing new ASN1 writer implementations.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new abstract ASN.1 writer. -
Method Summary
Modifier and TypeMethodDescriptionwriteBoolean(boolean value) Writes a boolean element using the Universal Boolean ASN.1 type tag.writeEnumerated(int value) Writes an enumerated element using the Universal Enumerated ASN.1 type tag.writeInteger(int value) Writes an integer element using the Universal Integer ASN.1 type tag.writeInteger(long value) Writes an integer element using the Universal Integer ASN.1 type tag.Writes a null element using the Universal Null ASN.1 type tag.writeOctetString(byte[] value) Writes an octet string element using the Universal Octet String ASN.1 type tag.writeOctetString(byte[] value, int offset, int length) Writes an octet string element using the Universal Octet String ASN.1 type tag.writeOctetString(byte type, byte[] value) Writes an octet string element using the provided type tag.writeOctetString(String value) Writes a string as a UTF-8 encoded octet string element using the Universal Octet String ASN.1 type tag.writeOctetString(ByteSequence value) Writes an octet string element using the Universal Octet String ASN.1 type tag.Writes a sequence element using the Universal Sequence ASN.1 type tag.Writes a set element using the Universal Set ASN.1 type tag.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.forgerock.opendj.io.ASN1Writer
close, flush, writeBoolean, writeEndSequence, writeEndSet, writeEnumerated, writeInteger, writeInteger, writeNull, writeOctetString, writeOctetString, writeOctetString, writeStartSequence, writeStartSet
-
Constructor Details
-
AbstractASN1Writer
protected AbstractASN1Writer()Creates a new abstract ASN.1 writer.
-
-
Method Details
-
writeBoolean
Description copied from interface:ASN1WriterWrites a boolean element using the Universal Boolean ASN.1 type tag.- Specified by:
writeBooleanin interfaceASN1Writer- Parameters:
value- The boolean value.- Returns:
- A reference to this ASN.1 writer.
- Throws:
IOException- If an error occurs while writing the element.
-
writeEnumerated
Description copied from interface:ASN1WriterWrites an enumerated element using the Universal Enumerated ASN.1 type tag.- Specified by:
writeEnumeratedin interfaceASN1Writer- Parameters:
value- The enumerated value.- Returns:
- A reference to this ASN.1 writer.
- Throws:
IOException- If an error occurs while writing the element.
-
writeInteger
Description copied from interface:ASN1WriterWrites an integer element using the Universal Integer ASN.1 type tag.- Specified by:
writeIntegerin interfaceASN1Writer- Parameters:
value- The integer value.- Returns:
- A reference to this ASN.1 writer.
- Throws:
IOException- If an error occurs while writing the element.
-
writeInteger
Description copied from interface:ASN1WriterWrites an integer element using the Universal Integer ASN.1 type tag.- Specified by:
writeIntegerin interfaceASN1Writer- Parameters:
value- The integer value.- Returns:
- A reference to this ASN.1 writer.
- Throws:
IOException- If an error occurs while writing the element.
-
writeNull
Description copied from interface:ASN1WriterWrites a null element using the Universal Null ASN.1 type tag.- Specified by:
writeNullin interfaceASN1Writer- Returns:
- A reference to this ASN.1 writer.
- Throws:
IOException- If an error occurs while writing the element.
-
writeOctetString
Description copied from interface:ASN1WriterWrites an octet string element using the provided type tag.- Specified by:
writeOctetStringin interfaceASN1Writer- Parameters:
type- The type tag of the element.value- The byte array containing the octet string data.- Returns:
- A reference to this ASN.1 writer.
- Throws:
IOException- If an error occurs while writing the element.
-
writeOctetString
Description copied from interface:ASN1WriterWrites an octet string element using the Universal Octet String ASN.1 type tag.- Specified by:
writeOctetStringin interfaceASN1Writer- Parameters:
value- The byte array containing the octet string data.- Returns:
- A reference to this ASN.1 writer.
- Throws:
IOException- If an error occurs while writing the element.
-
writeOctetString
Description copied from interface:ASN1WriterWrites an octet string element using the Universal Octet String ASN.1 type tag.- Specified by:
writeOctetStringin interfaceASN1Writer- Parameters:
value- The byte array containing the octet string data.offset- The offset in the byte array.length- The number of bytes to write.- Returns:
- A reference to this ASN.1 writer.
- Throws:
IOException- If an error occurs while writing the element.
-
writeOctetString
Description copied from interface:ASN1WriterWrites an octet string element using the Universal Octet String ASN.1 type tag.- Specified by:
writeOctetStringin interfaceASN1Writer- Parameters:
value- The octet string value.- Returns:
- A reference to this ASN.1 writer.
- Throws:
IOException- If an error occurs while writing the element.
-
writeOctetString
Description copied from interface:ASN1WriterWrites a string as a UTF-8 encoded octet string element using the Universal Octet String ASN.1 type tag.- Specified by:
writeOctetStringin interfaceASN1Writer- Parameters:
value- The string to be written as a UTF-8 encoded octet string.- Returns:
- A reference to this ASN.1 writer.
- Throws:
IOException- If an error occurs while writing the element.
-
writeStartSequence
Description copied from interface:ASN1WriterWrites a sequence element using the Universal Sequence ASN.1 type tag. All further writes will append elements to the sequence untilASN1Writer.writeEndSequence()is called.- Specified by:
writeStartSequencein interfaceASN1Writer- Returns:
- A reference to this ASN.1 writer.
- Throws:
IOException- If an error occurs while writing the element.
-
writeStartSet
Description copied from interface:ASN1WriterWrites a set element using the Universal Set ASN.1 type tag. All further writes will append elements to the set untilASN1Writer.writeEndSet()is called.- Specified by:
writeStartSetin interfaceASN1Writer- Returns:
- A reference to this ASN.1 writer.
- Throws:
IOException- If an error occurs while writing the element.
-