content
Current decoded content
DerInputStreampublic class BerInputStream extends Object
| Modifier and Type | Field | Description |
|---|---|---|
protected byte[] |
buffer |
|
int |
choiceIndex |
The last choice index
|
Object |
content |
Current decoded content
|
protected int |
contentOffset |
Current decoded content offset
|
protected static int |
INDEFINIT_LENGTH |
Indicates indefinite length of the current type
|
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.
|
int |
oidElement |
|
int |
tag |
Current decoded tag
|
protected int |
tagOffset |
Current decoded tag offset
|
int[] |
times |
Keeps last decoded: year, month, day, hour, minute, second, millisecond
|
| Constructor | Description |
|---|---|
BerInputStream(byte[] encoded) |
Creates stream for decoding.
|
BerInputStream(byte[] encoded,
int offset,
int expectedLength) |
Creates stream for decoding.
|
BerInputStream(InputStream in) |
Creates stream for decoding.
|
BerInputStream(InputStream in,
int initialSize) |
Creates stream for decoding.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
compactBuffer() |
Reallocates the buffer in order to make it
exactly the size of data it contains
|
Object |
get(Object key) |
|
byte[] |
getBuffer() |
Returns internal buffer used for decoding
|
byte[] |
getEncoded() |
Returns encoded array.
|
int |
getEndOffset() |
Returns end offset for the current encoded type
|
int |
getLength() |
Returns length of the current content for decoding
|
static int |
getLength(byte[] encoding) |
Returns the length of the encoding
|
int |
getOffset() |
Returns the current offset
|
int |
getTagOffset() |
Returns start offset for the current encoded type
|
int |
next() |
Decodes next encoded type.
|
void |
put(Object key,
Object entry) |
|
protected int |
read() |
Reads the next encoded byte from the encoded input stream.
|
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 |
readGeneralizedTime() |
Decodes ASN.1 GeneralizedTime type
|
void |
readInteger() |
Decodes ASN.1 Integer type
|
void |
readOctetString() |
Decodes ASN.1 Octetstring type
|
void |
readOID() |
Decodes ASN.1 ObjectIdentifier type
|
void |
readSequence(ASN1Sequence sequence) |
Decodes ASN.1 Sequence type
|
void |
readSequenceOf(ASN1SequenceOf sequenceOf) |
Decodes ASN.1 SequenceOf type
|
void |
readSet(ASN1Set set) |
Decodes ASN.1 Set type
|
void |
readSetOf(ASN1SetOf setOf) |
Decodes ASN.1 SetOf type
|
void |
readString(ASN1StringType type) |
Decodes ASN.1 String type
|
void |
readUTCTime() |
Decodes ASN.1 UTCTime type
|
void |
reset(byte[] encoded) |
Resets this stream to initial state.
|
void |
setVerify() |
Sets verify mode.
|
content variable holds
a reference to the last created object.
In verify mode a decoded content is not stored.IOExceptionencoded - bytes array to be decodedoffset - the encoding offsetexpectedLength - expected length of full encoding, this includes
identifier, length an content octetsIOExceptionIOExceptioninitialSize - the internal buffer initial sizeIOExceptionencoded - a new bytes array to be decodedIOException - if an error occursIOException - if error occuredIOExceptionIOExceptionIOExceptionIOException - if error occuredIOException - if an I/O error occurs or the end of the stream is reachedIOExceptionIOExceptionIOExceptionIOExceptionIOExceptionIOExceptionIOExceptionIOException - if an I/O error occurs or the end of the stream is reachedIOExceptionIOException