com.iwombat.util
Class HexStringUtil

java.lang.Object
  extended by com.iwombat.util.HexStringUtil

public final class HexStringUtil
extends java.lang.Object

Class HexStringUtil Description: Utility class for byte-array/string conversions


Method Summary
static byte[] bytesFromHexString(java.lang.String hexString)
          Method bytesFromHexString Description: create a byte-array from a hexidecimal string accepts tokenized (0x leading) and non-tokenized hex strings
static java.lang.String stringFromBytes(byte[] byteArray)
          Method stringFromBytes Description: create a hexidecimal string from a byte-array
static java.lang.String stringFromBytesWithToken(byte[] byteArray)
          Method stringFromBytesWithToken Description: create a hexidecimal string from a byte-array preappend with 0x token
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

bytesFromHexString

public static byte[] bytesFromHexString(java.lang.String hexString)
Method bytesFromHexString Description: create a byte-array from a hexidecimal string accepts tokenized (0x leading) and non-tokenized hex strings

Parameters:
hexString -
Returns:
byte[]
Throws:
java.lang.IllegalArgumentException

stringFromBytes

public static java.lang.String stringFromBytes(byte[] byteArray)
Method stringFromBytes Description: create a hexidecimal string from a byte-array

Parameters:
byteArray -
Returns:
String

stringFromBytesWithToken

public static java.lang.String stringFromBytesWithToken(byte[] byteArray)
Method stringFromBytesWithToken Description: create a hexidecimal string from a byte-array preappend with 0x token

Parameters:
byteArray -
Returns:
String