| java.lang.Object sun.security.util.BigInt
BigInt | final public class BigInt (Code) | | A low-overhead arbitrary-precision unsigned integer.
This is intended for use with ASN.1 parsing, and printing of
such parsed values. Convert to "BigInteger" if you need to do
arbitrary precision arithmetic, rather than just represent
the number as a wrapped array of bytes.
NOTE: This class may eventually disappear, to
be supplanted by big-endian byte arrays which hold both signed
and unsigned arbitrary-precision integers.
version: 1.28 author: David Brownell |
Constructor Summary | |
public | BigInt(byte[] data) Constructs a "Big" integer from a set of (big-endian) bytes.
Leading zeroes should be stripped off.
Parameters: data - a sequence of bytes, most significant bytes/digitsfirst. | public | BigInt(BigInteger i) Constructs a "Big" integer from a "BigInteger", which must be
positive (or zero) in value. | public | BigInt(int i) Constructs a "Big" integer from a normal Java integer. |
Method Summary | |
public boolean | equals(Object other) Returns true iff the parameter is a numerically equivalent
BigInt. | public boolean | equals(BigInt other) Returns true iff the parameter is numerically equivalent. | public int | hashCode() Returns a hashcode for this BigInt. | public BigInteger | toBigInteger() Returns a BigInteger value which supports many arithmetic
operations. | public byte[] | toByteArray() Returns the data as a byte array. | public int | toInt() Converts the "big" integer to a java primitive integer. | public String | toString() Returns a hexadecimal printed representation. |
BigInt | public BigInt(byte[] data)(Code) | | Constructs a "Big" integer from a set of (big-endian) bytes.
Leading zeroes should be stripped off.
Parameters: data - a sequence of bytes, most significant bytes/digitsfirst. CONSUMED. |
BigInt | public BigInt(BigInteger i)(Code) | | Constructs a "Big" integer from a "BigInteger", which must be
positive (or zero) in value.
|
BigInt | public BigInt(int i)(Code) | | Constructs a "Big" integer from a normal Java integer.
Parameters: i - the java primitive integer |
equals | public boolean equals(Object other)(Code) | | Returns true iff the parameter is a numerically equivalent
BigInt.
Parameters: other - the object being compared with this one. |
equals | public boolean equals(BigInt other)(Code) | | Returns true iff the parameter is numerically equivalent.
Parameters: other - the BigInt being compared with this one. |
hashCode | public int hashCode()(Code) | | Returns a hashcode for this BigInt.
a hashcode for this BigInt. |
toBigInteger | public BigInteger toBigInteger()(Code) | | Returns a BigInteger value which supports many arithmetic
operations. Assumes negative values will never occur.
|
toByteArray | public byte[] toByteArray()(Code) | | Returns the data as a byte array. The most significant bit
of the array is bit zero (as in java.math.BigInteger ).
|
toInt | public int toInt()(Code) | | Converts the "big" integer to a java primitive integer.
|
toString | public String toString()(Code) | | Returns a hexadecimal printed representation. The value is
formatted to fit on lines of at least 75 characters, with
embedded newlines. Words are separated for readability,
with eight words (32 bytes) per line.
|
|
|