Number to byte array algorithm
If I have got a number, how can I convert it into a byte array? (The first byte represents the number from 1 to 127 (or 255) and so on)R. Hollenstein
Hi Robin,If you mean to convert an integer to base 256 then String.toHexString(i) will help. Otherwise repeatedly divide by 128 (or 256 or whatever) andadd the remainder to your array.Cheers,Peter