I'm trying to use a basic64 encoding in my Java program.
The problem is that when I use
new sun.misc.BASE64Encoder().encode("my string".getBytes())
I receive the base 64 string with \n and \r. I don't know how avoid this because when I write that string in a text File I get the following
xxxxxxxxxxxxxxxx
yyyy
where the next line is produced by \n and \r.
I tried using a replace("\n","\n") and the same for \r but I want to know if there is a better solution or an extra parameter that I could use in Base64 encoding (or even other tipe of encoding.)
I changed the library and it is working!
here is the difference
Apache Q0FTSCNTVUJJUiMzNWYwMjFiMC1kZWRjLTRmZjgtYjNjMS0wZDY0NmVkMjFmOGUjMjAzMzU1MzczMzY=
Sun FWmsMAID7Ecbf8gUd0WIvKBjJNXhtMCbcKVDW0R4KXY/e1Do8lItqDN4NH/RiBdckoIMeFrncJ5X Fju7R0cX822I/lFSkLab
Weird... I thought that Base64 was a standard...