code: public void close() throws IOException
    {
      if (_isKeepalive) {
        // If recycling, read any unread data
        if (! _didGet)
          getConnInput();
  
        if (! _isRequestDone) {
          if (_tempBuffer == null)
            _tempBuffer = new byte[256];
  
          try {
            while (read(_tempBuffer, 0, _tempBuffer.length) > 0) {
            }
          } catch (IOException e) {
            _isKeepalive = false;
          }
        }
      }
  
      if (_isKeepalive) {
        HttpStream oldSaved;
        
        long now;
        
        now = CurrentTime.currentTime();
        
        synchronized (LOCK) {
          oldSaved = _savedStream;
          _savedStream = this;
          _saveTime = now;
        }
  
        if (oldSaved != null && oldSaved != this) {
          oldSaved._isKeepalive = false;
          oldSaved.close();
        }
  
        return;
      }
  
      try {
        try {
          if (_ws != null)
            _ws.close();
        } catch (Throwable e) {
        }
        _ws = null;
  
        try {
          if (_rs != null)
            _rs.close();
        } catch (Throwable e) {
        }
        _rs = null;
  
        try {
          if (_os != null)
            _os.close();
        } catch (Throwable e) {
        }
        _os = null;
  
        try {
          if (_is != null)
            _is.close();
        } catch (Throwable e) {
        }
        _is = null;
      } finally {
        if (_s != null)
          _s.close();
        _s = null;
      }
    }
docs: Close the connection.