java 微服务间对象传输
使用ObjectMapper
字节转对象:
object = objectMapper.readValue(byte[], class.class)
Object转对象(直接强转报错):
object = objectMapper.convertValue(json, class.class)
使用ObjectMapper
字节转对象:
object = objectMapper.readValue(byte[], class.class)
Object转对象(直接强转报错):
object = objectMapper.convertValue(json, class.class)