日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

fst java_java快速序列化库FST

發(fā)布時間:2023/12/1 编程问答 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 fst java_java快速序列化库FST 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

FST fast-serialization 是重新實現(xiàn)的 Java 快速對象序列化的開發(fā)包。序列化速度更快(2-10倍)、體積更小,而且兼容 JDK 原生的序列化。要求 JDK 1.7 支持。

Maven:

1

2 de.ruedigermoeller

3 fst

4 1.36

5

示例代碼:

01// ! reuse this Object, it caches metadata. Performance degrades massively

02// if you create a new Configuration Object with each serialization !

03static FSTConfiguration conf = FSTConfiguration.createDefaultConfiguration();

04...

05public MyClass myreadMethod(InputStream stream) throws IOException, ClassNotFoundException

06{

07 FSTObjectInput in = conf.getObjectInput(stream);

08 MyClass result = in.readObject(MyClass.class);

09 // DON'T: in.close(); here prevents reuse and will result in an exception

10 stream.close();

11 return result;

12}

13

14public void mywriteMethod( OutputStream stream, MyClass toWrite ) throws IOException

15{

16 FSTObjectOutput out = conf.getObjectOutput(stream);

17 out.writeObject( toWrite, MyClass.class );

18 // DON'T out.close() when using factory method;

19 out.flush();

20 stream.close();

21}

開源中國:http://www.oschina.net/p/fst

總結(jié)

以上是生活随笔為你收集整理的fst java_java快速序列化库FST的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。