public abstract class AbstractAsn1Reader extends Object implements Asn1Reader
ASN1Reader
which can be used as the basis for
implementing new ASN1 reader implementations.Modifier | Constructor and Description |
---|---|
protected |
AbstractAsn1Reader()
Creates a new abstract ASN.1 reader.
|
Modifier and Type | Method and Description |
---|---|
boolean |
readBoolean(byte type)
Reads the next element as a boolean having the provided type tag.
|
int |
readEnumerated(byte type)
Reads the next element as an enumerated having the provided type tag.
|
long |
readInteger(byte type)
Reads the next element as an integer having the provided type tag.
|
void |
readNull(byte type)
Reads the next element as a null element having the provided type tag.
|
ByteString |
readOctetString(byte type)
Reads the next element as an octet string having the provided type tag.
|
ByteStringBuilder |
readOctetString(byte type,
ByteStringBuilder builder)
Reads the next element as an octet string having the provided type tag
and appends it to the provided
ByteStringBuilder . |
String |
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.
|
void |
readStartExplicitTag(byte type)
Reads the next element as an explicit tag having the provided tag type.
|
void |
readStartSequence(byte type)
Reads the next element as a sequence having the provided type tag.
|
void |
readStartSet(byte type)
Reads the next element as a set having the provided type tag.
|
Asn1Reader |
skipElement(byte expectedType)
Skips the next element having the provided type tag without decoding it.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, elementAvailable, hasNextElement, peekLength, peekType, readBoolean, readEndExplicitTag, readEndSequence, readEndSet, readEnumerated, readInteger, readNull, readOctetString, readOctetString, readOctetStringAsString, readStartExplicitTag, readStartSequence, readStartSet, skipElement
protected AbstractAsn1Reader()
public boolean readBoolean(byte type) throws IOException
Asn1Reader
readBoolean
in interface Asn1Reader
type
- The expected type tag of the element.DecodeException
- If the element cannot be decoded as a boolean.IOException
- If an unexpected IO error occurred.public int readEnumerated(byte type) throws IOException
Asn1Reader
readEnumerated
in interface Asn1Reader
type
- The expected type tag of the element.DecodeException
- If the element cannot be decoded as an enumerated value.IOException
- If an unexpected IO error occurred.public long readInteger(byte type) throws IOException
Asn1Reader
readInteger
in interface Asn1Reader
type
- The expected type tag of the element.DecodeException
- If the element cannot be decoded as an integer.IOException
- If an unexpected IO error occurred.public void readNull(byte type) throws IOException
Asn1Reader
readNull
in interface Asn1Reader
type
- The expected type tag of the element.DecodeException
- If the element cannot be decoded as a null element.IOException
- If an unexpected IO error occurred.public ByteString readOctetString(byte type) throws IOException
Asn1Reader
readOctetString
in interface Asn1Reader
type
- The expected type tag of the element.ByteString
.DecodeException
- If the element cannot be decoded as an octet string.IOException
- If an unexpected IO error occurred.public ByteStringBuilder readOctetString(byte type, ByteStringBuilder builder) throws IOException
Asn1Reader
ByteStringBuilder
.readOctetString
in interface Asn1Reader
type
- The expected type tag of the element.builder
- The ByteStringBuilder
to append the octet string to.builder
.DecodeException
- If the element cannot be decoded as an octet string.IOException
- If an unexpected IO error occurred.public String readOctetStringAsString(byte type) throws IOException
Asn1Reader
readOctetStringAsString
in interface Asn1Reader
type
- The expected type tag of the element.DecodeException
- If the element cannot be decoded as an octet string.IOException
- If an unexpected IO error occurred.public void readStartExplicitTag(byte type) throws IOException
Asn1Reader
Asn1Reader.readEndExplicitTag()
is called.readStartExplicitTag
in interface Asn1Reader
type
- The expected type tag of the element.DecodeException
- If the element cannot be decoded as an explicit tag.IOException
- If an unexpected IO error occurred.public void readStartSequence(byte type) throws IOException
Asn1Reader
Asn1Reader.readEndSequence()
is called.readStartSequence
in interface Asn1Reader
type
- The expected type tag of the element.DecodeException
- If the element cannot be decoded as a sequence.IOException
- If an unexpected IO error occurred.public void readStartSet(byte type) throws IOException
Asn1Reader
Asn1Reader.readEndSet()
is
called.readStartSet
in interface Asn1Reader
type
- The expected type tag of the element.DecodeException
- If the element cannot be decoded as a set.IOException
- If an unexpected IO error occurred.public Asn1Reader skipElement(byte expectedType) throws IOException
Asn1Reader
skipElement
in interface Asn1Reader
expectedType
- The expected type tag of the element.DecodeException
- If the next element does not have the provided type tag.IOException
- If an unexpected IO error occurred.Copyright 2010-2022 ForgeRock AS.