http://commons.apache.org/proper/commons-codec/download_codec.cgi
import org.apache.commons.codec.binary.Base64;
public class Base64Codec {
public static String encodeBase64Chunked(String str) {
byte[] bytes = Base64.encodeBase64Chunked(str.getBytes());
return new String(bytes);
}
public static String encodeBase64(String str) {
return Base64.encodeBase64String(str.getBytes());
}
public static String decodeBase64(String base64String) {
byte[] bytes = Base64.decodeBase64(base64String);
return new String(bytes);
}
}