I have to assume that by the "byte value of a String" you mean the byte values generated by encoding a String with a given encoding.
If so, then switching from a 32 bit architecture to a 64 bit architecture will not change the result.
However, if you just use String.getBytes()
without any arguments to get the byte[]
then the return value will depend on the system default encoding. While this is unlikely to be different between the 32bit and the 64bit version of the same OS with the same settings, the system default encoding can vary based on many other parameters (such as the UI language configured in your OS), so it's always a good idea to avoid this issue by always specifying a specific encoding like this:
byte[] bytes = myString.getBytes(StandardCharsets.UTF_8);
This call will always produce the same byte[]
if called on identical myString
values, no matter what OS, architecture or locale setting you happen to be running it on.