Example #1
0
        public void Deserialize()
        {
            var testData = new SharedData.MyClass {
                MyProperty1 = int.MaxValue, MyProperty2 = int.MaxValue, MyProperty3 = int.MaxValue
            };

            var ms = new MemoryStream();

            SerializeWithLengthPrefixExt(ms, testData, Resolvers.ContractlessStandardResolver.Instance);

            ms.Position = 0;
            var data = DeserializeWithLengthPrefixExt <MyClass>(ms, Resolvers.ContractlessStandardResolver.Instance);
        }
Example #2
0
        public void Deserialize2()
        {
            var testData = new SharedData.MyClass {
                MyProperty1 = int.MaxValue, MyProperty2 = 99, MyProperty3 = 1341
            };

            Stream ms = new MemoryStream();

            SerializeWithLengthPrefixExt(ms, testData, Resolvers.ContractlessStandardResolver.Instance);

            ms.Position = 0;

            ms = new FixedSizeReadStream(ms, 2);

            var data = DeserializeWithLengthPrefixExt2 <MyClass>(ms, Resolvers.ContractlessStandardResolver.Instance);
        }