本文整理汇总了Java中org.nustaq.serialization.FSTConfiguration.createMinBinConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java FSTConfiguration.createMinBinConfiguration方法的具体用法?Java FSTConfiguration.createMinBinConfiguration怎么用?Java FSTConfiguration.createMinBinConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.nustaq.serialization.FSTConfiguration
的用法示例。
在下文中一共展示了FSTConfiguration.createMinBinConfiguration方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: demo
import org.nustaq.serialization.FSTConfiguration; //导入方法依赖的package包/类
@Test
public void demo() {
FSTConfiguration conf = FSTConfiguration.createMinBinConfiguration();
conf.registerCrossPlatformClassMappingUseSimpleName( Arrays.asList(
(Class)MinBinDemo.class,
(Class)ARecord.class
));
new MBPrinter().printMessage(conf.asByteArray(new MinBinDemo()));
}
示例2: shouldCompatibleSerializeEnumSet
import org.nustaq.serialization.FSTConfiguration; //导入方法依赖的package包/类
@Test
public void shouldCompatibleSerializeEnumSet() throws Exception {
FSTConfiguration conf = FSTConfiguration.createMinBinConfiguration();
byte[] bytes = conf.asByteArray(new Clazz());
Clazz o = (Clazz) conf.asObject(bytes);
Assert.assertEquals(o.enumSet, EnumSet.of(SomeEnum.override, SomeEnum.plain));
}
示例3: shouldCompatibleSerializeEmptyEnumSet
import org.nustaq.serialization.FSTConfiguration; //导入方法依赖的package包/类
@Test
public void shouldCompatibleSerializeEmptyEnumSet() throws Exception {
FSTConfiguration conf = FSTConfiguration.createMinBinConfiguration();
Clazz object = new Clazz();
object.enumSet = EnumSet.noneOf(SomeEnum.class);
byte[] bytes = conf.asByteArray(object);
Clazz o = (Clazz) conf.asObject(bytes);
Assert.assertEquals(o.enumSet, EnumSet.noneOf(SomeEnum.class));
}
示例4: setUp
import org.nustaq.serialization.FSTConfiguration; //导入方法依赖的package包/类
@Override
public void setUp() throws Exception {
FSTConfiguration conf = FSTConfiguration.createMinBinConfiguration();
conf.registerCrossPlatformClassMapping( new String[][] {
{"senum", "ser.Basics$SampleEnum"},
{"special", "ser.Basics$SpecialEnum"},
}
);
out = new FSTObjectOutput(conf);
in = new FSTObjectInput(conf);
}