Example usage for org.apache.commons.codec.net BCodec encode

List of usage examples for org.apache.commons.codec.net BCodec encode

Introduction

In this page you can find the example usage for org.apache.commons.codec.net BCodec encode.

Prototype

public String encode(final String value, final String charset) throws EncoderException 

Source Link

Document

Encodes a string into its Base64 form using the specified charset.

Usage

From source file:nor.util.Codec.java

public static String base64Encode(final String str, final String enc) {

    String ret = str;/*from www  .j a v a  2 s. co  m*/
    try {

        ret = BCodec.encode(str, enc);

    } catch (EncoderException e) {

        LOGGER.severe(e.getLocalizedMessage());

    }

    return ret;

}