internal virtual void WriteHeaderTo(BsonStreamWriter streamWriter)
 {
     streamWriter.WriteInt32(0); // messageLength will be backpatched later
     streamWriter.WriteInt32(_requestId);
     streamWriter.WriteInt32(0); // responseTo not used in requests sent by client
     streamWriter.WriteInt32((int)_opcode);
 }
 internal override void WriteHeaderTo(BsonStreamWriter streamWriter)
 {
     base.WriteHeaderTo(streamWriter);
     streamWriter.WriteInt32(0); // reserved
     streamWriter.WriteCString(_collectionFullName);
     streamWriter.WriteInt32(_numberToReturn);
 }
Пример #3
0
        internal override void WriteHeaderTo(BsonStreamWriter buffer)
        {
            if ((_flags & QueryFlags.Exhaust) != 0)
            {
                throw new NotSupportedException("The Exhaust QueryFlag is not yet supported.");
            }

            base.WriteHeaderTo(buffer);
            buffer.WriteInt32((int)_flags);
            buffer.WriteCString(_collectionFullName);
            buffer.WriteInt32(_numberToSkip);
            buffer.WriteInt32(_numberToReturn);
        }
Пример #4
0
 internal override void WriteHeaderTo(BsonStreamWriter streamWriter)
 {
     _batchStartPosition = (int)streamWriter.Position;
     base.WriteHeaderTo(streamWriter);
     streamWriter.WriteInt32((int)_flags);
     streamWriter.WriteCString(_collectionFullName);
 }
 // internal methods
 internal override void WriteBodyTo(BsonStreamWriter streamWriter)
 {
     streamWriter.WriteInt32(_cursorIds.Length);
     foreach (long cursorId in _cursorIds)
     {
         streamWriter.WriteInt64(cursorId);
     }
 }
Пример #6
0
        // private methods
        private void Backpatch(Stream stream, int position, int value)
        {
            var streamWriter    = new BsonStreamWriter(stream, Utf8Helper.StrictUtf8Encoding);
            var currentPosition = stream.Position;

            stream.Position = position;
            streamWriter.WriteInt32(value);
            stream.Position = currentPosition;
        }
 internal override void WriteHeaderTo(BsonStreamWriter streamWriter)
 {
     base.WriteHeaderTo(streamWriter);
     streamWriter.WriteInt32(0); // reserved
 }