Here you can find the source of base64(final byte[] bytes)
public static String base64(final byte[] bytes)
//package com.java2s; //License from project: Open Source License import javax.xml.bind.DatatypeConverter; public class Main { public static String base64(final byte[] bytes) { return DatatypeConverter.printBase64Binary(bytes); }/*w ww.ja v a2s . c om*/ public static byte[] base64(final String str) { return DatatypeConverter.parseBase64Binary(str); } }