org.openflow.util
Class HexString
java.lang.Object
org.openflow.util.HexString
public class HexString
- extends java.lang.Object
Method Summary |
static byte[] |
fromHexString(java.lang.String values)
Convert a string of hex values into a string of bytes |
static java.lang.String |
toHexString(byte[] bytes)
Convert a string of bytes to a ':' separated hex string |
static java.lang.String |
toHexString(long val)
|
static java.lang.String |
toHexString(long val,
int padTo)
|
static long |
toLong(java.lang.String values)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HexString
public HexString()
toHexString
public static java.lang.String toHexString(byte[] bytes)
- Convert a string of bytes to a ':' separated hex string
- Parameters:
bytes
-
- Returns:
- "0f:ca:fe:de:ad:be:ef"
toHexString
public static java.lang.String toHexString(long val,
int padTo)
toHexString
public static java.lang.String toHexString(long val)
fromHexString
public static byte[] fromHexString(java.lang.String values)
throws java.lang.NumberFormatException
- Convert a string of hex values into a string of bytes
- Parameters:
values
- "0f:ca:fe:de:ad:be:ef"
- Returns:
- [15, 5 ,2, 5, 17]
- Throws:
java.lang.NumberFormatException
- If the string can not be parsed
toLong
public static long toLong(java.lang.String values)
throws java.lang.NumberFormatException
- Throws:
java.lang.NumberFormatException