/* ------------------------------------------------------------ */
 void setOutputState(int s) throws IOException {
   if (s < 0) {
     _outputState = DISABLED;
     if (_writer != null) _writer.disable();
     _writer = null;
     if (_out != null) _out.disable();
     _out = null;
   } else _outputState = s;
 }
  /* ------------------------------------------------------------ */
  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;
  }