public final class HexString extends Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
fromHexString(String values)
Deprecated.
|
static byte[] |
toBytes(String values)
Convert a string of hex values into a string of bytes.
|
static String |
toHexString(byte[] bytes)
Convert a string of bytes to a ':' separated hex string
|
static String |
toHexString(long val) |
static String |
toHexString(long val,
int padTo) |
static long |
toLong(String value) |
public static String toHexString(byte[] bytes)
bytes
- the byte[] to convertpublic static String toHexString(long val, int padTo)
public static String toHexString(long val)
@Deprecated public static byte[] fromHexString(String values) throws NumberFormatException
toBytes(String)
.values
- the hexstring to parse into a byte[]Deprecated
because of inconsistent namingNumberFormatException
- upon values parse errorpublic static byte[] toBytes(String values) throws NumberFormatException
values
- "0f:ca:fe:de:ad:be:ef"NumberFormatException
- If the string can not be parsedpublic static long toLong(String value) throws NumberFormatException
NumberFormatException
Copyright © 2017. All rights reserved.