Here you can find the source of toBase64(byte[] array)
private static String toBase64(byte[] array)
//package com.java2s; //License from project: Open Source License import java.util.Base64; public class Main { private static String toBase64(byte[] array) { return Base64.getEncoder().encodeToString(array); }// ww w. j a v a 2 s . c om }