Android Base64 Encode encodeBase64(String value)

Here you can find the source of encodeBase64(String value)

Description

encode Base

Declaration

public static String encodeBase64(String value) 

Method Source Code

//package com.java2s;

import android.util.Base64;

public class Main {
    public static String encodeBase64(String value) {
        if (!isEmpty(value)) {
            return Base64.encodeToString(value.getBytes(), Base64.DEFAULT);
        }/*from   www .java  2 s . c  om*/
        return "";
    }

    public static boolean isEmpty(String value) {
        return value == null || value.trim().equals("")
                || value.length() == 0;
    }
}

Related

  1. encode(String s)
  2. encode(final String str)
  3. encode(String source)
  4. encode(String str)