public static class Utils.Convert
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
INTEGER_BYTES |
static int |
LONG_BYTES |
static int |
SHORT_BYTES |
Constructor and Description |
---|
Convert() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
toBytes(java.lang.Object o)
Convert integer (
short , int , long , BigInteger ) to a byte array |
static java.math.BigInteger |
toUnsignedBigInteger(long l)
Convert
long to BigInteger equal to an unsigned long value |
static java.math.BigInteger |
toUnsignedBigInteger(java.lang.String str)
Convert
String to BigInteger equal to an unsigned String value |
static java.lang.String |
toUnsignedString(long l)
Convert
long to a string representation of an unsigned long value |
public static final int SHORT_BYTES
public static final int INTEGER_BYTES
public static final int LONG_BYTES
public static java.math.BigInteger toUnsignedBigInteger(long l)
long
to BigInteger
equal to an unsigned long
valuel
- long
value to convertBigInteger
equal to an unsigned long
valuepublic static java.math.BigInteger toUnsignedBigInteger(java.lang.String str)
String
to BigInteger
equal to an unsigned String
valuestr
- String
value to convertBigInteger
equal to an unsigned long
valuepublic static java.lang.String toUnsignedString(long l)
long
to a string representation of an unsigned long
valuel
- long
value to convertString
representation of an unsigned long
valuepublic static byte[] toBytes(java.lang.Object o)
short
, int
, long
, BigInteger
) to a byte
arrayo
- Integer object to convert to an array of bytes