hmm, I found the mistakes, the datatype of numChars and ndx were wrong, now i changed them both to 'long', but now I still have problems that it seems the output is not completely correct.
on my emulator:
and the arduino output:
This just in ... asidhasoihduiashduiqgerugiqugsduivfusdbdfiuaewghuiqewgr2gwrgbsuiewfg7uigtrbkjbdswfviwuef
wdefkjhwuieftrgh89243tkjbdfkjdbwfukjgewfuiw3tgr243fkjewvbfkewfvbg
fuiwegfr98w4y5rbkjfkjvbewfkjvewfrugewrwhewv
ewfbkjewfuivbgewfuigewf78uiewtgfwefbewf
ewfouigewf8uiwefwf bkjbewfouiwegrf2ibfewewfnkjbwff8uibfkjfkjfvb
rewfnjbrewfoiwfh8wfnbewf bbfb
ewfnikoewnbhfoewfnbjbfkfb
oidsnfndfslkfhowfhe
as you can see the data is not completely the same...