Airy 是一个简单、快速、高效、零依赖的序列化框架。
Airy 可从 releases page 获取。
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);