Package org.bouncycastle.oer
Class OERInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.bouncycastle.oer.OERInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
OERInputStream.Choice
,OERInputStream.Sequence
public class OERInputStream extends java.io.FilterInputStream
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OERInputStream.Choice
static class
OERInputStream.Sequence
OER sequence decoder, decodes prefix and determines which optional parts are available.
-
Field Summary
Fields Modifier and Type Field Description protected java.io.PrintWriter
debugOutput
-
Constructor Summary
Constructors Constructor Description OERInputStream(java.io.InputStream src)
Root decoder of OER streaming data.OERInputStream(java.io.InputStream src, int maxByteAllocation)
Create an OER input and set the maximum byte array allocation size;
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OERInputStream.Choice
choice()
protected void
debugPrint(java.lang.String what)
java.math.BigInteger
enumeration()
java.math.BigInteger
int16()
java.math.BigInteger
int32()
java.math.BigInteger
int64()
java.math.BigInteger
int8()
org.bouncycastle.asn1.ASN1Object
parse(OERDefinition.Element element)
java.math.BigInteger
parseInt(boolean unsigned, int size)
org.bouncycastle.oer.OERInputStream.LengthInfo
readLength()
Reads a length determinant deals with long ans short versions.OERInputStream.Sequence
sequence(int expectedOptional, boolean hasOptionalChildren, boolean hasExtension)
java.math.BigInteger
uint16()
java.math.BigInteger
uint32()
java.math.BigInteger
uint64()
java.math.BigInteger
uint8()
-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, read, reset, skip
-
-
-
-
Constructor Detail
-
OERInputStream
public OERInputStream(java.io.InputStream src)
Root decoder of OER streaming data. Maximum byte array allocation is 1Mb- Parameters:
src
- source stream.
-
OERInputStream
public OERInputStream(java.io.InputStream src, int maxByteAllocation)
Create an OER input and set the maximum byte array allocation size;- Parameters:
src
- The src.maxByteAllocation
- the largest byte array that may eb allocated by this parser.
-
-
Method Detail
-
parse
public org.bouncycastle.asn1.ASN1Object parse(OERDefinition.Element element) throws java.lang.Exception
- Throws:
java.lang.Exception
-
parseInt
public java.math.BigInteger parseInt(boolean unsigned, int size) throws java.lang.Exception
- Throws:
java.lang.Exception
-
uint8
public java.math.BigInteger uint8() throws java.lang.Exception
- Throws:
java.lang.Exception
-
uint16
public java.math.BigInteger uint16() throws java.lang.Exception
- Throws:
java.lang.Exception
-
uint32
public java.math.BigInteger uint32() throws java.lang.Exception
- Throws:
java.lang.Exception
-
uint64
public java.math.BigInteger uint64() throws java.lang.Exception
- Throws:
java.lang.Exception
-
int8
public java.math.BigInteger int8() throws java.lang.Exception
- Throws:
java.lang.Exception
-
int16
public java.math.BigInteger int16() throws java.lang.Exception
- Throws:
java.lang.Exception
-
int32
public java.math.BigInteger int32() throws java.lang.Exception
- Throws:
java.lang.Exception
-
int64
public java.math.BigInteger int64() throws java.lang.Exception
- Throws:
java.lang.Exception
-
readLength
public org.bouncycastle.oer.OERInputStream.LengthInfo readLength() throws java.lang.Exception
Reads a length determinant deals with long ans short versions.- Returns:
- Throws:
java.lang.Exception
-
enumeration
public java.math.BigInteger enumeration() throws java.lang.Exception
- Throws:
java.lang.Exception
-
sequence
public OERInputStream.Sequence sequence(int expectedOptional, boolean hasOptionalChildren, boolean hasExtension) throws java.lang.Exception
- Throws:
java.lang.Exception
-
choice
public OERInputStream.Choice choice() throws java.lang.Exception
- Throws:
java.lang.Exception
-
debugPrint
protected void debugPrint(java.lang.String what)
-
-