views:

126

answers:

2

Okay, I know how to do it in C#.

It is simple as

Convert.ToBase64String(byte[])
and Convert.FromBase64String(string) to get byte[] back.

How can I do this in Java?

+4  A: 

If all you're looking for is base64 encoding try using commons codec.

Raymond
Thanks for the hint. I found that Restlet util package contains Base64 encode/decode methods. And that suits my needs, since I use restlets.
Sorantis
+1  A: 

May I suggest you to search the big internet ? It could lead you to Base64 public domain encoder/decoder (which (contrary to sun.misc class, works on all VMs)

Riduidel
And please, please rename that question
Riduidel