I have tried QDatastream but I am using the << and >> operator. It return me errors.

Is there any examples which I can follow to get it to work?