public static InputStream stringToStream(final String string, final Charset charset) {
        if (string != null) {
            return new ByteArrayInputStream(string.getBytes(charset));
        }
        return null;
    }
Convert a string to a stream.

@param string to convert
@return the stream or null
stroom-legacy/stroom-legacy-model_6_1/src/main/java/stroom/legacy/model_6_1/StreamUtil.java