public static String toHex(byte[] bytes) {
        try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
            HexDump.dump(bytes, 0, byteArrayOutputStream, 0);
            return byteArrayOutputStream.toString();
        } catch (IOException e) {
            throw new PlcRuntimeException(e);
        }
    }
Can be used to display a byte[] as hex string.

@param bytes to be displayed.
@return hexed string.
plc4j/drivers/mock/src/main/java/org/apache/plc4x/java/mock/util/HexUtil.java