| |
|
| java.lang.Object org.apache.harmony.security.asn1.BerInputStream
All known Subclasses: org.apache.harmony.security.asn1.DerInputStream,
BerInputStream | public class BerInputStream (Code) | | Decodes ASN.1 types encoded with BER (X.690)
See Also: http://asn1.elibel.tm.fr/en/standards/index.htm |
INDEFINIT_LENGTH | final protected static int INDEFINIT_LENGTH(Code) | | Indicates indefinite length of the current type
|
buffer | protected byte[] buffer(Code) | | Internal buffer for storing encoded array
|
choiceIndex | public int choiceIndex(Code) | | The last choice index
|
contentOffset | protected int contentOffset(Code) | | Current decoded content offset
|
isIndefinedLength | protected boolean isIndefinedLength(Code) | | 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.
|
isVerify | protected boolean isVerify(Code) | | 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.
|
length | protected int length(Code) | | Current decoded length
|
offset | protected int offset(Code) | | The position in the buffer.
Next read must place data into the buffer from this offset
|
oidElement | public int oidElement(Code) | | |
tag | public int tag(Code) | | Current decoded tag
|
tagOffset | protected int tagOffset(Code) | | Current decoded tag offset
|
times | public int[] times(Code) | | Keeps last decoded: year, month, day, hour, minute, second, millisecond
|
BerInputStream | public BerInputStream(byte[] encoded) throws IOException(Code) | | Creates stream for decoding.
Parameters: encoded - - bytes array to be decoded throws: IOException - - if an error occurs |
BerInputStream | public BerInputStream(byte[] encoded, int offset, int expectedLength) throws IOException(Code) | | Creates stream for decoding.
Parameters: encoded - -bytes array to be decoded Parameters: offset - -the encoding offset Parameters: expectedLength - -expected length of full encoding, this includes identifier,length an content octets throws: IOException - -if an error occurs |
BerInputStream | public BerInputStream(InputStream in) throws IOException(Code) | | Creates stream for decoding.
Allocates initial buffer of default size
Parameters: is - associated InputStream |
BerInputStream | public BerInputStream(InputStream in, int initialSize) throws IOException(Code) | | Creates stream for decoding.
Allocates initial buffer of initialSize size
Parameters: initialSize - the internal buffer initial size Parameters: is - associated InputStream |
compactBuffer | public void compactBuffer()(Code) | | Reallocates the buffer in order to make it
exactly the size of data it contains
|
getBuffer | final public byte[] getBuffer()(Code) | | Returns internal buffer used for decoding
- buffer |
getContentOffset | final public int getContentOffset()(Code) | | |
getEncoded | public byte[] getEncoded()(Code) | | Returns encoded array.
MUST be invoked after decoding corresponding ASN.1 notation
|
getEndOffset | final public int getEndOffset()(Code) | | Returns end offset for the current encoded type
- offset |
getLength | public static int getLength(byte[] encoding)(Code) | | Returns the length of the encoding
|
getLength | final public int getLength()(Code) | | Returns length of the current content for decoding
- length of content |
getOffset | final public int getOffset()(Code) | | Returns the current offset
- offset |
getTagOffset | final public int getTagOffset()(Code) | | Returns start offset for the current encoded type
- offset |
next | public int next() throws IOException(Code) | | Decodes next encoded type.
Initializes tag, length, tagOffset and contentOffset variables
next decoded tag throws: IOException - - if error occured |
read | protected int read() throws IOException(Code) | | Reads the next encoded byte from the encoded input stream.
the next encoded byte throws: IOException - - if error occured |
readContent | public void readContent() throws IOException(Code) | | Reads the next encoded content from the encoded input stream.
The method MUST be used for reading a primitive encoded content.
throws: IOException - - if error occured |
readGeneralizedTime | public void readGeneralizedTime() throws IOException(Code) | | Decodes ASN.1 GeneralizedTime type
throws: IOException - - if error occured |
readOctetString | public void readOctetString() throws IOException(Code) | | Decodes ASN.1 Octetstring type
throws: IOException - - if error occured |
readSequence | public void readSequence(ASN1Sequence sequence) throws IOException(Code) | | Decodes ASN.1 Sequence type
Parameters: sequence - - ASN.1 sequence to be decoded throws: IOException - - if error occured |
readSequenceOf | public void readSequenceOf(ASN1SequenceOf sequenceOf) throws IOException(Code) | | Decodes ASN.1 SequenceOf type
Parameters: sequenceOf - - ASN.1 sequence to be decoded throws: IOException - - if error occured |
readUTCTime | public void readUTCTime() throws IOException(Code) | | Decodes ASN.1 UTCTime type
throws: IOException - - if an I/O error occurs or the end of the stream is reached |
reset | final public void reset(byte[] encoded) throws IOException(Code) | | Resets this stream to initial state.
Parameters: encoded - - a new bytes array to be decoded throws: IOException - - if an error occurs |
setVerify | final public void setVerify()(Code) | | Sets verify mode.
|
|
|
|