public static OutputStream ignoreClose(final OutputStream outputStream) {
        return new FilterOutputStream(outputStream) {
            @Override
            public void close() throws IOException {
                flush();
                // Ignore Close
            }
        };
    }
Wrap a stream and don't let it close.
stroom-legacy/stroom-legacy-model_6_1/src/main/java/stroom/legacy/model_6_1/StreamUtil.java