public T Deserialize <T>(Stream stream, out long operationTime)
 {
     using (var reader = new BsonReader(stream)
     {
         CloseInput = false
     })
         return(ExecutionTimer.Measure(() => _serializer.Deserialize <T>(reader), out operationTime));
 }
 public void Serialize <T>(Stream stream, T value, out long operationTime)
 {
     using (var writer = new BsonWriter(stream)
     {
         CloseOutput = false
     })
     {
         ExecutionTimer.Measure(() => _serializer.Serialize(writer, value), out operationTime);
     }
 }
Example #3
0
        public void Serialize <T>(Stream stream, T value, out long operationTime)
        {
            var serializer = new DataContractSerializer(typeof(T));

            ExecutionTimer.Measure(() => serializer.WriteObject(stream, value), out operationTime);
        }
Example #4
0
        public T Deserialize <T>(Stream stream, out long operationTime)
        {
            var serializer = new DataContractSerializer(typeof(T));

            return(ExecutionTimer.Measure(() => (T)serializer.ReadObject(stream), out operationTime));
        }
Example #5
0
 public void Serialize <T>(Stream stream, T value, out long operationTime)
 {
     ExecutionTimer.Measure(() => _serializer.Serialize(stream, value), out operationTime);
 }
Example #6
0
 public T Deserialize <T>(Stream stream, out long operationTime)
 {
     return(ExecutionTimer.Measure(() => _serializer.Deserialize <T>(stream), out operationTime));
 }