code: public static String binToHex(byte[] bin)
    {
      StringBuffer hex = new StringBuffer();
      binToHex(bin,0,bin.length,hex);
      return hex.toString();
    }
docs: Converts a binary value held in a byte array into a hex string.
  
  @param bin    The byte array containing the binary value.
  @return String The hex string