/* ------------------------------------------------------------ */
  public void flushBuffer() throws IOException {
    if (((HttpOutputStream) _httpResponse.getOutputStream()).isClosed()) return;

    if (_writer != null) _writer.flush();
    if (_out != null) _out.flush();
    if (_writer == null && _out == null) _httpResponse.getOutputStream().flush();
    if (!_httpResponse.isCommitted()) _httpResponse.commit();
  }
  /* ------------------------------------------------------------ */
  public ServletOutputStream getOutputStream() {
    if (_outputState == DISABLED) return __nullServletOut;

    if (_outputState != NO_OUT && _outputState != OUTPUTSTREAM_OUT)
      throw new IllegalStateException();

    if (_writer != null) {
      _writer.flush();
      _writer.disable();
      _writer = null;
    }

    if (_out == null) _out = new ServletOut(_servletHttpRequest.getHttpRequest().getOutputStream());
    _outputState = OUTPUTSTREAM_OUT;
    return _out;
  }
 /* ------------------------------------------------------------ */
 void commit() throws IOException {
   if (_writer != null && _writer.isWritten()) _writer.flush();
   else _httpResponse.commit();
 }