1. XenForo 1.5.14 中文版——支持中文搜索!现已发布!查看详情
  2. Xenforo 爱好者讨论群:215909318 XenForo专区

新闻 FST 2.56 发布,Java 的高性能序列化库 下载

本帖由 漂亮的石头2018-01-04 发布。版面名称:软件资讯

  1. 漂亮的石头

    漂亮的石头 版主 管理成员

    注册:
    2012-02-10
    帖子:
    487,766
    赞:
    47
    FST 2.56 发布了,这是一个小更新版本,主要是合并了一些 PR,同时对 JSON 反序列化的 Unknown 问题进行小改进。

    FST fast-serialization 是重新实现的 Java 快速对象序列化的开发包。序列化速度更快(2-10倍)、体积更小,而且兼容 JDK 原生的序列化。要求 JDK 1.7 支持。

    // ! 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();
    }

    下载地址:https://github.com/RuedigerMoeller/fast-serialization/releases
    FST 2.56 发布,Java 的高性能序列化库下载地址
     
正在加载...