public class Int extends AbstractInt
A generic signed integer codec. For Substrate all numbers are LE encoded, this handles the encoding and decoding of those numbers. Upon construction the bitLength is provided and any additional use keeps the number to this length. This extends BN
, so all methods available on a normal BN
object is available here.
Constructor and Description |
---|
Int(java.lang.Object value,
int bitLength,
boolean isHexJson) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
toHex()
Returns a hex string representation of the value
|
byte[] |
toU8a(boolean isBare) |
bitLength, eq, getEncodedLength, isEmpty, toBn, toJson
abs, add, and, andNot, bitCount, byteValueExact, clearBit, compareTo, divide, divideAndRemainder, doubleValue, equals, flipBit, floatValue, gcd, getLowestSetBit, hashCode, intValue, intValueExact, isProbablePrime, longValue, longValueExact, max, min, mod, modInverse, modPow, multiply, negate, nextProbablePrime, not, or, pow, probablePrime, remainder, setBit, shiftLeft, shiftRight, shortValueExact, signum, subtract, testBit, toByteArray, toString, toString, valueOf, xor
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getConstructorCodec, toU8a
public java.lang.String toHex()
Returns a hex string representation of the value
toHex
in interface Codec
toHex
in class AbstractInt
public byte[] toU8a(boolean isBare)
toU8a
in interface Codec
toU8a
in class AbstractInt
isBare
- true when the value has none of the type-specific prefixes (internal) Encodes the value as a Uint8Array as per the parity-codec specifications