public abstract class PcepTools extends Object
| Modifier and Type | Method and Description |
|---|---|
static long |
ipToLong(String strIp)
convert a string with ip format to a long.
|
static String |
longToIp(long ipLong)
convert a long to ip format.
|
static String |
stringToIp(String str)
convert a string to the form of ip address.
|
static byte[] |
toByteArray(String hexString)
Converts a hex string to a decimal byte array.
|
static String |
toDecimalString(byte[] bytes)
Converts a byte array to a decimal string.
|
static String |
toHexString(byte[] byteArray)
Converts decimal byte array to a hex string.
|
static int |
tranferHexStringToInt(String str,
int base,
int offset)
get a integer value from a cut string.
|
public static String toHexString(byte[] byteArray)
byteArray - byte arraypublic static byte[] toByteArray(String hexString)
hexString - a hex stringpublic static String toDecimalString(byte[] bytes)
bytes - a byte arraypublic static String stringToIp(String str)
str - a stringpublic static String longToIp(long ipLong)
ipLong - a decimal number.public static long ipToLong(String strIp)
strIp - a string with ip formatpublic static int tranferHexStringToInt(String str, int base, int offset)
str - a whole stringbase - cut the string from this indexoffset - the offset when execute the cut