public ByteArrayBuilder append(final String str) {
        if (!NullSafe.isEmptyString(str)) {
            try {
                byteArrayOutputStream.write(str.getBytes(charset));
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }
        return this;
    }
@param charset The charset to use for string encoding
stroom-util/src/main/java/stroom/util/string/ByteArrayBuilder.java