FromBase64.java
上传用户:liangcc
上传日期:2019-05-24
资源大小:4412k
文件大小:1k
- package com.softeem.webmail.action.receivemail;
- import sun.misc.BASE64Decoder;
- public class FromBase64 {
- public static String getFromBase64(String s) {
- if (s == null) {
- return null;
- }
- BASE64Decoder decoder = new BASE64Decoder();
- try {
- byte[] b = decoder.decodeBuffer(s);
- return new String(b);
- } catch (Exception e) {
- System.out.println("解码失败..." + e);
- return null;
- }
- }
-
- public static void main(String[] args) {
- String str = FromBase64.getFromBase64("=?gbk?Q?=CD=F8=C2=E7Q0641=C5=E0=D1=B5=C7=E9=BF=F6=B1=ED.xls?=");
- System.out.println(str);
- }
- }