@SuppressWarnings("unchecked") @Override public void render(OutputStream stream, ContentChannel channel, CompletionHandler completionHandler) throws IOException { if (renderer instanceof AsynchronousRenderer) { AsynchronousRenderer asyncRenderer = (AsynchronousRenderer)renderer; asyncRenderer.setNetworkWiring(channel, completionHandler); } renderer.render(stream, processingResponse, execution, processingRequest); // the stream is closed in AsynchronousSectionedRenderer, after all data // has arrived }