title: How to get number of bytes read from QTextStream
body: <p>The following code I am using to find the number of read bytes from QFile. With some files it gives the correct file size, but with some files it gives me a value that is approximatively fileCSV.size()/2. I am sending two files that have same number of characters in it, but have different file sizes <a href="http://www.qtcentre.org/attachment.php?attachmentid=4745&amp;d=1276004493" rel="nofollow noreferrer">link text</a>. Should i use some other objects for reading the QFile?</p>
  
  <pre><code>QFile fileCSV("someFile.txt");
  if ( !fileCSV.open(QIODevice::ReadOnly | QIODevice::Text))
     emit errorOccurredReadingCSV(this);
  QTextStream textStreamCSV( &amp;fileCSV );        // use a text stream
  int fileCSVSize = fileCSV.size());
  qint64 reconstructedCSVFileSize = 0;
  while ( !textStreamCSV.atEnd() )
  {
       QString line = textStreamCSV.readLine();         // line of text excluding '\n'
       if (!line.isEmpty())
       {
           reconstructedCSVFileSize += line.size(); //this doesn't work always
           reconstructedCSVFileSize += 2;
        }
      else
         reconstructedCSVFileSize += 2;
  }
  </code></pre>
  
  <p>I know that reading the size of QString is wrong, give me some other solutions if you can. </p>
  
  <p>Thank you.</p>