×

Discussion Board

Results 1 to 2 of 2

Hybrid View

  1. #1
    Registered User
    Join Date
    Nov 2010
    Location
    Finland
    Posts
    91

    How to read large file's data?

    I need to read large file's data, but I'm getting memory problems with file.readAll().

    How should I chunk it, and get the data?

    Code:
    QFile file(path);
    while (!file.atEnd()) {
                data += file.readLine().data();
            }
    I tried that, but it didn't give correct result.
    Last edited by jkosonen; 2012-09-05 at 19:55.

  2. #2
    Registered User
    Join Date
    Jul 2008
    Posts
    90

    Re: How to read large file's data?

    readLine() function is for reading files that are made of lines ending with a newline, so it is not for generic use. Use QFile::read() instead.

Similar Threads

  1. How to accommodate large large text data in CAknListQueryDialog?
    By slinx in forum Symbian User Interface
    Replies: 1
    Last Post: 2012-01-25, 05:18
  2. How to get .wav file's streaming data in buffer from server?
    By SymbianTH in forum Streaming and Video
    Replies: 1
    Last Post: 2009-06-17, 11:32
  3. How to get .wmv file's streaming data in buffer from server?
    By SymbianTH in forum Streaming and Video
    Replies: 0
    Last Post: 2009-06-16, 13:00
  4. Send large data to server without split data packet
    By abdun in forum Mobile Java General
    Replies: 0
    Last Post: 2007-08-25, 19:17
  5. Cannot Read Large SIP Packet
    By lohkj in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2005-01-31, 08:55

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×