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


Java Converter.readValue方法代码示例

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


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

示例1: testList

import org.msgpack.unpacker.Converter; //导入方法依赖的package包/类
@Override
   public <E> void testList(List<E> v, Class<E> elementClass) throws Exception {
MessagePack msgpack = new MessagePack();
       Unconverter packer = new Unconverter(msgpack);
       if (v == null) {
           packer.writeNil();
       } else {
           packer.writeArrayBegin(v.size());
           for (Object o : v) {
       	packer.write(o);
           }
           packer.writeArrayEnd();
       }
       Value r = packer.getResult();
Converter unpacker = new Converter(msgpack, r);
if (unpacker.trySkipNil()) {
    assertEquals(null, v);
    return;
}
       Value ret = unpacker.readValue();
       assertEquals(r, ret);
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:23,代码来源:TestUnconvertReconvert.java

示例2: testMap

import org.msgpack.unpacker.Converter; //导入方法依赖的package包/类
@Override
   public <K, V> void testMap(Map<K, V> v, Class<K> keyElementClass, Class<V> valueElementClass) throws Exception {
MessagePack msgpack = new MessagePack();
       Unconverter packer = new Unconverter(msgpack);
       if (v == null) {
           packer.writeNil();
       } else {
           packer.writeMapBegin(v.size());
           for (Map.Entry<K, V> e : ((Map<K, V>) v).entrySet()) {
       	packer.write(e.getKey());
       	packer.write(e.getValue());
           }
           packer.writeMapEnd();
       }
       Value r = packer.getResult();
Converter unpacker = new Converter(msgpack, r);
if (unpacker.trySkipNil()) {
    assertEquals(null, v);
    return;
}
       Value ret = unpacker.readValue();
       assertEquals(r, ret);
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:24,代码来源:TestUnconvertReconvert.java

示例3: testBoolean

import org.msgpack.unpacker.Converter; //导入方法依赖的package包/类
@Override
   public void testBoolean(boolean v) throws Exception {
MessagePack msgpack = new MessagePack();
       Unconverter packer = new Unconverter(msgpack);
       packer.write(v);
       Value r = packer.getResult();
       Converter unpacker = new Converter(msgpack, r);
       Value ret = unpacker.readValue();
       assertEquals(r, ret);
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:11,代码来源:TestUnconvertReconvert.java

示例4: testByte

import org.msgpack.unpacker.Converter; //导入方法依赖的package包/类
@Override
   public void testByte(byte v) throws Exception {
MessagePack msgpack = new MessagePack();
       Unconverter packer = new Unconverter(msgpack);
       packer.write(v);
       Value r = packer.getResult();
       Converter unpacker = new Converter(msgpack, r);
       Value ret = unpacker.readValue();
       assertEquals(r, ret);
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:11,代码来源:TestUnconvertReconvert.java

示例5: testShort

import org.msgpack.unpacker.Converter; //导入方法依赖的package包/类
@Override
   public void testShort(short v) throws Exception {
MessagePack msgpack = new MessagePack();
       Unconverter packer = new Unconverter(msgpack);
       packer.write(v);
       Value r = packer.getResult();
       Converter unpacker = new Converter(msgpack, r);
       Value ret = unpacker.readValue();
       assertEquals(r, ret);
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:11,代码来源:TestUnconvertReconvert.java

示例6: testInteger

import org.msgpack.unpacker.Converter; //导入方法依赖的package包/类
@Override
   public void testInteger(int v) throws Exception {
MessagePack msgpack = new MessagePack();
       Unconverter packer = new Unconverter(msgpack);
       packer.write(v);
       Value r = packer.getResult();
       Converter unpacker = new Converter(msgpack, r);
       Value ret = unpacker.readValue();
       assertEquals(r, ret);
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:11,代码来源:TestUnconvertReconvert.java

示例7: testLong

import org.msgpack.unpacker.Converter; //导入方法依赖的package包/类
@Override
   public void testLong(long v) throws Exception {
MessagePack msgpack = new MessagePack();
       Unconverter packer = new Unconverter(msgpack);
       packer.write(v);
       Value r = packer.getResult();
       Converter unpacker = new Converter(msgpack, r);
       Value ret = unpacker.readValue();
       assertEquals(r, ret);
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:11,代码来源:TestUnconvertReconvert.java

示例8: testFloat

import org.msgpack.unpacker.Converter; //导入方法依赖的package包/类
@Override
   public void testFloat(float v) throws Exception {
MessagePack msgpack = new MessagePack();
       Unconverter packer = new Unconverter(msgpack);
       packer.write(v);
       Value r = packer.getResult();
       Converter unpacker = new Converter(msgpack, r);
       Value ret = unpacker.readValue();
assertEquals(r, ret);
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:11,代码来源:TestUnconvertReconvert.java

示例9: testDouble

import org.msgpack.unpacker.Converter; //导入方法依赖的package包/类
@Override
   public void testDouble(double v) throws Exception {
MessagePack msgpack = new MessagePack();
       Unconverter packer = new Unconverter(msgpack);
       packer.write(v);
       Value r = packer.getResult();
       Converter unpacker = new Converter(msgpack, r);
       Value ret = unpacker.readValue();
assertEquals(r, ret);
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:11,代码来源:TestUnconvertReconvert.java

示例10: testBigInteger

import org.msgpack.unpacker.Converter; //导入方法依赖的package包/类
@Override
   public void testBigInteger(BigInteger v) throws Exception {
MessagePack msgpack = new MessagePack();
       Unconverter packer = new Unconverter(msgpack);
       packer.write(v);
       Value r = packer.getResult();
       Converter unpacker = new Converter(msgpack, r);
       Value ret = unpacker.readValue();
       assertEquals(r, ret);
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:11,代码来源:TestUnconvertReconvert.java

示例11: testString

import org.msgpack.unpacker.Converter; //导入方法依赖的package包/类
@Override
   public void testString(String v) throws Exception {
MessagePack msgpack = new MessagePack();
       Unconverter packer = new Unconverter(msgpack);
       packer.write(v);
       Value r = packer.getResult();
       Converter unpacker = new Converter(msgpack, r);
       Value ret = unpacker.readValue();
       assertEquals(r, ret);
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:11,代码来源:TestUnconvertReconvert.java

示例12: testByteArray

import org.msgpack.unpacker.Converter; //导入方法依赖的package包/类
@Override
   public void testByteArray(byte[] v) throws Exception {
MessagePack msgpack = new MessagePack();
       Unconverter packer = new Unconverter(msgpack);
       packer.write(v);
       Value r = packer.getResult();
       Converter unpacker = new Converter(msgpack, r);
       Value ret = unpacker.readValue();
assertEquals(r, ret);
   }
 
开发者ID:nict-wisdom,项目名称:rasc,代码行数:11,代码来源:TestUnconvertReconvert.java


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