Java Base64 Decode decodeBase64(String str)

Here you can find the source of decodeBase64(String str)

Description

decode Base

License

Apache License

Declaration

public static String decodeBase64(String str) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.IOException;

public class Main {
    public static String decodeBase64(String str) {
        if ("".equals(str) && null == str) {
            return null;
        } else {//from  ww  w . j  av a2  s .  c o m
            try {
                byte[] b = new sun.misc.BASE64Decoder().decodeBuffer(str);
                return new String(b);
            } catch (IOException e) {
                e.printStackTrace();
                return null;
            }
        }
    }
}

Related

  1. decodeBase64(InputStream is, OutputStream os)
  2. decodeBase64(String base64Data)
  3. decodeBase64(String data)
  4. decodeBase64(String data)
  5. decodeBASE64(String pEncoded)
  6. decodeBase64AsUtf8(String data)
  7. decodeBase64Mime(String encoded)
  8. decodeBase64String(String str)