public class Utils extends Object
| Modifier and Type | Field and Description |
|---|---|
static double |
JAVA_VERSION |
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
addressStringToBytes(String hex)
Decodes a hex string to address bytes and checks validity
|
static String |
align(String s,
char fillChar,
int targetLen,
boolean alignRight) |
static long |
fromUnixTime(long unixTime) |
static String |
getAddressShortString(byte[] addr) |
static String |
getHashListShort(List<byte[]> blockHashes) |
static ImageIcon |
getImageIcon(String resource) |
static String |
getNodeIdShort(String nodeId) |
static SecureRandom |
getRandom() |
static String |
getValueShortString(BigInteger number) |
static boolean |
isValidAddress(byte[] addr) |
static Map<String,String> |
JsonToMap(com.alibaba.fastjson.JSONObject json) |
static String |
longToDateTime(long timestamp)
Return formatted Date String: yyyy.MM.dd HH:mm:ss Based on Unix's time()
input in seconds
|
static <T> T[] |
mergeArrays(T[]... arr) |
static String |
repeat(String s,
int n) |
static long |
toUnixTime(long javaTime) |
static BigInteger |
unifiedNumericToBigInteger(String number) |
public static BigInteger unifiedNumericToBigInteger(String number)
number - should be in form '0x34fabd34....'public static String longToDateTime(long timestamp)
timestamp - seconds since start of Unix-timepublic static String getValueShortString(BigInteger number)
public static byte[] addressStringToBytes(String hex)
hex - - a hex string of the address, e.g.,
6c386a4b26f73c802f34673f7248bb118f97424apublic static boolean isValidAddress(byte[] addr)
public static String getAddressShortString(byte[] addr)
addr - length should be 20public static SecureRandom getRandom()
public static long toUnixTime(long javaTime)
public static long fromUnixTime(long unixTime)
public static <T> T[] mergeArrays(T[]... arr)
Copyright © 2018. All rights reserved.