Java Base64 Encode base64Encode(byte[] bytes)

Here you can find the source of base64Encode(byte[] bytes)

Description

Encodes the specified byte array into a String using the Base64 encoding scheme

License

Open Source License

Parameter

Parameter Description
bytes to encode

Return

base64 string

Declaration

public static String base64Encode(byte[] bytes) 

Method Source Code

//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;
    }
}

Related

  1. base64Encode(byte[] aData)
  2. base64Encode(byte[] buf)
  3. base64Encode(byte[] buf, int tw)
  4. base64Encode(byte[] bytes)
  5. base64Encode(byte[] bytes)
  6. base64encode(byte[] bytes)
  7. base64encode(byte[] data)
  8. base64Encode(byte[] data)
  9. base64Encode(byte[] data)