public static String toHex(byte[] data){
  try {
    return new String(Hex.encode(data),"US-ASCII");
  }
 catch (  UnsupportedEncodingException e) {
  }
  return null;
}

public static String toHex ( byte [ ] data ) { try { return new String ( Hex . encode ( data ) , "US-ASCII" ) ; } catch ( UnsupportedEncodingException e ) { } return null ; }
convert a byte array to hexadecimal
