Results 1 to 3 of 3

Thread: i write a test program whit QDatastream read and write the binary file but it's dif

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Posts
    35
    Thanks
    9
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Android

    Default i write a test program whit QDatastream read and write the binary file but it's dif

    i write a test program whit QDatastream
    read and write the binary file
    but
    it's different

    my code
    Qt Code:
    1. QFile file("1.png");
    2. file.open(QIODevice::ReadOnly);
    3. QFile tmp("2");
    4. tmp.open(QIODevice::WriteOnly);
    5. QDataStream out(&tmp);
    6. out << file.readAll();
    To copy to clipboard, switch view to plain text mode 

    diff 1.png 2
    output:
    Binary files 1.png and 2 differ
    why ?
    Last edited by Lykurg; 2nd November 2010 at 06:21. Reason: changed [qtclass] to [code]

Similar Threads

  1. QFile - QDataStream read and write each character
    By nhs_0702 in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2010, 19:03
  2. How to write a QList into a binary file?
    By Lawand in forum Qt Programming
    Replies: 23
    Last Post: 15th June 2009, 10:04
  3. file read & write help....
    By aj2903 in forum Qt Programming
    Replies: 1
    Last Post: 17th November 2008, 11:58
  4. [Java] read and write a file
    By mickey in forum General Programming
    Replies: 3
    Last Post: 22nd June 2008, 10:43
  5. How to read/write sets of orderded numbers in binary
    By kaydknight in forum General Programming
    Replies: 3
    Last Post: 12th March 2007, 05:50

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.