我正在尝试使用messagpack.write(map)
. 在使用messagepack.read(byte[])
i got进行反序列化期间MapValue
。但我无法使用MapValue.get(key)
. 看下面这个问题
HashMap<Object,Object> map = new HashMap<Object, Object>();
map.put(1,"ONE");
map.put("ONE","TWO");
MessagePack m= new MessagePack();
byte[] b = m.write(map);
MessagePack m1 = new MessagePack();
MapValue value = (MapValue)m1.read(b);
System.out.println(value);// here I am getting {1:"ONE",2:"TWO"}
System.out.println( value.get(1)); // printing the value for key 1. I am getting null.
请对此提供帮助。谢谢。
瑙萨德