📄 base64.java
字号:
package com.cwq.batchmail.util;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
/**
* 用于登录ESMTP的base64编码
*
*/
public class Base64 {
public static String encode(String s) {
if (s == null)
return null;
return (new BASE64Encoder()).encode(s.getBytes());
}
public static String decode(String s) {
if (s == null)
return null;
try {
return new String(new BASE64Decoder().decodeBuffer(s));
} catch (Exception e) {
}
return null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -