base64 encode byte array to String - Android File Input Output

Android examples for File Input Output:Base64

Description

base64 encode byte array to String

Demo Code


//package com.java2s;

public class Main {
    public static String base64(byte[] target) {
        String temp = android.util.Base64.encodeToString(target, 0);
        return temp.replace('+', '-').replace('/', '_');
    }/*from   w w  w . j av a  2  s. c o m*/
}

Related Tutorials