当前位置: 首页>>代码示例>>Java>>正文


Java MessagePack.createBufferUnpacker方法代码示例

本文整理汇总了Java中org.msgpack.MessagePack.createBufferUnpacker方法的典型用法代码示例。如果您正苦于以下问题:Java MessagePack.createBufferUnpacker方法的具体用法?Java MessagePack.createBufferUnpacker怎么用?Java MessagePack.createBufferUnpacker使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.msgpack.MessagePack的用法示例。


在下文中一共展示了MessagePack.createBufferUnpacker方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testModifiersFieldsClass

import org.msgpack.MessagePack; //导入方法依赖的package包/类
@Override
   public void testModifiersFieldsClass(ModifiersFieldsClass v) throws Exception {
MessagePack msgpack = new MessagePack();
TemplateRegistry registry = new TemplateRegistry(null);
ReflectionBeansTemplateBuilder builder = new ReflectionBeansTemplateBuilder(registry);
Template<ModifiersFieldsClass> tmpl = builder.buildTemplate(ModifiersFieldsClass.class);
BufferPacker packer = msgpack.createBufferPacker();
tmpl.write(packer, v);
byte[] bytes = packer.toByteArray();
BufferUnpacker unpacker = msgpack.createBufferUnpacker();
unpacker.resetReadByteCount();
unpacker.wrap(bytes);
ModifiersFieldsClass ret = tmpl.read(unpacker, null);
assertEquals(v, ret);
assertEquals(bytes.length, unpacker.getReadByteCount());
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:17,代码来源:TestReflectionBeansBufferPackBufferUnpack.java

示例2: testUserDefinedTypeFieldsClassNotNullable

import org.msgpack.MessagePack; //导入方法依赖的package包/类
@Override
   public void testUserDefinedTypeFieldsClassNotNullable(UserDefinedTypeFieldsClassNotNullable v) throws Exception {
MessagePack msgpack = new MessagePack();
TemplateRegistry registry = new TemplateRegistry(null);
ReflectionTemplateBuilder builder = new ReflectionTemplateBuilder(registry);
Template<UserDefinedTypeFieldsClassNotNullable> tmpl = builder.buildTemplate(UserDefinedTypeFieldsClassNotNullable.class);
ByteArrayOutputStream out = new ByteArrayOutputStream();
Packer packer = msgpack.createPacker(out);
tmpl.write(packer, v);
byte[] bytes = out.toByteArray();
BufferUnpacker unpacker = msgpack.createBufferUnpacker();
unpacker.resetReadByteCount();
unpacker.wrap(bytes);
UserDefinedTypeFieldsClassNotNullable ret = tmpl.read(unpacker, null);
assertEquals(v, ret);
assertEquals(bytes.length, unpacker.getReadByteCount());
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:18,代码来源:TestReflectionPackBufferUnpack.java

示例3: testReferenceTypeFieldsClass

import org.msgpack.MessagePack; //导入方法依赖的package包/类
@Override
   public void testReferenceTypeFieldsClass(ReferenceTypeFieldsClass v) throws Exception {
MessagePack msgpack = new MessagePack();
TemplateRegistry registry = new TemplateRegistry(null);
ReflectionBeansTemplateBuilder builder = new ReflectionBeansTemplateBuilder(registry);
Template<ReferenceTypeFieldsClass> tmpl = builder.buildTemplate(ReferenceTypeFieldsClass.class);
ByteArrayOutputStream out = new ByteArrayOutputStream();
Packer packer = msgpack.createPacker(out);
tmpl.write(packer, v);
byte[] bytes = out.toByteArray();
BufferUnpacker unpacker = msgpack.createBufferUnpacker();
unpacker.resetReadByteCount();
unpacker.wrap(bytes);
ReferenceTypeFieldsClass ret = tmpl.read(unpacker, null);
assertEquals(v, ret);
assertEquals(bytes.length, unpacker.getReadByteCount());
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:18,代码来源:TestReflectionBeansPackBufferUnpack.java

示例4: testPrimitiveTypeFieldsClass

import org.msgpack.MessagePack; //导入方法依赖的package包/类
@Override
   public void testPrimitiveTypeFieldsClass(PrimitiveTypeFieldsClass v) throws Exception {
MessagePack msgpack = new MessagePack();
TemplateRegistry registry = new TemplateRegistry(null);
ReflectionTemplateBuilder builder = new ReflectionTemplateBuilder(registry);
Template<PrimitiveTypeFieldsClass> tmpl = builder.buildTemplate(PrimitiveTypeFieldsClass.class);
BufferPacker packer = msgpack.createBufferPacker();
tmpl.write(packer, v);
byte[] bytes = packer.toByteArray();
BufferUnpacker unpacker = msgpack.createBufferUnpacker();
unpacker.resetReadByteCount();
unpacker.wrap(bytes);
PrimitiveTypeFieldsClass ret = tmpl.read(unpacker, null);
assertEquals(v, ret);
assertEquals(bytes.length, unpacker.getReadByteCount());
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:17,代码来源:TestReflectionBufferPackBufferUnpack.java

示例5: testReferenceTypeFieldsClassNotNullable

import org.msgpack.MessagePack; //导入方法依赖的package包/类
@Override
   public void testReferenceTypeFieldsClassNotNullable(ReferenceTypeFieldsClassNotNullable v) throws Exception {
MessagePack msgpack = new MessagePack();
TemplateRegistry registry = new TemplateRegistry(null);
ReflectionBeansTemplateBuilder builder = new ReflectionBeansTemplateBuilder(registry);
Template<ReferenceTypeFieldsClassNotNullable> tmpl = builder.buildTemplate(ReferenceTypeFieldsClassNotNullable.class);
BufferPacker packer = msgpack.createBufferPacker();
tmpl.write(packer, v);
byte[] bytes = packer.toByteArray();
BufferUnpacker u = msgpack.createBufferUnpacker();
u.resetReadByteCount();
u.wrap(bytes);
Value value = u.readValue();
Converter unpacker = new Converter(value);
ReferenceTypeFieldsClassNotNullable ret = tmpl.read(unpacker, null);
assertEquals(v, ret);
assertEquals(bytes.length, u.getReadByteCount());
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:19,代码来源:TestReflectionBeansBufferPackConvert.java

示例6: testUserDefinedTypeFieldsClassNotNullable

import org.msgpack.MessagePack; //导入方法依赖的package包/类
@Override
   public void testUserDefinedTypeFieldsClassNotNullable(UserDefinedTypeFieldsClassNotNullable v) throws Exception {
MessagePack msgpack = new MessagePack();
TemplateRegistry registry = new TemplateRegistry(null);
ReflectionBeansTemplateBuilder builder = new ReflectionBeansTemplateBuilder(registry);
Template<UserDefinedTypeFieldsClassNotNullable> tmpl = builder.buildTemplate(UserDefinedTypeFieldsClassNotNullable.class);
BufferPacker packer = msgpack.createBufferPacker();
tmpl.write(packer, v);
byte[] bytes = packer.toByteArray();
BufferUnpacker unpacker = msgpack.createBufferUnpacker();
unpacker.resetReadByteCount();
unpacker.wrap(bytes);
UserDefinedTypeFieldsClassNotNullable ret = tmpl.read(unpacker, null);
assertEquals(v, ret);
assertEquals(bytes.length, unpacker.getReadByteCount());
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:17,代码来源:TestReflectionBeansBufferPackBufferUnpack.java

示例7: testInheritanceClassNotNullable

import org.msgpack.MessagePack; //导入方法依赖的package包/类
@Override
   public void testInheritanceClassNotNullable(InheritanceClassNotNullable v) throws Exception {
MessagePack msgpack = new MessagePack();
TemplateRegistry registry = new TemplateRegistry(null);
ReflectionBeansTemplateBuilder builder = new ReflectionBeansTemplateBuilder(registry);
Template<InheritanceClassNotNullable> tmpl = builder.buildTemplate(InheritanceClassNotNullable.class);
ByteArrayOutputStream out = new ByteArrayOutputStream();
Packer packer = msgpack.createPacker(out);
tmpl.write(packer, v);
byte[] bytes = out.toByteArray();
BufferUnpacker u = msgpack.createBufferUnpacker();
u.resetReadByteCount();
u.wrap(bytes);
Value value = u.readValue();
Converter unpacker = new Converter(value);
InheritanceClassNotNullable ret = tmpl.read(unpacker, null);
assertEquals(v, ret);
assertEquals(bytes.length, u.getReadByteCount());
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:20,代码来源:TestReflectionBeansPackConvert.java

示例8: testMessagePackableTypeFieldsClassNotNullable

import org.msgpack.MessagePack; //导入方法依赖的package包/类
@Override
   public void testMessagePackableTypeFieldsClassNotNullable(MessagePackableTypeFieldsClassNotNullable v) throws Exception {
MessagePack msgpack = new MessagePack();
TemplateRegistry registry = new TemplateRegistry(null);
ReflectionBeansTemplateBuilder builder = new ReflectionBeansTemplateBuilder(registry);
Template<MessagePackableTypeFieldsClassNotNullable> tmpl = builder.buildTemplate(MessagePackableTypeFieldsClassNotNullable.class);
ByteArrayOutputStream out = new ByteArrayOutputStream();
Packer packer = msgpack.createPacker(out);
tmpl.write(packer, v);
byte[] bytes = out.toByteArray();
BufferUnpacker unpacker = msgpack.createBufferUnpacker();
unpacker.resetReadByteCount();
unpacker.wrap(bytes);
MessagePackableTypeFieldsClassNotNullable ret = tmpl.read(unpacker, null);
assertEquals(v, ret);
assertEquals(bytes.length, unpacker.getReadByteCount());
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:18,代码来源:TestReflectionBeansPackBufferUnpack.java

示例9: testListTypeFieldsClass

import org.msgpack.MessagePack; //导入方法依赖的package包/类
@Override
   public void testListTypeFieldsClass(ListTypeFieldsClass v) throws Exception {
MessagePack msgpack = new MessagePack();
TemplateRegistry registry = new TemplateRegistry(null);
JavassistTemplateBuilder builder = new JavassistTemplateBuilder(registry);
Template<ListTypeFieldsClass> tmpl = builder.buildTemplate(ListTypeFieldsClass.class);
BufferPacker packer = msgpack.createBufferPacker();
tmpl.write(packer, v);
byte[] bytes = packer.toByteArray();
BufferUnpacker unpacker = msgpack.createBufferUnpacker();
unpacker.resetReadByteCount();
unpacker.wrap(bytes);
ListTypeFieldsClass ret = tmpl.read(unpacker, null);
assertEquals(v, ret);
assertEquals(bytes.length, unpacker.getReadByteCount());
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:17,代码来源:TestJavassistBufferPackBufferUnpack.java

示例10: testUserDefinedTypeFieldsClassNotNullable

import org.msgpack.MessagePack; //导入方法依赖的package包/类
@Override
   public void testUserDefinedTypeFieldsClassNotNullable(UserDefinedTypeFieldsClassNotNullable v) throws Exception {
MessagePack msgpack = new MessagePack();
TemplateRegistry registry = new TemplateRegistry(null);
ReflectionBeansTemplateBuilder builder = new ReflectionBeansTemplateBuilder(registry);
Template<UserDefinedTypeFieldsClassNotNullable> tmpl = builder.buildTemplate(UserDefinedTypeFieldsClassNotNullable.class);
ByteArrayOutputStream out = new ByteArrayOutputStream();
Packer packer = msgpack.createPacker(out);
tmpl.write(packer, v);
byte[] bytes = out.toByteArray();
BufferUnpacker u = msgpack.createBufferUnpacker();
u.resetReadByteCount();
u.wrap(bytes);
Value value = u.readValue();
Converter unpacker = new Converter(value);
UserDefinedTypeFieldsClassNotNullable ret = tmpl.read(unpacker, null);
assertEquals(v, ret);
assertEquals(bytes.length, u.getReadByteCount());
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:20,代码来源:TestReflectionBeansPackConvert.java

示例11: testPrimitiveTypeFieldsClass

import org.msgpack.MessagePack; //导入方法依赖的package包/类
@Override
   public void testPrimitiveTypeFieldsClass(PrimitiveTypeFieldsClass v) throws Exception {
MessagePack msgpack = new MessagePack();
TemplateRegistry registry = new TemplateRegistry(null);
ReflectionTemplateBuilder builder = new ReflectionTemplateBuilder(registry);
Template<PrimitiveTypeFieldsClass> tmpl = builder.buildTemplate(PrimitiveTypeFieldsClass.class);
BufferPacker packer = msgpack.createBufferPacker();
tmpl.write(packer, v);
byte[] bytes = packer.toByteArray();
BufferUnpacker u = msgpack.createBufferUnpacker();
u.resetReadByteCount();
u.wrap(bytes);
Value value = u.readValue();
Converter unpacker = new Converter(value);
PrimitiveTypeFieldsClass ret = tmpl.read(unpacker, null);
assertEquals(v, ret);
assertEquals(bytes.length, u.getReadByteCount());
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:19,代码来源:TestReflectionBufferPackConvert.java

示例12: testInheritanceClassNotNullable

import org.msgpack.MessagePack; //导入方法依赖的package包/类
@Override
   public void testInheritanceClassNotNullable(InheritanceClassNotNullable v) throws Exception {
MessagePack msgpack = new MessagePack();
TemplateRegistry registry = new TemplateRegistry(null);
JavassistTemplateBuilder builder = new JavassistTemplateBuilder(registry);
Template<InheritanceClassNotNullable> tmpl = builder.buildTemplate(InheritanceClassNotNullable.class);
ByteArrayOutputStream out = new ByteArrayOutputStream();
Packer packer = msgpack.createPacker(out);
tmpl.write(packer, v);
byte[] bytes = out.toByteArray();
BufferUnpacker u = msgpack.createBufferUnpacker();
u.resetReadByteCount();
u.wrap(bytes);
Value value = u.readValue();
Converter unpacker = new Converter(value);
InheritanceClassNotNullable ret = tmpl.read(unpacker, null);
assertEquals(v, ret);
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:19,代码来源:TestJavassistPackConvert.java

示例13: testReferenceTypeFieldsClass

import org.msgpack.MessagePack; //导入方法依赖的package包/类
@Override
   public void testReferenceTypeFieldsClass(ReferenceTypeFieldsClass v) throws Exception {
MessagePack msgpack = new MessagePack();
TemplateRegistry registry = new TemplateRegistry(null);
JavassistTemplateBuilder builder = new JavassistTemplateBuilder(registry);
Template<ReferenceTypeFieldsClass> tmpl = builder.buildTemplate(ReferenceTypeFieldsClass.class);
BufferPacker packer = msgpack.createBufferPacker();
tmpl.write(packer, v);
byte[] bytes = packer.toByteArray();
BufferUnpacker unpacker = msgpack.createBufferUnpacker();
unpacker.resetReadByteCount();
unpacker.wrap(bytes);
ReferenceTypeFieldsClass ret = tmpl.read(unpacker, null);
assertEquals(v, ret);
assertEquals(bytes.length, unpacker.getReadByteCount());
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:17,代码来源:TestJavassistBufferPackBufferUnpack.java

示例14: testReferenceCycleTypeFieldsClassNotNullable

import org.msgpack.MessagePack; //导入方法依赖的package包/类
@org.junit.Ignore
@Override
// FIXME #MN next version
public void testReferenceCycleTypeFieldsClassNotNullable(
        ReferenceCycleTypeFieldsClassNotNullable v) throws Exception {
    System.getProperties().setProperty(TemplatePrecompiler.DEST,
            "./target/test-classes");
    MessagePack msgpack = new MessagePack();
    try {
        TemplatePrecompiler.saveTemplateClass(new TemplateRegistry(null),
                ReferenceCycleTypeFieldsClassNotNullable.class);
        Template<ReferenceCycleTypeFieldsClassNotNullable> tmpl = msgpack
                .lookup(ReferenceCycleTypeFieldsClassNotNullable.class);
        BufferPacker packer = msgpack.createBufferPacker();
        tmpl.write(packer, v);
        byte[] bytes = packer.toByteArray();
        BufferUnpacker unpacker = msgpack.createBufferUnpacker();
        unpacker.wrap(bytes);
        ReferenceCycleTypeFieldsClassNotNullable ret = tmpl.read(unpacker,
                null);
        assertEquals(v, ret);
    } finally {
        TemplatePrecompiler
                .deleteTemplateClass(ReferenceCycleTypeFieldsClassNotNullable.class);
        msgpack.unregister(ReferenceCycleTypeFieldsClassNotNullable.class);
    }
}
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:28,代码来源:TestTemplatePreCompilerBufferPackBufferUnpack.java

示例15: testShort

import org.msgpack.MessagePack; //导入方法依赖的package包/类
@Override
   public void testShort(short v) throws Exception {
MessagePack msgpack = new JSON();
       Unconverter packer = new Unconverter(msgpack);
packer.write(v);
       byte[] bytes = packer.getResult().toString().getBytes("UTF-8");
       Unpacker unpacker = msgpack.createBufferUnpacker(bytes);
short ret = unpacker.readShort();
assertEquals(v, ret);
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:11,代码来源:TestValueToStringJSONUnpack.java


注:本文中的org.msgpack.MessagePack.createBufferUnpacker方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。