I need to encode a short String as base 64 in GWT and decode the base 64 string on the server. Anyone have utility class or library for this?
+1
A:
Apache commons-codec has a Base64
class. It should work with GWT.
// client-side code
String base64String = Base64.encodeBase64(yourString.getBytes());
// server-side code
String originalString = new String(Base64.decodeBase64(base64String.getBytes()));
Bozho
2010-02-12 08:24:44