org.erights.e.elib.util
Class HexStringUtils

java.lang.Object
  |
  +--org.erights.e.elib.util.HexStringUtils

public class HexStringUtils
extends Object

Untamed:


Constructor Summary
HexStringUtils()
          Enabled:
 
Method Summary
static String bytesToReadableHexStr(byte[] msg)
          Enabled: Convert a byte array to a formated hex string suitable for printing.
static String bytesToReadableHexStr(byte[] msg, int off, int len)
          Enabled: Convert a byte array to a formated hex string suitable for printing.
static byte[] hexStrToBytes(String s)
          Enabled:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HexStringUtils

public HexStringUtils()
Enabled:

Method Detail

bytesToReadableHexStr

public static String bytesToReadableHexStr(byte[] msg)
Enabled: Convert a byte array to a formated hex string suitable for printing.

The output is divided into lines. Each line has a 4 character hex offset in string, followed by the hex representation of 16 bytes of the input, grouped into 8 hex character groups, followed by an ascii interpretion of the 16 bytes.

Parameters:
msg - The hex string.

bytesToReadableHexStr

public static String bytesToReadableHexStr(byte[] msg,
                                           int off,
                                           int len)
Enabled: Convert a byte array to a formated hex string suitable for printing.

The output is divided into lines. Each line has a 4 character hex offset in string, followed by the hex representation of 16 bytes of the input, grouped into 8 hex character groups, followed by an ascii interpretion of the 16 bytes.

Parameters:
msg - The hex string.
off - the offset in msg to start converting. The offsets included in the output will start with 0000 regardless of the value of off. ¶m len the number of bytes to convert.

hexStrToBytes

public static byte[] hexStrToBytes(String s)
Enabled:



comments?