📄 base64bm.java
字号:
import java.io.*;
public class base64bm
{
public static void main(String args[])
{
String str="基于E-mail的截获与还原测试邮件";
String output;
output=getBASE64(str);
System.out.println(output);
try
{
byte[] bt =output.getBytes();
FileOutputStream finput=new FileOutputStream("base64.txt");
finput.write(bt);
finput.close();
}catch(IOException e)
{
System.out.println(e);
}
}
public static String getBASE64(String s)
{
if (s == null) return null;
return (new sun.misc.BASE64Encoder()).encode( s.getBytes() );
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -