public static String byteToHexString(byte[] bytes, int start, int end) {
    if (bytes == null) {
      throw new IllegalArgumentException("bytes == null");
    }
    StringBuilder s = new StringBuilder();
    for(int i = start; i < end; i++) {
      s.append("%02x".formatted(bytes[i]));
    }
    return s.toString();
  }
Given an array of bytes it will convert the bytes to a hex string
representation of the bytes
@param bytes
@param start start index, inclusively
@param end end index, exclusively
@return hex string representation of the byte array
common/src/java/org/apache/hive/common/util/HiveStringUtils.java