public static String encodeBase64(String data) {
        byte[] bytes = null;
        try {
            bytes = data.getBytes("ISO-8859-1");
        } catch (UnsupportedEncodingException uee) {
            throw new IllegalStateException(uee);
        }
        return encodeBase64(bytes);
    }
public static String encodeBase64(String data) {
        byte[] bytes = null;
        try {
            bytes = data.getBytes("ISO-8859-1");
        } catch (UnsupportedEncodingException uee) {
            throw new IllegalStateException(uee);
        }
        return encodeBase64(bytes);
    }
public static String encodeBase64 ( String data ) { byte [ ] bytes = null ; try { bytes = data . getBytes ( "ISO-8859-1" ) ; } catch ( UnsupportedEncodingException uee ) { throw new IllegalStateException ( uee ) ; } return encodeBase64 ( bytes ) ; }
Encodes a String as a base64 String.

@param data
a String to encode.
@return a base64 encoded String.
Encodes a String as a base64 String .