免费企业网页申请制作步骤,优化推广方案,wordpress 中介 主题,三亚久爱传媒招聘信息FST fast-serialization 是重新实现的 Java 快速对象序列化的开发包。序列化速度更快(2-10倍)、体积更小#xff0c;而且兼容 JDK 原生的序列化。要求 JDK 1.7 支持。Maven#xff1a;12 de.ruedigermoeller3 fst4 1.365示例代码#xff1a;01// ! reuse this Object, it ca…FST fast-serialization 是重新实现的 Java 快速对象序列化的开发包。序列化速度更快(2-10倍)、体积更小而且兼容 JDK 原生的序列化。要求 JDK 1.7 支持。Maven12 de.ruedigermoeller3 fst4 1.365示例代码01// ! reuse this Object, it caches metadata. Performance degrades massively02// if you create a new Configuration Object with each serialization !03static FSTConfiguration conf FSTConfiguration.createDefaultConfiguration();04...05public MyClass myreadMethod(InputStream stream) throws IOException, ClassNotFoundException06{07 FSTObjectInput in conf.getObjectInput(stream);08 MyClass result in.readObject(MyClass.class);09 // DONT: in.close(); here prevents reuse and will result in an exception10 stream.close();11 return result;12}1314public void mywriteMethod( OutputStream stream, MyClass toWrite ) throws IOException15{16 FSTObjectOutput out conf.getObjectOutput(stream);17 out.writeObject( toWrite, MyClass.class );18 // DONT out.close() when using factory method;19 out.flush();20 stream.close();21}开源中国http://www.oschina.net/p/fst