QDataStream have operators << and >> for for all basic data types.