Java Base64 Encode base64Encoder(String str)

Here you can find the source of base64Encoder(String str)

Description

base Encoder

License

Open Source License

Declaration

public static String base64Encoder(String str) 

Method Source Code

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

import java.io.UnsupportedEncodingException;

import sun.misc.BASE64Encoder;

public class Main {
    public static String base64Encoder(String str) {
        byte[] b = null;
        String s = null;//from w w w .  jav a  2s .  c o m
        try {
            b = str.getBytes("utf-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        if (b != null) {
            s = new BASE64Encoder().encode(b);
        }
        return s;
    }
}

Related

  1. base64Encode(String string)
  2. base64Encode(String string)
  3. base64encode(String text)
  4. base64EncodeGeneric(String digits, byte[] data)
  5. base64Encoder(byte[] src, int start, int wrapAt)
  6. base64encoding(byte[] bytes)
  7. base64UrlDecode(final String encodedString)
  8. base64UrlEncode(final byte[] v)
  9. encodeBASE64(InputStream in, OutputStream out)