Posted by tech on November 11, 2009 |
|
The code uses non standard classes found in the sun.misc package to convert to and from Base64. These classes may change in the future. Taken from Example Depot.
1
2
3
4
5
6
| // Convert a byte array to base64 string
byte[] buf = new byte[]{0x12, 0x23};
String s = new sun.misc.BASE64Encoder().encode(buf);
// Convert base64 string to a byte array
buf = new sun.misc.BASE64Decoder().decodeBuffer(s); |
Found this post useful? Buy me a cup of coffee or subscribe to my RSS feeds and Google Friend Connect
