com.exasol.bucketfs.uploadnecessity.ByteArrayToHexConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bucketfs-java Show documentation
Show all versions of bucketfs-java Show documentation
Java library for automating tasks on Exasol's BucketFS.
The newest version!
package com.exasol.bucketfs.uploadnecessity;
/**
* This class converts a byte array into a hexadecimal representation.
*/
final class ByteArrayToHexConverter {
private ByteArrayToHexConverter() {
// this class has only static methods
}
/**
* Converts a byte array into a hex representation.
*
* @param bytes bytes to convert
* @return hex representation as string
*/
static String toHex(final byte[] bytes) {
final StringBuilder result = new StringBuilder();
for (final byte eachByte : bytes) {
result.append(String.format("%02x", eachByte));
}
return result.toString();
}
}