// Take s Base64 encoding
Public static string getBase64 (String s) {
IF (s == null) Return NULL;
Return (New Sun.misc.Base64Encoder ()). Encode (s.getbytes ());
}
// Decod the base64 encoded string S
Public static string getFromBase64 (String s) {
IF (s == null) Return NULL;
Base64decoder decoder = new base64decoder ();
Try {
Byte [] b = decoder.decodebuffer (s);
Return New String (b);
} catch (exception e) {
Return NULL;
}
}