public final class BigInt
extends java.lang.Object
implements java.io.Serializable
NOTE: This class may eventually disappear, to be supplanted by big-endian byte arrays which hold both signed and unsigned arbitrary-precision integers.
Constructor and Description |
---|
BigInt(java.math.BigInteger i)
Constructs a "Big" integer from a "BigInteger", which must be
positive (or zero) in value.
|
BigInt(byte[] data)
Constructs a "Big" integer from a set of (big-endian) bytes.
|
BigInt(int i)
Constructs a "Big" integer from a normal Java integer.
|
Modifier and Type | Method and Description |
---|---|
int |
byteLength()
Returns the length of the data as a byte array.
|
boolean |
equals(BigInt other)
Returns true iff the parameter is numerically equivalent.
|
boolean |
equals(java.lang.Object other)
Returns true iff the parameter is a numerically equivalent
BigInt.
|
int |
hashCode() |
java.math.BigInteger |
toBigInteger()
Returns a BigInteger value which supports many arithmetic
operations.
|
byte[] |
toByteArray()
Returns the data as a byte array.
|
int |
toInt()
Converts the "big" integer to a java primitive integer.
|
java.lang.String |
toString()
Returns a hexadecimal printed representation.
|
public BigInt(byte[] data)
data
- a sequence of bytes, most significant bytes/digits
first. CONSUMED.public BigInt(java.math.BigInteger i)
public BigInt(int i)
i
- the java primitive integerpublic int toInt()
java.lang.NumberFormatException
- if 32 bits is insufficient.public java.lang.String toString()
toString
in class java.lang.Object
public java.math.BigInteger toBigInteger()
public int byteLength()
public byte[] toByteArray()
java.math.BigInteger
).public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- the object being compared with this one.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(BigInt other)
other
- the BigInt being compared with this one.