public static void stringToStream(final String string, final OutputStream outputStream, final Charset charset) {
        try {
            outputStream.write(string.getBytes(charset));
            outputStream.flush();
            outputStream.close();

        } catch (final IOException ioEx) {
            // Wrap it
            throw new RuntimeException(ioEx);
        }
    }
Takes a string and writes it to an output stream.
stroom-legacy/stroom-legacy-model_6_1/src/main/java/stroom/legacy/model_6_1/StreamUtil.java