Airy 是一个简单、快速、高效、零依赖的序列化框架。
安装Airy可从 releasespage 获取。
Quickstart快速上手 Airy airy = new Airy(); byte[] data = airy.serialize(someBean); SomeBean object = (SomeBean) airy.deserialize(data); // or airy.deserialize(data, SomeBean.class);是不是很简单?接下来将详细介绍框架的一些细节和高级用法。
高级用法 Airy airy = new Airy(new OrderSerializer()); // use OrderSerializer instead of HashSerializer airy.registerClass(SomeBean.class); // register class to reduce the size of the serialized data airy.appendHandler(someHander); // append your owner handler byte[] data = airy.serialize(someBean); SomeBean object = (SomeBean) airy.deserialize(data); // or airy.deserialize(data, SomeBean.class);
评论