gzz.util
Class HexUtil

java.lang.Object
  |
  +--gzz.util.HexUtil

public final class HexUtil
extends java.lang.Object

Convert between byte arrays and strings of Hex digits


Field Summary
static java.lang.String rcsid
           
 
Constructor Summary
HexUtil()
           
 
Method Summary
static java.lang.String byteArrToHex(byte[] b)
          Convert the given byte array to a hex string.
static byte[] hexToByteArr(java.lang.String hex)
           
static java.lang.String toString(byte[] b, int index)
          Generate a readable hex string representation of the given byte array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rcsid

public static final java.lang.String rcsid
See Also:
Constant Field Values
Constructor Detail

HexUtil

public HexUtil()
Method Detail

toString

public static java.lang.String toString(byte[] b,
                                        int index)
Generate a readable hex string representation of the given byte array. If the array is long, show only the beginning, the part around the index ind and the end (not yet implemented).


hexToByteArr

public static byte[] hexToByteArr(java.lang.String hex)
                           throws java.lang.NumberFormatException
java.lang.NumberFormatException

byteArrToHex

public static java.lang.String byteArrToHex(byte[] b)
Convert the given byte array to a hex string. The converted string consists of the characters 0-9, a-f.