Here you can find the source of base64UrlEncode(final byte[] v)
private static String base64UrlEncode(final byte[] v)
//package com.java2s; //License from project: Mozilla Public License import java.util.Base64; import java.util.Base64.Encoder; public class Main { private static final Encoder BASE64_ENC = Base64.getUrlEncoder(); private static String base64UrlEncode(final byte[] v) { return BASE64_ENC.encodeToString(v).replaceAll("=*$", ""); }/*from ww w.j a v a 2 s . com*/ }