Package org.msgpack.packer

Examples of org.msgpack.packer.Unconverter


    }

    @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;
  }
View Full Code Here


    private final Unconverter uc;
    private IOException exception;

    public UnpackerIterator(AbstractUnpacker u) {
        this.u = u;
        this.uc = new Unconverter(u.msgpack);
    }
View Full Code Here

    }

    protected abstract void readValue(Unconverter uc) throws IOException;

    public Value readValue() throws IOException {
        Unconverter uc = new Unconverter(msgpack);
        readValue(uc);
        return uc.getResult();
    }
View Full Code Here

  protected Unconverter sparsePacker;

  public ValueEncoder() {
    this.type = Type.NONE;
    MessagePack messagePack = new MessagePack();
    this.packer = new Unconverter(messagePack);
    this.sparsePacker = new Unconverter(messagePack);
  }
View Full Code Here

TOP

Related Classes of org.msgpack.packer.Unconverter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.