搜索
您的当前位置:首页正文

Input byte array has incorrect ending byte at 420652

来源:榕意旅游网

这个问题一般都是转译的问题。或者在写decode的时候写成了file.byte[]。

if (file.contains("data:")) {
    int start = file.indexOf(",");
    file = file.substring(start + 1);
}
final Base64.Decoder decoder = Base64.getDecoder();
file = file.replaceAll("\r|\n", "");
file = file.trim();
byte[] bytes = decoder.decode(file);

这样写基本可以解决这个问题。

因篇幅问题不能全部显示,请点此查看更多更全内容

Top