public override int Read(Span <byte> buffer)
        {
            HttpConnection connection = _connection;

            if (connection == null || buffer.Length == 0)
            {
                // Response body fully consumed or the caller didn't ask for any data
                return(0);
            }

            int bytesRead = connection.ReadBuffered(buffer);

            if (bytesRead == 0)
            {
                // We cannot reuse this connection, so close it.
                _connection = null;
                connection.Dispose();
            }

            return(bytesRead);
        }
 private void Finish(HttpConnection connection)
 {
     // We cannot reuse this connection, so close it.
     connection.Dispose();
     _connection = null;
 }