Package org.forgerock.opendj.io
Class AbstractASN1Reader
java.lang.Object
org.forgerock.opendj.io.AbstractASN1Reader
- All Implemented Interfaces:
Closeable,AutoCloseable,ASN1Reader
An abstract
ASN1Reader which can be used as the basis for
implementing new ASN1 reader implementations.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new abstract ASN.1 reader. -
Method Summary
Modifier and TypeMethodDescriptionbooleanreadBoolean(byte type) Reads the next element as a boolean having the provided type tag.intreadEnumerated(byte type) Reads the next element as an enumerated having the provided type tag.longreadInteger(byte type) Reads the next element as an integer having the provided type tag.voidreadNull(byte type) Reads the next element as a null element having the provided type tag.readOctetString(byte type) Reads the next element as an octet string having the provided type tag.readOctetString(byte type, ByteStringBuilder builder) Reads the next element as an octet string having the provided type tag and appends it to the providedByteStringBuilder.readOctetStringAsString(byte type) Reads the next element as an octet string having the provided type tag and decodes the value as a UTF-8 encoded string.voidreadStartExplicitTag(byte type) Reads the next element as an explicit tag having the provided tag type.voidreadStartSequence(byte type) Reads the next element as a sequence having the provided type tag.voidreadStartSet(byte type) Reads the next element as a set having the provided type tag.skipElement(byte expectedType) Skips the next element having the provided type tag without decoding it.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.ASN1Reader
close, elementAvailable, hasNextElement, peekLength, peekType, readBoolean, readEndExplicitTag, readEndSequence, readEndSet, readEnumerated, readInteger, readNull, readOctetString, readOctetString, readOctetStringAsString, readStartExplicitTag, readStartSequence, readStartSet, skipElement
-
Constructor Details
-
AbstractASN1Reader
protected AbstractASN1Reader()Creates a new abstract ASN.1 reader.
-
-
Method Details
-
readBoolean
Description copied from interface:ASN1ReaderReads the next element as a boolean having the provided type tag.- Specified by:
readBooleanin interfaceASN1Reader- Parameters:
type- The expected type tag of the element.- Returns:
- The decoded boolean value.
- Throws:
IOException- If an unexpected IO error occurred.
-
readEnumerated
Description copied from interface:ASN1ReaderReads the next element as an enumerated having the provided type tag.- Specified by:
readEnumeratedin interfaceASN1Reader- Parameters:
type- The expected type tag of the element.- Returns:
- The decoded enumerated value.
- Throws:
IOException- If an unexpected IO error occurred.
-
readInteger
Description copied from interface:ASN1ReaderReads the next element as an integer having the provided type tag.- Specified by:
readIntegerin interfaceASN1Reader- Parameters:
type- The expected type tag of the element.- Returns:
- The decoded integer value.
- Throws:
IOException- If an unexpected IO error occurred.
-
readNull
Description copied from interface:ASN1ReaderReads the next element as a null element having the provided type tag.- Specified by:
readNullin interfaceASN1Reader- Parameters:
type- The expected type tag of the element.- Throws:
IOException- If an unexpected IO error occurred.
-
readOctetString
Description copied from interface:ASN1ReaderReads the next element as an octet string having the provided type tag.- Specified by:
readOctetStringin interfaceASN1Reader- Parameters:
type- The expected type tag of the element.- Returns:
- The decoded octet string represented using a
ByteString. - Throws:
IOException- If an unexpected IO error occurred.
-
readOctetString
Description copied from interface:ASN1ReaderReads the next element as an octet string having the provided type tag and appends it to the providedByteStringBuilder.- Specified by:
readOctetStringin interfaceASN1Reader- Parameters:
type- The expected type tag of the element.builder- TheByteStringBuilderto append the octet string to.- Returns:
- A reference to
builder. - Throws:
IOException- If an unexpected IO error occurred.
-
readOctetStringAsString
Description copied from interface:ASN1ReaderReads the next element as an octet string having the provided type tag and decodes the value as a UTF-8 encoded string.- Specified by:
readOctetStringAsStringin interfaceASN1Reader- Parameters:
type- The expected type tag of the element.- Returns:
- The decoded octet string as a UTF-8 encoded string.
- Throws:
IOException- If an unexpected IO error occurred.
-
readStartExplicitTag
Description copied from interface:ASN1ReaderReads the next element as an explicit tag having the provided tag type. All further reads will read the elements in the explicit tag untilASN1Reader.readEndExplicitTag()is called.- Specified by:
readStartExplicitTagin interfaceASN1Reader- Parameters:
type- The expected type tag of the element.- Throws:
IOException- If an unexpected IO error occurred.
-
readStartSequence
Description copied from interface:ASN1ReaderReads the next element as a sequence having the provided type tag. All further reads will read the elements in the sequence untilASN1Reader.readEndSequence()is called.- Specified by:
readStartSequencein interfaceASN1Reader- Parameters:
type- The expected type tag of the element.- Throws:
IOException- If an unexpected IO error occurred.
-
readStartSet
Description copied from interface:ASN1ReaderReads the next element as a set having the provided type tag. All further reads will read the elements in the set untilASN1Reader.readEndSet()is called.- Specified by:
readStartSetin interfaceASN1Reader- Parameters:
type- The expected type tag of the element.- Throws:
IOException- If an unexpected IO error occurred.
-
skipElement
Description copied from interface:ASN1ReaderSkips the next element having the provided type tag without decoding it.- Specified by:
skipElementin interfaceASN1Reader- Parameters:
expectedType- The expected type tag of the element.- Returns:
- A reference to this ASN.1 reader.
- Throws:
IOException- If an unexpected IO error occurred.
-