/// <inheritdoc />
        protected override IEnumerable <MessageRecord> ReadMessagesFromStream(Stream stream,
                                                                              MessageQuery query)
        {
            if (compress)
            {
                stream = new GZipStream(stream, CompressionMode.Decompress, false);
            }
            var commandSerializer = new MessageBinarySerializer(stream, Serializer);

            for (MessageRecord message; (message = commandSerializer.Read()) != null;)
            {
                if (query.Match(message))
                {
                    yield return(message);
                }
            }
        }