📄 decode_base64.java
字号:
//Base64解码程序
//import sun.misc.BASE64Encoder;
import sun.misc.BASE64Decoder;
public class decode_Base64
{
public static void main(String args[])
{
ASCII2BASE64();
}
static void ASCII2BASE64()
{
String str="u/nT2kUtbWFpbLXEvdi78dPru7nUrbLiytTTyrz+";
String output=getFromBASE64(str);
System.out.println("Base64编码:\n"+str);
System.out.println("原码:\n"+output);
}
public static String getFromBASE64(String s) //BASE54 解码
{
if (s == null)
return null;
BASE64Decoder decoder = new BASE64Decoder();
try {
byte[] b = decoder.decodeBuffer(s);
return new String(b);
}
catch (Exception e) { return null; }
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -