摘要: The .NET framework comes with a variety of different serializers. Hopefully, my overview of these serializers will have provided some insight into the differences between them and the various advantag... 阅读全文
posted @ 2014-05-14 16:18 马语者 阅读(271) 评论(0) 推荐(0)
摘要: string test = "Testing 1-2-3";// convert string to streambyte[] byteArray = Encoding.ASCII.GetBytes(test); MemoryStream stream = new MemoryStream(byteArray);// convert stream to stringStreamReader rea... 阅读全文
posted @ 2014-05-14 16:16 马语者 阅读(231) 评论(0) 推荐(0)
摘要: 序列化又称串行化,是.NET运行时环境用来支持用户定义类型的流化的机制。其目的是以某种存储形成使自定义对象持久化,或者将这种对象从一个地方传输到另一个地方。 .NET框架提供了两种种串行化的方式:1、是使用BinaryFormatter进行串行化;2、使用XmlSerializer进行串行化。第一种方式提供了一个简单的二进制数据流以及某些附加的类型信息,而第二种将数据流格式化为XML存储。... 阅读全文
posted @ 2014-05-14 08:52 马语者 阅读(11147) 评论(0) 推荐(0)