public function getChangesAsStream(array $params = [])
    {
        // Set feed to continuous.
        if (!isset($params['feed']) || $params['feed'] != 'continuous') {
            $params['feed'] = 'continuous';
        }
        $path = '/'.$this->databaseName.'/_changes';
        $connectionOptions = $this->getHttpClient()->getOptions();
        $streamClient = new StreamClient(
            $connectionOptions['host'],
            $connectionOptions['port'],
            $connectionOptions['username'],
            $connectionOptions['password'],
            $connectionOptions['ip'],
            $connectionOptions['ssl'],
            $connectionOptions['path']
        );

        foreach ($params as $key => $value) {
            if (isset($params[$key]) === true && is_bool($value) === true) {
                $params[$key] = ($value) ? 'true' : 'false';
            }
        }
        if (count($params) > 0) {
            $query = http_build_query($params);
            $path = $path.'?'.$query;
        }
        $stream = $streamClient->getConnection('GET', $path, null);

        $headers = $streamClient->getStreamHeaders($stream);
        if (empty($headers['status'])) {
            throw HTTPException::readFailure(
                $connectionOptions['ip'],
                $connectionOptions['port'],
                'Received an empty response or not status code',
                0
            );
        } elseif ($headers['status'] != 200) {
            $body = '';
            while (!feof($stream)) {
                $body .= fgets($stream);
            }
            throw HTTPException::fromResponse($path, new Response($headers['status'], $headers, $body));
        }
        // Everything seems okay. Return the connection resource.
        return $stream;
    }