I don’t know if your Processing code is using the printed output from that printDec function, but it’s confused. Clearly printHex prints the numbers 0…255 as 2 digit hex values with leading zero where required. printDec is a copy of printHex with HEX changed to DEC, but without rethinking the requirement and logic for leading zeroes. The result is this:
00 01 02 03 04 05 06 07 08 09 010 011 012 013 014 015 16 17 18 19 … 99 100 101 … 255