static byte[] toBytes(Object obj) {
        ByteArrayOutputStream boas = new ByteArrayOutputStream();
        try (ObjectOutputStream ois = new ObjectOutputStream(boas)) {
            ois.writeObject(obj);
            return boas.toByteArray();
        } catch (IOException ioe) {
            throw new RuntimeException(ioe);
        }
    }
dumps a 56 char wide hex string

@param data bytes to dump
@return the hex string
plc4j/spi/src/main/java/org/apache/plc4x/java/spi/utils/hex/Hex.java