小编Jes*_*sio的帖子

非法参数异常:使用 Base64.getDecode() 解码字符串值时非法 base64 字符 3a

我正在解码的字符串值是“ed:1234”,但它抛出了 IllegalArgumentException 错误。如果有人知道我为什么有这个错误,将不胜感激。

代码:

String authInfo = "ed:1234";
byte[] bytes = Base64.getDecoder().decode(authInfo);
Run Code Online (Sandbox Code Playgroud)

错误:

java.lang.IllegalArgumentException: Illegal base64 character 3a
Run Code Online (Sandbox Code Playgroud)

java base64 spring decode spring-boot

2
推荐指数
1
解决办法
6950
查看次数

标签 统计

base64 ×1

decode ×1

java ×1

spring ×1

spring-boot ×1