Beispiel #1
0
 /// <summary>
 /// Writes the body.
 /// </summary>
 /// <param name="writer">The writer.</param>
 protected override void WriteBody(WireProtocolWriter writer)
 {
     writer.Write(0);
     writer.WriteNullTerminated(FullNameSpace);
     writer.Write(DeleteQuery.HasOid() ? 1 : 0);
     WriteDBObject(writer, DeleteQuery);
 }
Beispiel #2
0
 /// <summary>
 /// Writes the body.
 /// </summary>
 /// <param name="writer">The writer.</param>
 protected override void WriteBody(WireProtocolWriter writer)
 {
     writer.Write(0);
     writer.WriteNullTerminated(Cursor.Options.Collection.FullName);
     writer.Write(Cursor.Options.NumberToReturn);
     writer.Write(Cursor.CursorID.Value);
 }
Beispiel #3
0
        /// <summary>
        /// Writes the body.
        /// </summary>
        /// <param name="writer">The writer.</param>
        protected override void WriteBody(WireProtocolWriter writer)
        {
            writer.Write((int)Options.Flags);
            writer.WriteNullTerminated(Options.Collection.FullName);
            writer.Write(Options.NumberToSkip.HasValue ? Options.NumberToSkip.Value : 0);
            writer.Write(Options.NumberToReturn);
            writer.Write(Options.Selector);

            if (Options.ReturnFields != null)
                writer.Write(Options.ReturnFields);
        }
Beispiel #4
0
 /// <summary>
 /// Writes the body.
 /// </summary>
 /// <param name="writer">The writer.</param>
 protected override void WriteBody(WireProtocolWriter writer)
 {
     writer.Write(0);
     writer.WriteNullTerminated(FullNameSpace);
     writer.Write((int)Flags);
     writer.Write(Selector);
     writer.Write(Document);
 }
Beispiel #5
0
 /// <summary>
 /// Writes the body.
 /// </summary>
 /// <param name="writer">The writer.</param>
 protected override void WriteBody(WireProtocolWriter writer)
 {
     writer.WriteNullTerminated(this.Message);
 }
Beispiel #6
0
 /// <summary>
 /// Writes the body.
 /// </summary>
 /// <param name="writer">The writer.</param>
 protected override void WriteBody(WireProtocolWriter writer)
 {
     writer.Write(0);
     writer.WriteNullTerminated(FullCollectionName);
     foreach (IDBObject document in _documents)
     {
         WriteDBObject(writer, document);
     }
 }
        public void TestWriteString()
        {
            MemoryStream ms = new MemoryStream();
            WireProtocolWriter writer = new WireProtocolWriter(ms);
            string expected = "54-65-73-74-73-2E-69-6E-73-65-72-74-73-00";
            writer.WriteNullTerminated("Tests.inserts");

            string hexdump = BitConverter.ToString(ms.ToArray());

            Assert.AreEqual(expected, hexdump);
        }