@SuppressWarnings(value = "DM_DEFAULT_ENCODING")
    public static String exceptionCallStack(final Throwable throwable) {
        final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        final PrintWriter printWriter = new PrintWriter(byteArrayOutputStream);
        throwable.printStackTrace(printWriter);
        printWriter.close();
        return byteArrayOutputStream.toString(StreamUtil.DEFAULT_CHARSET);

    }
Wrap a stream and don't let it close.
stroom-util/src/main/java/stroom/util/io/StreamUtil.java