return new OutputStreamWriter(streamResult.getOutputStream(), executionContext.getContentEncoding());
} else {
return new OutputStreamWriter(streamResult.getOutputStream(), "UTF-8");
}
} catch(UnsupportedEncodingException e) {
throw new SmooksException("Unable to encode output stream.", e);
}
} else {
throw new SmooksException("Invalid " + StreamResult.class.getName() + ". No OutputStream or Writer instance.");
}
}