Example usage for android.util Base64 encodeToString

List of usage examples for android.util Base64 encodeToString

Introduction

In this page you can find the example usage for android.util Base64 encodeToString.

Prototype

public static String encodeToString(byte[] input, int flags) 

Source Link

Document

Base64-encode the given data and return a newly allocated String with the result.

Usage

From source file:Main.java

public static String encode(String str) {
    return Base64.encodeToString(str.getBytes(), Base64.DEFAULT);
}

From source file:Main.java

private static String toHex(byte[] buf) {
    return Base64.encodeToString(buf, Base64.DEFAULT);
}

From source file:Main.java

public static String encode(byte[] source) {
    return Base64.encodeToString(source, Base64.DEFAULT);
}

From source file:Main.java

private static String encode(byte[] src) {
    return Base64.encodeToString(src, Base64.DEFAULT);
}

From source file:Main.java

public static String base64(String str) {
    return Base64.encodeToString(str.getBytes(), Base64.DEFAULT);
}

From source file:Main.java

public static String base64Encode(byte[] b) {
    return Base64.encodeToString(b, Base64.DEFAULT).trim();
}

From source file:Main.java

public static String encode(String content) {
    return Base64.encodeToString(content.getBytes(), Base64.DEFAULT);
}

From source file:Main.java

public static String base64Encode(String msg) {
    return Base64.encodeToString(msg.getBytes(), Base64.URL_SAFE | Base64.NO_WRAP);
}

From source file:Main.java

public static String encData(String data) {
    String e = Base64.encodeToString(data.getBytes(), Base64.DEFAULT);
    return e.substring(0, 2) + "JX" + e.substring(2);
}

From source file:Main.java

public static String encodeToString(String str) {
    return Base64.encodeToString(str.getBytes(), Base64.DEFAULT);
}