public static String byteToHexString(byte in){
  StringBuffer out=new StringBuffer(2);
  byte ch=(byte)(in & 0xF0);
  ch=(byte)(ch >>> 4);
  ch=(byte)(ch & 0x0F);
  out.append(hexChars[(int)ch]);
  ch=(byte)(in & 0x0F);
  out.append(hexChars[(int)ch]);
  return out.toString();
}

public static String byteToHexString ( byte in ) { StringBuffer out = new StringBuffer ( 2 ) ; byte ch = ( byte ) ( in & 0xF0 ) ; ch = ( byte ) ( ch > > > 4 ) ; ch = ( byte ) ( ch & 0x0F ) ; out . append ( hexChars [ ( int ) ch ] ) ; ch = ( byte ) ( in & 0x0F ) ; out . append ( hexChars [ ( int ) ch ] ) ; return out . toString ( ) ; }
converts a byte to readable hexadecimal format in a string < br > this code was originally taken from jeff boyle ' s article on devx . com
