Function streamSync