The .NET binary serialization format discards types as they would like to be stored, and puts them into some metadata so you know how to decode them (what type, what field name, etc.).
This is not primarily for interacting with .NET languages ββ- although it may be. This is for interacting with past and future versions of the same objects that can be written in such a way as to be resistant to these changes or, at least, to know in order to reject them.
In C, if you change the structure in any way - and you just used write() to store the memory, you probably also want to write some metadata so you can know if you have version right (and need to convert).
Another advantage is that .NET languages ββknow what to do with links. By default, C will be write() address, which will later be useless .. NET also supports the idea of ββfields that should not be serialized (like a password) - another thing you will need to write manually in version C.
source share