FST 2.56 发布了,这是一个小更新版本,主要是合并了一些 PR,同时对 JSON 反序列化的 Unknown 问题进行小改进。
FST fast-serialization 是重新实现的 Java 快速对象序列化的开发包。序列化速度更快(2-10倍)、体积更小,而且兼容 JDK 原生的序列化。要求 JDK 1.7 支持。
Maven:
<dependency>
<groupId>de.ruedigermoeller</groupId>
<artifactId>fst</artifactId>
<version>1.58</version>
</dependency>
示例代码:
// ! reuse this Object, it caches metadata. Performance degrades massively
// if you create a new Configuration Object with each serialization !
static FSTConfiguration conf = FSTConfiguration.createDefaultConfiguration();
...
public MyClass myreadMethod(InputStream stream) throws IOException, ClassNotFoundException
{
FSTObjectInput in = conf.getObjectInput(stream);
MyClass result = in.readObject(MyClass.class);
// DON'T: in.close(); here prevents reuse and will result in an exception
stream.close();
return result;
}
public void mywriteMethod( OutputStream stream, MyClass toWrite ) throws IOException
{
FSTObjectOutput out = conf.getObjectOutput(stream);
out.writeObject( toWrite, MyClass.class );
// DON'T out.close() when using factory method;
out.flush();
stream.close();
}
本站为大家提供 node.js 安装node.js 教程node.js 下载node.js 视频教程node.js web开发node.js 开发工具node.js mysqlnode.js 爬虫node.js npmnode.js ide
开发环境 / 55.08 MB
开发环境 / 1.62 GB
开发环境 / 389.02 MB
开发环境 / 388.92 MB
开发环境 / 18.28 MB
软件评论
请自觉遵守互联网相关政策法规,评论内容只代表网友观点,与本站立场无关!
2018-01-04 12:02 支持(5) 回复