If you write the data using QDataStream, then you should read it also using QDataStream, but I'm not sure about that block size. I think it would be easier to send the number of items in the array, not the size. And don't forget that the data might be split into several packets.