G
Guest
Question about serialization to binary format under .Net 1.1 using C#.
I have some set of classes, some of them are marked with
SerializableAttribute. I use serialization to binary files to persist some
object graph between app sessions.
I've made an easy change to my code: each class which is marked as
Serializable implements ISerializable i-face now, and contains
deserialization ctor. The GetObjectData method is implemented very easy: each
field that was serialized automatically is added to SerializationInfo now by
call to AddValue.
Now, what is my problem. If I serialize an object graph to file by
BinaryFormatter using new classes version (ISerializable) I got a larger file
(about 2 times) that before.
Why??
I have some set of classes, some of them are marked with
SerializableAttribute. I use serialization to binary files to persist some
object graph between app sessions.
I've made an easy change to my code: each class which is marked as
Serializable implements ISerializable i-face now, and contains
deserialization ctor. The GetObjectData method is implemented very easy: each
field that was serialized automatically is added to SerializationInfo now by
call to AddValue.
Now, what is my problem. If I serialize an object graph to file by
BinaryFormatter using new classes version (ISerializable) I got a larger file
(about 2 times) that before.
Why??