In my code I am preparing some data for sending over a network using QDataStream
. In the middle of the preparations I would like to know exactly how many bytes that were prepared at that point. How can I do that?
Example:
int myFunc(QDataStream &ds){
ds << "hello"
ds << 123;
ds << 456.7f;
//...
//How can I do this:
return ds.numberOfBytesPipedIntoThisQDataStreamAtThisTime();
}
This could work (although it looks not very elegant).