Sample code for 30+ languages & platforms
Java

Decode Base64

Demonstrates how to decode base64.

Chilkat Java Downloads

Java
import com.chilkatsoft.*;

public class ChilkatExample {

  static {
    try {
        System.loadLibrary("chilkat");
    } catch (UnsatisfiedLinkError e) {
      System.err.println("Native code library failed to load.\n" + e);
      System.exit(1);
    }
  }

  public static void main(String argv[])
  {
    boolean success = false;

    CkBinData bd = new CkBinData();

    //  Append a base64 string to bd.
    success = bd.AppendEncoded("c2VjcmV0","base64");

    //  The bd now contains the decoded bytes.
    //  Let's say it was a password string..
    String password = bd.getString("utf-8");

    //  Decodes to "secret".
    System.out.println("password = " + password);
  }
}