Here you can find the source of toB64(byte[] bytes)
public static String toB64(byte[] bytes)
//package com.java2s; /*/*from w w w . j ava 2s . c om*/ * Utils.java - Copyright(c) 2013 Joe Pasqua * Provided under the MIT License. See the LICENSE file for details. * Created: Jul 8, 2013 */ public class Main { public static String toB64(byte[] bytes) { return javax.xml.bind.DatatypeConverter.printBase64Binary(bytes); } }