-
Notifications
You must be signed in to change notification settings - Fork 499
faq_cn
Shaojin Wen edited this page Feb 9, 2024
·
17 revisions
答:fastjson2支持JDK 8+,每次构建都会验证在JDK 8/11/17/21三个JDK LTS版本上验证。
支持,fastjson2序列化支持输出为char[]和byte[]。不需要将byte[]转成String再做parse,可以提升性能。使用如下:
- 从byte[]反序列化
byte[] utf8 = ...;
Bean bean = JSON.parseObject(utf8, Bean.class);
- 序列化为utf8 bytes
Bean bean = ...;
byte[] utf8 = JSON.toBytes(bean);