When receiving multi chunk messages, only the first 8 are printed. Simple coding mistake. Should print dat[i] instead of dat[j]