简单的protobuf-net代码片段...对二元格式化的基础de / serialize long [,]

时间:2014-03-09 17:32:38

标签: c# serialization protobuf-net binaryformatter

以下(工作......).net c#片段如何将长[,] xlate /序列化为protobuf-net?

using System.Runtime.Serialization.Formatters.Binary;//.BinaryFormatter;
/*???using protobuf-net;//from protobuf-net r688.zip CoreOnly\mono\*/
....
public BinaryFormatter B=new BinaryFormatter();
public FileStream s;
public long[,]E=new long[10,4];
....
using(s=new FileStream(filnm,FileMode.Create,FileAccess.Write))B.Serialize(s,E);
....
using(s=new FileStream(filnm,FileMode.Open,FileAccess.Read))E=long[,])B.Deserialize(s);
....

0 个答案:

没有答案