Here you can find the source of byteToBase64(byte[] data)
public static String byteToBase64(byte[] data)
//package com.java2s; //License from project: Apache License import javax.xml.bind.DatatypeConverter; public class Main { public static String byteToBase64(byte[] data) { return DatatypeConverter.printBase64Binary(data); }/* w ww . j a va2 s. co m*/ }