1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        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)
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            精品久热 | 97青青草| 天天插视频 | 狂野欧美性猛交XXⅩ大乱3超A | 国产乱码一区二区三区的解决方法 | 美女色色网 | 亚洲激情成人五月天 | 丰满放荡岳乱妇91www | 综合另类小说图片亚洲欧美 | 男攻男受过程无遮掩视频 |