Serializing/deserializing with memory stream

前端 未结 3 1544
难免孤独
难免孤独 2020-11-30 01:27

I\'m having an issue with serializing using memory stream. Here is my code:

/// 
/// serializes the given object into memory stream
///          


        
3条回答
  •  日久生厌
    2020-11-30 01:43

    BinaryFormatter may produce invalid output in some specific cases. For example it will omit unpaired surrogate characters. It may also have problems with values of interface types. Read this documentation page including community content.

    If you find your error to be persistent you may want to consider using XML serializer like DataContractSerializer or XmlSerializer.

提交回复
热议问题