There are many ways to do this, in general you could get a ByteOutputStream, wrap it in an ObjectOutputStream, send the String to the OOS, read the bytes from the BOS then convert to a String representation (eg Base64 encode), but this doesn't give the output you specified. (I got 'rO0ABXQAA3Zhcw==')
Implementation is left to the user
