fr.imag.adele.util.text
Class HexString

java.lang.Object
  extended byfr.imag.adele.util.text.HexString

public class HexString
extends Object


Field Summary
protected static String[] hexChars
           
 
Constructor Summary
HexString()
           
 
Method Summary
static String hexify(byte[] data, int offset, int length, int linesize)
          Hexify (ie represents in hexadecimal) a byte array
static String hexify(byte[] data, int offset, int length, int linesize, String separator)
           
static byte parseHexChar(char c)
          Parse a radix 16 symbol
static byte[] parseHexString(String hexString)
          Parse a Hex string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hexChars

protected static final String[] hexChars
Constructor Detail

HexString

public HexString()
Method Detail

parseHexString

public static byte[] parseHexString(String hexString)
                             throws NumberFormatException
Parse a Hex string

Parameters:
hexString - a sequence of 2-symbol hexadecimal numbers
Returns:
a byte array
Throws:
NumberFormatException - if a number is not a hexadecimal number

parseHexChar

public static byte parseHexChar(char c)
                         throws NumberFormatException
Parse a radix 16 symbol

Parameters:
c - a symbol
Returns:
a byte
Throws:
NumberFormatException - if c is not a hexadecimal symbol

hexify

public static String hexify(byte[] data,
                            int offset,
                            int length,
                            int linesize)
Hexify (ie represents in hexadecimal) a byte array

Parameters:
data - the byte array to hexify
offset - the offset in the byte array
length - the number of bytes to represent
linesize - the number of byte per line in the string
Returns:
a String with Hexadecimal representation of bytes

hexify

public static String hexify(byte[] data,
                            int offset,
                            int length,
                            int linesize,
                            String separator)