encode Base with android.util.Base64 - Android File Input Output

Android examples for File Input Output:Base64

Description

encode Base with android.util.Base64

Demo Code


//package com.java2s;

import android.util.Base64;
import java.io.UnsupportedEncodingException;

public class Main {

    public static String encodeBase64(String str, String charset, int flags)
            throws UnsupportedEncodingException {
        return Base64.encodeToString(str.getBytes(charset), flags);
    }//from  w  w w  .  j a  v a 2  s .  c o  m
}

Related Tutorials