使用protostuff系列化自定義對(duì)象時(shí)正常解析,但是使用HashMap卻得不到反序列化的對(duì)象。HashMap<String,String> map = new HashMap<>(); map.put("Message","test"); Schema<HashMap> schema = RuntimeSchema.getSchema(HashMap.class); LinkedBuffer buffer = LinkedBuffer.allocate(4096); byte[] protostuff = ProtostuffIOUtil.toByteArray(map, schema, buffer); HashMap<String,String> resultMap = new HashMap<>(); Schema<HashMap> schema2 = RuntimeSchema.getSchema(HashMap.class); ProtostuffIOUtil.mergeFrom(protostuff, resultMap, schema2); System.out.println(resultMap.get("Message"));
protostuff不能序列化HashMap?
慕運(yùn)維8079593
2019-03-13 18:19:12