<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          FSTJava 快速序列化庫

          聯(lián)合創(chuàng)作 · 2023-09-28 18:03

          FST fast-serialization 是重新實(shí)現(xiàn)的 Java 快速對(duì)象序列化的開發(fā)包。序列化速度更快(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();
          }
          瀏覽 18
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  av天堂导航 | 亚洲精品欧美精品 | 全国男人的天堂网站 | 欧美三级片在线观看的 | 无码在线观看播放 |