private XmlRpcStreamRequestConfig xmlRpcStreamRequestConfig = new XmlRpcHttpRequestConfigImpl();
private TypeFactory typeFactory = new TypeFactoryImpl(null);
private boolean isRequest;
protected XMLWriter getXMLWriter(Exchange exchange, OutputStream outputStream) throws XmlRpcException {
XMLWriter writer = new CharSetXMLWriter();
String encoding = IOHelper.getCharsetName(exchange);
writer.setEncoding(encoding);
writer.setIndenting(false);
writer.setFlushing(true);
try {
writer.setWriter(new BufferedWriter(new OutputStreamWriter(outputStream, encoding)));
} catch (UnsupportedEncodingException e) {
throw new XmlRpcException("Unsupported encoding: " + encoding, e);
}
return writer;
}