1

Convert byte array to string with equivalent number of bytes

view story
linux-howto

http://stackoverflow.com – Is it possible to convert a byte array to a string but where the length of the string is exactly the same length as the number of bytes in the array? If I use the following: byte[] data; // Fill it with data data.toString(); The length of the string is different than the length of the array. I believe that this is because Java and/or Android takes some kind of default encoding into account. The values in the array can be negative as well. Theoretically it should be possible to convert any byte to some character. I guess I need to figure out how to specify an encoding that generates a fixed (HowTos)