Ejemplo n.º 1
0
 public static void Main()
 {
     MySerializableClass original = new MySerializableClass(1, "ABCD", 3, MyEnum.B, 0.1f);
     Debug.Print("original: " + original.ToString());
     byte[] buffer = Reflection.Serialize(original, typeof(MySerializableClass));
     MySerializableClass restored = (MySerializableClass)Reflection.Deserialize(buffer, typeof(MySerializableClass));
     Debug.Print("restored: " + restored.ToString());
     Debug.Print("Number of bytes: " + buffer.Length.ToString());
     Debug.Print(BufferToString(buffer));
 }
Ejemplo n.º 2
0
        public static void Main()
        {
            MySerializableClass original = new MySerializableClass(1, "ABCD", 3, MyEnum.B, 0.1f);

            Debug.Print("original: " + original.ToString());
            byte[] buffer = Reflection.Serialize(original, typeof(MySerializableClass));
            MySerializableClass restored = (MySerializableClass)Reflection.Deserialize(buffer, typeof(MySerializableClass));

            Debug.Print("restored: " + restored.ToString());
            Debug.Print("Number of bytes: " + buffer.Length.ToString());
            Debug.Print(BufferToString(buffer));
        }