|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--codec.asn1.ASN1AbstractType
|
+--codec.asn1.ASN1Integer
Represents an ASN.1 INTEGER type. The corresponding Java type is java.math.BigInteger.
| Constructor Summary | |
ASN1Integer()
Creates a new instance ready for parsing. |
|
ASN1Integer(BigInteger val)
Creates a new instance with the given BigInteger as its initial value. |
|
ASN1Integer(byte[] val)
Creates a new instance from the given byte array. |
|
ASN1Integer(int n)
Creates an instance with the given int value. |
|
ASN1Integer(int signum,
byte[] magnitude)
Translates the sign-magnitude representation of a BigInteger into an ASN.1 INTEGER. |
|
ASN1Integer(String val)
Creates an ASN.1 INTEGER from the given string representation. |
|
| Method Summary | |
void |
decode(Decoder dec)
|
void |
encode(Encoder enc)
|
BigInteger |
getBigInteger()
|
int |
getTag()
Returns the corresponding ASN.1 tag. |
Object |
getValue()
This abstract method should return the value wrapped by the ASN1Type. |
void |
setBigInteger(BigInteger n)
|
String |
toString()
|
| Methods inherited from class codec.asn1.ASN1AbstractType |
checkConstraints, getConstraint, getTagClass, isExplicit, isOptional, isType, readExternal, setConstraint, setExplicit, setOptional, writeExternal |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ASN1Integer()
public ASN1Integer(BigInteger val)
val - The value.
public ASN1Integer(String val)
throws NumberFormatException
java.math.BigInteger.val - The string representation of the multiple precision
integer.NumberFormatException - if the string could not be parsed successfully.
public ASN1Integer(byte[] val)
throws NumberFormatException
java.math.BigInteger.val - The two's-complement input number in big endian
byte-order.NumberFormatException - if val is zero bytes long.
public ASN1Integer(int signum,
byte[] magnitude)
throws NumberFormatException
This method calls the equivalent constructor of class
java.math.BigInteger.
signum - signum of the number (-1 for negative, 0 for zero, 1 for
positive).magnitude - The big endian binary representation of the magnitude of
the number.NumberFormatException - signum is not one of the three legal values (-1, 0, and
1), or signum is 0 and magnitude contains one or more
non-zero bytes.public ASN1Integer(int n)
n - The integer to initialize with.| Method Detail |
public Object getValue()
ASN1AbstractTypegetValue in class ASN1AbstractTypecodec.asn1.ASN1AbstractTypepublic BigInteger getBigInteger()
public void setBigInteger(BigInteger n)
throws ConstraintException
public int getTag()
ASN1AbstractTypegetTag in class ASN1AbstractTypecodec.asn1.ASN1AbstractType
public void encode(Encoder enc)
throws ASN1Exception,
IOException
encode in class ASN1AbstractType
public void decode(Decoder dec)
throws ASN1Exception,
IOException
decode in class ASN1AbstractTypepublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||