本文整理汇总了Java中org.objenesis.strategy.SerializingInstantiatorStrategy类的典型用法代码示例。如果您正苦于以下问题:Java SerializingInstantiatorStrategy类的具体用法?Java SerializingInstantiatorStrategy怎么用?Java SerializingInstantiatorStrategy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SerializingInstantiatorStrategy类属于org.objenesis.strategy包,在下文中一共展示了SerializingInstantiatorStrategy类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: deserializeFrom
import org.objenesis.strategy.SerializingInstantiatorStrategy; //导入依赖的package包/类
@Override
public Object deserializeFrom(final String filename)
throws SerializationException {
LOGGER.info("Deserializing object from " + filename);
try {
final Kryo kryo = new Kryo();
final Input input = new Input(new FileInputStream(filename));
kryo.setInstantiatorStrategy(new SerializingInstantiatorStrategy());
final Object obj = kryo.readClassAndObject(input);
input.close();
return obj;
} catch (final FileNotFoundException e) {
throw new ISerializationStrategy.SerializationException(e);
}
}
开发者ID:mast-group,项目名称:tassal,代码行数:18,代码来源:KryoSerialization.java
示例2: getKryoObject
import org.objenesis.strategy.SerializingInstantiatorStrategy; //导入依赖的package包/类
private Kryo getKryoObject() {
Kryo kryo = new Kryo();
kryo.setInstantiatorStrategy(new SerializingInstantiatorStrategy());
kryo.register(KMeansDetectionModel.class);
kryo.register(AthenaMLFeatureConfiguration.class);
kryo.register(DetectionModel.class);
kryo.register(FeatureConstraint.class);
kryo.register(AthenaFeatureField.class);
kryo.register(AthenaIndexField.class);
kryo.register(AthenaField.class);
kryo.register(FeatureConstraintOperator.class);
kryo.register(FeatureConstraintOperatorType.class);
kryo.register(FeatureConstraintType.class);
kryo.register(AthenaMLFeatureConfiguration.class);
kryo.register(Marking.class);
kryo.register(FeatureDatabaseMgmtManager.class);
kryo.register(Indexing.class);
kryo.register(ClusterModelSummary.class);
kryo.register(KMeansDetectionAlgorithm.class);
kryo.register(KmeansModelSummary.class);
kryo.register(Accumulator.class);
kryo.register(ClusterModelSummary.UniqueFlowAccumulatorParam.class);
kryo.register(ClusterModelSummary.LongAccumulatorParam.class);
kryo.register(ClassificationMarkingElement.class);
kryo.register(TargetAthenaValue.class);
return kryo;
}
开发者ID:shlee89,项目名称:athena,代码行数:28,代码来源:ModelSerialization.java
示例3: ObjenesisSerializer
import org.objenesis.strategy.SerializingInstantiatorStrategy; //导入依赖的package包/类
/**
* Default constructor using the {@link org.objenesis.strategy.SerializingInstantiatorStrategy}
*/
public ObjenesisSerializer() {
super(new SerializingInstantiatorStrategy());
}
开发者ID:easymock,项目名称:objenesis,代码行数:7,代码来源:ObjenesisSerializer.java
注:本文中的org.objenesis.strategy.SerializingInstantiatorStrategy类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论