then, I convert it to a string like this:
Don't do that!
You have two problems here:
- this constructor will use the default encoding;
- even if you used UTF-8 as an encoding, some byte sequences just cannot
be encoded to
You should not use
String to hold binary data; or
use a string-based encoding, such as Base64.
For more information, see