protected void firstWrite ( ) throws IOException { if ( _response . isCommitted ( ) ) return ; // Nobble the OutputStream for HEAD requests if ( HttpRequest . __HEAD . equals ( _request . getMethod ( ) ) ) _outputStream . nullOutput ( ) ; int length = _response . getIntField ( HttpFields . __ContentLength ) ; if ( length >= 0 ) _outputStream . setContentLength ( length ) ; }
Setup the reponse output stream . Use the current state of the request and response to set tranfer parameters such as chunking and content length .