step.util
Class Hex

java.lang.Object
  |
  +--step.util.Hex

public class Hex
extends Object

A utility class to generate string representations of various objects as hexadecimal values. All hex values are prepended with 0x. The hex digits are taken from {0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}.


Constructor Summary
Hex()
           
 
Method Summary
static String toString(byte b)
          Get a hex string for a byte.
static String toString(byte[] bytes)
          Get a hex string for an array of bytes.
static String toString(int i)
          Get a hex string for an int.
static String toString(long l)
          Get a hex string for a long.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hex

public Hex()
Method Detail

toString

public static String toString(int i)
Get a hex string for an int.

Returns:
an 8 digit hex string representing the input value.

toString

public static String toString(long l)
Get a hex string for a long.

Returns:
an 16 digit hex string representing the input value.

toString

public static String toString(byte b)
Get a hex string for a byte.

Returns:
a 2 digit hex string representing the input value.

toString

public static String toString(byte[] bytes)
Get a hex string for an array of bytes.

Returns:
a comma separated list of bytes as hex values, surrounded by [ and ].