code: @Nonnull
      public static String toHex(@Nonnull final byte[] bytes) {
          StringBuilder buf = new StringBuilder(bytes.length * 2);
          for (byte b : bytes) {
              String hexDigits = Integer.toHexString((int) b & 0x00ff);
              if (hexDigits.length() == 1) {
                  buf.append('0');
              }
              buf.append(hexDigits);
          }
          return buf.toString();
      }
docs: Converts a byte array to a hex string.  The String returned
  will be of length exactly {@code bytes.length * 2}.