Java XML Base64 Encode Decode toBase64(byte[] array)

Here you can find the source of toBase64(byte[] array)

Description

Converts a byte array into a hexadecimal string.

License

Open Source License

Parameter

Parameter Description
array the byte array to convert

Return

a length*2 character string encoding the byte array

Declaration

private static String toBase64(byte[] array) 

Method Source Code

//package com.java2s;

import javax.xml.bind.DatatypeConverter;

public class Main {
    /**//w  w w .  j  ava2 s .  com
     * Converts a byte array into a hexadecimal string.
     *
     * @param   array       the byte array to convert
     * @return              a length*2 character string encoding the byte array
     */
    private static String toBase64(byte[] array) {
        return DatatypeConverter.printBase64Binary(array);
    }
}

Related

  1. readBase64Bytes(String str)
  2. readFileToBase64(String filePath)
  3. sha256SaltBase64(String password, String salt)
  4. toB64(byte[] bytes)
  5. toBase10(String base64)
  6. toBase64Encoded(String unencoded)
  7. toBase64String(final byte[] data)
  8. toSafePathBase64(byte[] value)
  9. urlSafeBase64Decode(String in)