Here you can find the source of base64Encode(final byte[] data)
static String base64Encode(final byte[] data)
//package com.java2s; import org.apache.commons.codec.binary.Base64; public class Main { static String base64Encode(final byte[] data) { String res = null;/*www.j av a2 s . c o m*/ try { res = new String(Base64.encodeBase64(data)); } catch (Exception e) { e.printStackTrace(); } return res; } }