Here you can find the source of convertToBase64(byte[] in)
private static String convertToBase64(byte[] in) throws UnsupportedEncodingException
//package com.java2s; import java.io.UnsupportedEncodingException; import android.util.Base64; public class Main { private static String convertToBase64(byte[] in) throws UnsupportedEncodingException { if (in == null) return null; return new String(Base64.encode(in, Base64.URL_SAFE | Base64.NO_PADDING), "UTF8"); }/*from w w w . j a v a 2s . co m*/ }