public static String toHex(byte[] b){
  checkArgument(b.length > 0,"length must be greater than 0");
  return String.format("%x",new BigInteger(1,b));
}

public static String toHex ( byte [ ] b ) { checkArgument ( b . length > 0 , "length must be greater than 0" ) ; return String . format ( "%x" , new BigInteger ( 1 , b ) ) ; }
convert a byte array into a hex string
