在jdk自己的类库里面有这样一个类
sun.misc.BASE64Encoder//他是实现base64编码的类
sun.misc.BASE64Decoder//他是实现base64解码的类BASE64Encoder类有下面的方法:
public String encode(String s) throws Exception{}//s代表要进行base64编码的字符串,这个函数返回一个字符串就是base64编码后的字符串。BASE64Decoder类有下面的方法:
public String decodeBuffer(String s) throws Exception()//s代表要解码的base64编码的字符串,返回解码后的字符串。以上两个方法,都会抛出异常,必须在
try{
//写在这里面
}catch(Exception e){}祝你好运!
sun.misc.BASE64Encoder//他是实现base64编码的类
sun.misc.BASE64Decoder//他是实现base64解码的类BASE64Encoder类有下面的方法:
public String encode(String s) throws Exception{}//s代表要进行base64编码的字符串,这个函数返回一个字符串就是base64编码后的字符串。BASE64Decoder类有下面的方法:
public String decodeBuffer(String s) throws Exception()//s代表要解码的base64编码的字符串,返回解码后的字符串。以上两个方法,都会抛出异常,必须在
try{
//写在这里面
}catch(Exception e){}祝你好运!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货