Charset wireFeedCharset = Charset.forName(wireFeedEncoding);
contentType = new MediaType(contentType.getType(), contentType.getSubtype(), wireFeedCharset);
outputMessage.getHeaders().setContentType(contentType);
}
WireFeedOutput feedOutput = new WireFeedOutput();
try {
Writer writer = new OutputStreamWriter(outputMessage.getBody(), wireFeedEncoding);
feedOutput.output(wireFeed, writer);
}
catch (FeedException ex) {
throw new HttpMessageNotWritableException("Could not write WiredFeed: " + ex.getMessage(), ex);
}
}