示例#1
0
        private static void Main()
        {
            Func<string, Action<Stream, object>, Func<Stream, object>, Tuple<string, Action<Stream, object>, Func<Stream, object>>> serializer = Tuple.Create;

            var binaryFormatter = new BinaryFormatter();
            var protoFormatter = new ProtoFormatter();
            TestSerializers(
                serializer("BinaryFormatter", binaryFormatter.Serialize, binaryFormatter.Deserialize),
                serializer("protobuf-net v2", protoFormatter.Serialize, protoFormatter.Deserialize));
        }
示例#2
0
        private static void Main()
        {
            Func <string, Action <Stream, object>, Func <Stream, object>, Tuple <string, Action <Stream, object>, Func <Stream, object> > > serializer = Tuple.Create;

            var binaryFormatter = new BinaryFormatter();
            var protoFormatter  = new ProtoFormatter();

            TestSerializers(
                serializer("BinaryFormatter", binaryFormatter.Serialize, binaryFormatter.Deserialize),
                serializer("protobuf-net v2", protoFormatter.Serialize, protoFormatter.Deserialize));
        }