decode base64 string to string - Android File Input Output

Android examples for File Input Output:Base64

Description

decode base64 string to string

Demo Code


import android.util.Base64;

public class Main{
    /* w  ww.  ja v  a  2 s  .co  m*/
    public static String decode(String s) {
        s = StringsUtil.trim(s);
        if ("".equals(s))
            return s;
        byte[] result = Base64.decode(s, Base64.DEFAULT);
        String res = new String(result);
        return res;
    }
}

Related Tutorials