String From Base64 String - Android File Input Output

Android examples for File Input Output:Base64

Description

String From Base64 String

Demo Code


//package com.java2s;
import android.util.Base64;
import java.io.UnsupportedEncodingException;

public class Main {
    public static String StringFromBase64String(String base64String) {
        byte[] data1 = Base64.decode(base64String, Base64.NO_WRAP
                | Base64.NO_PADDING);//from   w w w. j  a  v a  2s. c  om
        String result = null;
        try {
            result = new String(data1, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return result;
    }
}

Related Tutorials