fastjson byte[] convert to json String bug

ep6jt1vc  于 2021-11-27  发布在  Java
关注(0)|答案(1)|浏览(420)

1.JSON.toJSONString(new byte[]{0,4,8}); //result is "AAQI"
2.JSON.toJSON(new byte[]{0,4,8}).toString(); //result is "[0,4,8]"

What I need is the second result, how to use JSON.toJSONString method, or I must have to use the second method?

dsf9zpds

dsf9zpds1#

  1. byte[] -> base64 encoded string
  2. byte[] -> Array -> String

相关问题