Here you can find the source of base64Encode(byte[] bytes)
Parameter | Description |
---|---|
bytes | to encode |
public static String base64Encode(byte[] bytes)
//package com.java2s; //License from project: Open Source License import java.util.Base64; public class Main { /**//from ww w . j a v a 2 s . co m * Encodes the specified byte array into a String using the Base64 encoding scheme * * @param bytes to encode * @return base64 string */ public static String base64Encode(byte[] bytes) { String hashString = Base64.getEncoder().encodeToString(bytes); return hashString; } }