Why does my implementation of hex to Base58check produce different results than the example?
Each hexadecimal character has four bits of information. Two hex characters contains eight bits of information, so they form a byte.

For each byte in front of the address, a 1 should be put. Since two characters form a byte:

int i=0;
while(concat.charAt(i) == '0' &amp;&amp; concat.charAt(i + 1) == '0'){
    i += 2;
    output.append(code_string.charAt(0));
}


BTW, it would look better if it was a for loop:

for (int i = 0; concat.charAt(i++) == '0' &amp;&amp; concat.charAt(i++) == '0';) {
    output.append(code_string.charAt(0));
}


Also, probably you've made a mistake while copying the code: You haven't declared a variable named concat. It's input.

Last note: If you're going to use this encoding for things other than Bitcoin addresses (which have checksum), make sure that i will always be smaller than concat.length()