heting

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            40 隨筆 :: 9 文章 :: 45 評論 :: 0 Trackbacks
           1  
          import sun.misc.BASE64Decoder;
            
          public static String getFromBASE64(String s) 
           2        if (s == nullreturn null
           3        BASE64Decoder decoder = new BASE64Decoder(); 
           4        try 
           5        byte[] b = decoder.decodeBuffer(s); 
           6        return new String(b); 
           7        }
           catch (Exception e) 
           8        return null
           9        }
           
          10    }

          11    public static String getBASE64(String s) 
          12        if (s == nullreturn null
          13        return (new sun.misc.BASE64Encoder()).encode( s.getBytes() ); 
          14    }
           
          15    
          posted on 2008-11-08 10:47 賀挺 閱讀(1606) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 天台县| 无锡市| 五台县| 石嘴山市| 丰城市| 银川市| 天长市| 怀集县| 北川| 曲阳县| 德惠市| 容城县| 白沙| 萨迦县| 田林县| 常山县| 女性| 黑水县| 麻江县| 武城县| 兰溪市| 抚顺市| 江安县| 抚远县| 通渭县| 如东县| 航空| 芜湖市| 聂荣县| 广丰县| 陆河县| 河东区| 辉南县| 五华县| 万宁市| 永登县| 彭阳县| 福泉市| 宜良县| 庄浪县| 阿鲁科尔沁旗|