Java XML Base64 Encode Decode getBase64(byte[] bytes)

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

Description

get Base

License

Open Source License

Declaration

public static String getBase64(byte[] bytes) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.xml.bind.DatatypeConverter;

public class Main {
    public static String getBase64(byte[] bytes) {
        String h = DatatypeConverter.printBase64Binary(bytes);
        h = h.replaceFirst("=*$", "");
        h = h.replace('+', '-');
        h = h.replace('/', '_');
        return h;
    }/*w w  w .j  a  v a  2 s.  c  o  m*/
}

Related

  1. encodeBase64(String input)
  2. encodeBase64(String stringValue)
  3. encodeBase64Binary(byte[] data)
  4. fromBase64(String base64)
  5. fromBase64(String hex)
  6. getHashBase64(String origStr, String digestAlgorithm)
  7. readBase64Bytes(String str)
  8. readFileToBase64(String filePath)
  9. sha256SaltBase64(String password, String salt)