private byte[] DoBsonEncodeDataMongoDriver(NodeGroup data)
        {
            MemoryStream ms = new MemoryStream();

            using (var writer = new MongoDB.Bson.IO.BsonBinaryWriter(ms))
            {
                BsonSerializer.Serialize(writer, data);
            }
            return(ms.ToArray());
        }
        private byte[] DoBsonEncodeData(NodeGroup data)
        {
            MemoryStream ms = new MemoryStream();

            using (BsonWriter writer = new BsonWriter(ms))
            {
                JsonSerializer serializer = new JsonSerializer();
                serializer.TypeNameHandling = TypeNameHandling.Auto;
                serializer.Serialize(writer, data);
            }

            return(ms.ToArray());
        }
 public NodeGroup(NodeGroup other)
 {
     Base  = other.Base;
     Nodes = other.Nodes;
 }
 public NGroup(NodeGroup value)
 {
     Value = value;
 }
Example #5
0
 public void GlobalSetup()
 {
     data        = UtilsCommon.RandomData(1000, 6);
     encodedData = MessagePack.MessagePackSerializer.Serialize(data);
 }
 public void Setup()
 {
     data        = UtilsCommon.RandomData(1000, 6);
     encodedData = data.ToBson();
 }
 private byte[] DoMsgPackEncodeData(NodeGroup data)
 {
     return(MessagePack.MessagePackSerializer.Serialize(data));
 }