We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ResultEntity中,若传入数组,那么序列化ResultEntity会出现空字符串。
@Test public void any() throws Exception{ DynamicBytes db = new DynamicBytes(new byte[]{1,2,3}); ResultEntity resultEntity = new ResultEntity("aa","bytes",db ); System.out.println(JsonUtils.toJson(resultEntity)); Bytes3 bytes32 = new Bytes3(new byte[]{1,2,3}); resultEntity = new ResultEntity("aa","bytes32",bytes32 ); System.out.println(JsonUtils.toJson(resultEntity)); }
{"name":"aa","type":"bytes","data":""} {"name":"aa","type":"bytes32","data":""}
{"name":"aa","type":"bytes","data":[Hex或Base64编码的二进制]} {"name":"aa","type":"bytes32","data":"[Hex或Base64编码的二进制]"}
ResultEntity在构造函数里传入DynamicBytes或定长Bytes时,会将字节数组通过UTF8转码为字符串,这一步将产生不可读的字符串。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
ResultEntity中,若传入数组,那么序列化ResultEntity会出现空字符串。
测试代码
当前结果:
期望结果
原因分析
ResultEntity在构造函数里传入DynamicBytes或定长Bytes时,会将字节数组通过UTF8转码为字符串,这一步将产生不可读的字符串。
The text was updated successfully, but these errors were encountered: