Using Base64 encoded characters as filename in Android app -


I'm trying to create file names in my Android app with a 4 byte byte array. I am encoding the base 64 to the byte array with the URL_SAFE option. However, the generated string ends with a new character, which makes it void in the file name, there is no way to remove the new line ?

My code is as follows:

  byte [] myByteArray = new byte [4]; MyByteArray = myByteArray; // Some data fills the byte array with the final string byte sting = base 64. encodeToString (myByteArray, Base64.URL_SAFE); After some googling, I found out that in Android, Base64 encoding automatically includes a new line after the string, and that it will be resolved using NO_WRAP flag though, is the NO_WRAP flag generated output filename safe? 

Thank you.

OK, it shows that I want to implement both flags (Base64.URL_SAFE | Base64 .NO_WRAP).


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -