C#反序列化 “在分析完成之前就遇到流结尾”

在反序列化的时候,需要先把流的指针位置重新设置到0。

 
                MemoryStream ms = new MemoryStream();
                byte[] bitTemp= 获取流;
                ms.Write(bitTemp, 0, bitTemp.Length);
               ms.Position = 0;
                BinaryFormatter b = new BinaryFormatter();
                 ObjectTry   objectTry  = (ObjectTry)b.Deserialize(ms);
原文地址:https://www.cnblogs.com/lvfeilong/p/xsgfgfdgd.html