// Using the Transporter for
// serialiazation, compression and base64u armouring.
// source code available at http://mindprod.com/products.html#TRANSPORTER
import com.mindprod.transporter.Wrap;
import com.mindprod.transporter.UnWrap;

Wrap w = new Wrap();
Anything originalMmessage = new Anything();

// you can send any Serializable object, including Strings and raw byte arrays.
String transport = w.wrap( originalMessage );

// transport String is sent to another machine... and then

Unwrap u = new Unwrap();
Anything reconstitutedMessage = (Anything)u.unwrap( transport );