tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Tools and Libs > Ostermiller Utilities > Base64 Encode String

Base64 Encode String 

Ostermiller Java Utilities contain various components such as CSV parsing, Base64 Encoding, MD5 digest, String and Exec Helper classes. This requires the library ostermillerutils-1.08.01.jar to be in classpath. The following example shows encoding a String in Base64 format.

File Name  :  
Author  :  Sudhakar KV
Email  :  [email protected]
package com.bethecoder.tutorials.ostermillerutils;

import com.Ostermiller.util.Base64;

public class Base64EncodeStringTest {

   @param args
  public static void main(String[] args) {

    String strToEncode = "BE THE CODER";
    String encodedStr = Base64.encode(strToEncode);
    strToEncode = "";
    encodedStr = Base64.encode(strToEncode);


It gives the following output,


bl  br