Beispiel #1
0
        public static object Reserialize(this IBinaryLayerHandler handler, object input)
        {
            object output;

            using (var ms = new MemoryStream())
            {
                handler.Serialize(new BinaryDataWriter(ms), input);
                ms.Position = 0;
                output      = handler.Deserialize(new BinaryDataReader(ms));
                Assert.That(ms.Position, Is.EqualTo(ms.Length), "Stream should be read till the end");
            }
            return(output);
        }
Beispiel #2
0
 public object Load(IniKeyCollection iniData, LayerHandlerContext context)
 {
     using (var reader = new BinaryDataReader(context.LoadExternalFile(DataFileKey)))
         return(binaryHandler.Deserialize(reader));
 }