public static String toHex(byte[] buf) {
    return toHex(buf, 0, buf.length);
  }
Converts the byte array to a hex string.

@param buf the buffer to convert
@return the hex string
geode-core/src/main/java/org/apache/geode/internal/util/Hex.java