public class CountingDerInputStream extends DerInputStream
APPLICATION, BIT_STRING, BMPString, BOOLEAN, CONSTRUCTED, CONTEXT_SPECIFIC, ENUMERATED, EXTERNAL, GeneralizedTime, GeneralString, IA5String, INTEGER, NULL, NumericString, OBJECT_DESCRIPTOR, OBJECT_ID, OCTET_STRING, PrintableString, PRIVATE, SEQUENCE, SET, T61String, UNIString, UNIVERSAL, UTCTime, UTF8String, VisibleString
Constructor and Description |
---|
CountingDerInputStream(java.io.InputStream is)
Creates a new DerInputStream to read data from the specified input stream.
|
Modifier and Type | Method and Description |
---|---|
int |
getPos()
Gets the read position (number of bytes read so far).
|
int |
read()
Reads one byte from this InputStream.
|
int |
read(boolean unread)
Reads one byte from this InputStream.
|
int |
read(byte[] b,
int off,
int len)
Reads bytes into a portion of an array.
|
long |
skip(long n)
Skips n bytes.
|
available, close, getTag, nextIsApplication, nextIsConstructed, nextIsContextSpecific, nextIsPrivate, nextIsUniversal, nextTag, readBitString, readBoolean, readConstructed, readContextSpecific, readContextSpecific, readEOC, readGeneralizedTime, readInteger, readNull, readObjectID, readOctetString, readOctetString, readOctetStringByteArray, readSequence, readSet, readString, readUTCTime, skipObjects
public CountingDerInputStream(java.io.InputStream is)
is
- the InputStream supplying DER/BER encoded datapublic int read() throws java.io.IOException
read
in class DerInputStream
java.io.IOException
- if an I/O or a DER decoding error occurspublic int read(boolean unread) throws java.io.IOException
unread
is set to true
, the byte is pushed back
again.read
in class DerInputStream
unread
- true if the byte shall be unreadjava.io.IOException
- if an I/O or a DER decoding error occurspublic int read(byte[] b, int off, int len) throws java.io.IOException
read
in class DerInputStream
b
- the byte array to which the data shall be readoff
- the start offset of the datalen
- the maximum number of bytes to be readjava.io.IOException
- if an I/O error occurspublic long skip(long n) throws java.io.IOException
skip
in class DerInputStream
n
- the number of bytes to be skippedjava.io.IOException
- if an I/O or a DER decoding error occurspublic int getPos()