java.lang.Object | |
↳ | com.microstrategy.utils.BerInputStream |
![]() |
Decodes ASN.1 types encoded with BER (X.690)
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | INDEFINIT_LENGTH | Indicates indefinite length of the current type |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected byte[] | buffer | Internal buffer for storing encoded array | |||||||||
public int | choiceIndex | The last choice index | |||||||||
public Object | content | Current decoded content | |||||||||
protected int | contentOffset | Current decoded content offset | |||||||||
protected InputStream | in | Associated InputStream
|
|||||||||
protected boolean | isIndefinedLength | Indicates defined or indefined reading mode for associated InputStream. | |||||||||
protected boolean | isVerify | Indicates verify or store mode. | |||||||||
protected int | length | Current decoded length | |||||||||
protected int | offset | The position in the buffer. | |||||||||
public int | oidElement | ||||||||||
public int | tag | Current decoded tag | |||||||||
protected int | tagOffset | Current decoded tag offset | |||||||||
public int[] | times | Keeps last decoded: year, month, day, hour, minute, second, millisecond |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BerInputStream(InputStream in)
Creates stream for decoding.
| |||||||||||
BerInputStream(InputStream in, int initialSize)
Creates stream for decoding.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
compactBuffer()
Reallocates the buffer in order to make it
exactly the size of data it contains
| ||||||||||
Object | get(Object key) | ||||||||||
final byte[] |
getBuffer()
Returns internal buffer used for decoding
| ||||||||||
final int | getContentOffset() | ||||||||||
byte[] |
getEncoded()
Returns encoded array.
| ||||||||||
final int |
getEndOffset()
Returns end offset for the current encoded type
| ||||||||||
final int |
getLength()
Returns length of the current content for decoding
| ||||||||||
static int |
getLength(byte[] encoding)
Returns the length of the encoding
| ||||||||||
final int |
getOffset()
Returns the current offset
| ||||||||||
final int |
getTagOffset()
Returns start offset for the current encoded type
| ||||||||||
int |
next()
Decodes next encoded type.
| ||||||||||
void | put(Object key, Object entry) | ||||||||||
void |
readBitString()
Decodes ASN.1 bitstring type
| ||||||||||
void |
readBoolean()
Decodes ASN.1 boolean type
| ||||||||||
void |
readContent()
Reads the next encoded content from the encoded input stream.
| ||||||||||
void |
readEnumerated()
Decodes ASN.1 Enumerated type
| ||||||||||
void |
readOID()
Decodes ASN.1 ObjectIdentifier type
| ||||||||||
void |
readOctetString()
Decodes ASN.1 Octetstring type
| ||||||||||
final void |
setVerify()
Sets verify mode.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int |
read()
Reads the next encoded byte from the encoded input stream.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Indicates indefinite length of the current type
Internal buffer for storing encoded array
The last choice index
Current decoded content
Current decoded content offset
Associated InputStream
Indicates defined or indefined reading mode for associated InputStream. This mode is defined by reading a length for a first ASN.1 type from InputStream.
Indicates verify or store mode.
In store mode a decoded content is stored in a newly allocated
appropriate object. The content
variable holds
a reference to the last created object.
In verify mode a decoded content is not stored.
Current decoded length
The position in the buffer. Next read must place data into the buffer from this offset
Current decoded tag
Current decoded tag offset
Keeps last decoded: year, month, day, hour, minute, second, millisecond
Creates stream for decoding. Allocates initial buffer of default size
in | is associated InputStream
|
---|
IOException |
---|
Creates stream for decoding.
Allocates initial buffer of initialSize
size
in | is associated InputStream |
---|---|
initialSize | the internal buffer initial size |
IOException |
---|
Reallocates the buffer in order to make it exactly the size of data it contains
Returns internal buffer used for decoding
Returns encoded array. MUST be invoked after decoding corresponding ASN.1 notation
Returns end offset for the current encoded type
Returns length of the current content for decoding
Returns the length of the encoding
Returns the current offset
Returns start offset for the current encoded type
Decodes next encoded type. Initializes tag, length, tagOffset and contentOffset variables
IOException | - if error occured |
---|
Decodes ASN.1 bitstring type
IOException | - if error occured |
---|
Decodes ASN.1 boolean type
IOException | - if error occured |
---|
Reads the next encoded content from the encoded input stream. The method MUST be used for reading a primitive encoded content.
IOException | - if error occured |
---|
Decodes ASN.1 Enumerated type
IOException | - if error occured |
---|
Decodes ASN.1 ObjectIdentifier type
IOException | - if error occured |
---|
Decodes ASN.1 Octetstring type
IOException | - if error occured |
---|
Sets verify mode.
Reads the next encoded byte from the encoded input stream.
IOException | - if error occured |
---|