首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

android 使用BASE64Decoder and BASE64Encoder,该如何处理

2012-03-04 
android 使用BASE64Decoder and BASE64Encoderimport sun.misc.BASE64Decoderimport sun.misc.BASE64Enco

android 使用BASE64Decoder and BASE64Encoder
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;



  /** 
  * BASE64解密 
  *  
  * @param key 
  * @return 
  * @throws Exception 
  */  
  public static byte[] decryptBASE64(String key) throws Exception {  
  return (new BASE64Decoder()).decodeBuffer(key);  
  }  
  
  /** 
  * BASE64加密 
  *  
  * @param key 
  * @return 
  * @throws Exception 
  */  
  public static String encryptBASE64(byte[] key) throws Exception {  
  return (new BASE64Encoder()).encodeBuffer(key);  
  }  
报了以下错误:

java.long.NoClassDefFoundError: sun.misc.BASE64Encoder

请教如何解决?




[解决办法]
学习 帮忙
[解决办法]
这是sun的api,需要下载,然后将jar添加到工程中。
http://www.findjar.com/index.x;jsessionid=043E76A75BE38839965B429864177DC0?query=un.misc.BASE64Decoder

热点排行