public void writeOut(ObjectWriter writer, OperationDiagnostics metadata) throws IOException
{
OutputStream out = _response.getOutputStream();
if (metadata != null) {
out = new StatsCollectingOutputStream(out, metadata);
}
if (_streamingContent != null) {
long len = _streamingContent.getLength();
if (len >= 0L) {
this.setContentLength(len);