public static final String CHAR_ENCODING = "ISO-8859-1";
public static String getBase64Decoded(String toDecode) throws UnsupportedEncodingException{
return new String(Base64.getDecoder().decode(toDecode.getBytes(CHAR_ENCODING)), Constants.CHAR_ENCODING);
}
public static String getBase64Encoded(String toEncode) throws UnsupportedEncodingException{
return new String(Base64.getEncoder().encode(toEncode.getBytes(CHAR_ENCODING)), Constants.CHAR_ENCODING);
}
No comments:
Post a Comment