Tien Shan wrote:
In one instance, I got these hex strings:
for b.get(0), 16), b.get(1), 16), b.get(2), 16) and b.get(3), 16) respectively.
When I read the original file using a hex editor, I see
What could be wrong?
Java bytes are signed. When they get cast to ints, they get sign extended. Your hex editor is treating the bytes as unsigned. Anyway, 0xFC as an unsigned representation, is the same as -0x04 as a signed representation, so there is nothing wrong -- except the printout.