让 .NET Compact Framework 支持 Binnary Serialization

CompactFormatter是.NETCompactFramework的一个通用格式化工具,它使用.NET托管代码完全实现,可在支持.NETCompactFramework的设备上工作。此工具能够自动序列化大多数对象,并允许用户重新定义自定义对象的序列化算法,提供类似于BinaryFormatter的接口。

智能设备上的存储空间比较有限,如果能把内存中的数据保存为二进制文件,无论是执行效率还是存储空间,都比文本文件更具优势。为了更有效地利用存储空间,很多人想把对象序列化为二进制数据流并写入磁盘中,但恰恰在 .NET Compact Framework 里面就是找不到 Binnary Serialization 相关的类。
今天发现了一个叫 CompactFormatter 的组件,可以让你在 .NET CF 中实现二进制序列化。

What is the CompactFormatter?
The CompactFormatter is a generic formatter for the .NET Compact Framework. It is fully realized in .NET managed code and this means that it is able to work on every device able to support the .NET Compact Framework or every other standard-compliant CLI implementation.

Even if the CompactFormatter is able to serialize automatically the majority of objects using Reflection, it allows programmers to redefine the serialization algorithm of custom objects if this is needed ( such as, for example, if a custom serialization algorithm is more efficient than the standard one ).

The interface that the CompactFormatter class expose to the user is very similar to the BinaryFormatter ( or SOAPFormatter ) one and so using it ( or, to some extents, porting applications from .NET to it ) should be very simple for people who knows how to use standard .NET Full Formatters.

CompactFormatter is still in Beta (even if we reached 1.0.0 version) simply because it needs more testing. I hope to remove the beta status in a couple of months if no critical problems will be reported.

CompactFormatter is and will always be released under the LGPL License.

Features
·Able to serialize primitive types automatically.
·Able to serialize user-defined types automatically.
·Thanks to Surrogate and Overrider mechanism, allows a safer serialization even of framework types.
·Uses an interface very similar to standard Binary/SOAP formatters used in .NET
·Supports NotSerializable fields, that are fields which must not be serialized.
·Produces a data stream more compact than the one used by .NET BinaryFormatter.
·It is faster than BinaryFormatter and SOAPFormatter.
·Allows users to redefine serialization mechanism of their classes (Custom Serialization).
·It correctly rebuilds the object reference graph.
·Allows the use of user-defined StreamParsers, these are wrapper around serialization stream (useful to implement transformations just before sending the stream on the wire: soon available StreamParsers will allow zip compression and TEA data encryption out of the box.)
·Fully implemented in .NET managed code.

http://www.freewebs.com/compactFormatter/index.html

我还没有测试过,有需要在 .NET CF 下实现二进制序列化的朋友可以试一试:)

转载于:https://www.cnblogs.com/bobli/archive/2006/05/20/CompactFormatter.html

摘 要 在当今数字化浪潮下,传统农业向智慧农业转型成为必然趋势。为解决农业信息流通不畅、服务效率低下等问题,本研究致力于开发一款基于 Spring Boot 的农业服务小程序。 此小程序针对普通用户、商家用户、专家用户和管理员四类角色,设计了丰富且实用的功能。普通用户可轻松完成注册登录,在首页浏览农业资讯,使用购物车选购农产品,还能享受咨询服务、预约专家指导等。商家用户能够管理商城,包括商品分类、订单处理与配送、售后管理等。专家用户在后台处理咨询与预约服务,为农业生产提供专业建议。管理员则全面掌控系统,涵盖用户管理、服务管理、公告发布等工作。 开发过程中,采用 Spring Boot 框架搭建系统,其便捷的开发特性提高了开发效率;选用 MySQL 数据库存储数据,保障数据的稳定与安全;运用 Java 语言实现业务逻辑,确保系统的可扩展性。经过严格的可行性分析、系统设计、功能实现与测试,验证了系统在技术、经济、操作和社会层面的可行性。 该农业服务小程序的成功开发,有效提升了农业服务的质量与效率,促进了农产品的流通,为农业从业者提供了专业支持,有力推动了农业的信息化与现代化发展。不过,系统仍存在功能拓展、性能优化等方面的改进空间,未来将持续完善,以更好地服务农业领域。 关键词:Spring Boot;农业服务小程序;智慧农业;系统开发;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值