-
Notifications
You must be signed in to change notification settings - Fork 547
Closed
Description
问题描述
BigDecimal用JSONB反序列化时报错
环境信息
请填写以下信息:
fastjson2版本:2.0.53_preview01
报错:
com.alibaba.fastjson2.JSONException: readInt32Value not support INT64 -56, offset 4/4
at com.alibaba.fastjson2.JSONBDump.readInt32Value(JSONBDump.java:637)
at com.alibaba.fastjson2.JSONBDump.dumpAny(JSONBDump.java:278)
at com.alibaba.fastjson2.JSONBDump.<init>(JSONBDump.java:45)
at com.alibaba.fastjson2.JSONB.toJSONString(JSONB.java:1288)
重现步骤
单测可以复现
- 使用
xxx.xxx方法 - 输入
...数据 - 出现
...错误
@Test
public void testB() {
BigDecimal numberInText2 = new BigDecimal("20.0");
byte[] bytes = com.alibaba.fastjson2.JSONB.toBytes(numberInText2);
String jsonString = com.alibaba.fastjson2.JSONB.toJSONString(bytes);
}