Can't get hex bytes from file

I am trying to make a 6502 disassembler and found out that saveBytes() and loadBytes() do not save and load hex bytes, I tried to extract a text file containing the letter “a” expecting to get “61” but got “[B@1c0f834d”, help! Code: byte b[] = loadBytes(“test.txt”);
print(b);

print(b); is giving you weird output because b is an array of bytes.

You want to show the value of a specific byte! Not the array of them!

Try print(b[0]); instead. This will give you the numerical value of the first byte in the array.

3 Likes

That ended up giving me “97” not “61”
EDIT “97” in hex is “61” so it does work, thanks!