What are the differences between the XmlSerializer and BinaryFormatter

前端 未结 5 1952
-上瘾入骨i
-上瘾入骨i 2020-11-29 16:54

I spent a good portion of time last week working on serialization. During that time I found many examples utilizing either the BinaryFormatter or XmlSerializer. Unfortunatel

5条回答
  •  無奈伤痛
    2020-11-29 17:36

    I guess one of the most important ones is that binary serialization can serialize both public and private members, whereas the other one works only with public ones.

    In here, it provides a very helpful comparison between these two in terms of size. It's a very important issue, because you might send your serialized object to a remote machine.

    http://www.nablasoft.com/alkampfer/index.php/2008/10/31/binary-versus-xml-serialization-size/

提交回复
热议问题