code: public static String bin2hex(final byte[] b)
      {
          if (b == null)
          {
              return "";
          }
          StringBuffer sb = new StringBuffer(2 * b.length);
          for (int i = 0; i < b.length; i++)
          {
              int v = (256 + b[i]) % 256;
              sb.append(hex.charAt((v / 16) & 15));
              sb.append(hex.charAt((v % 16) & 15));
          }
          return sb.toString();
      }
docs: Simple binary-to-hexadecimal conversion.
  
  @param b
  Input bytes. May be <code>null</code>.
  @return Hexadecimal representation of b. Uppercase A-F, two characters
  per byte. Empty string on <code>null</code> input.