I see no reason why it wouldn't but if you are worried read it and then write it immediately to convince yourself.
There is nothing special about doc/pdf, it's just another binary file format (well 2) and fstream can read binary data when set-up correctly (which you seem to have done).
Banfa,
Thanks for ur time nd suggestions.
k the problem of writing a doc\pdf is not exactly after reading. Immediately, after reading if I try to write into a file, its working file. But I need to store the data into SQL 2005 DB. If I try to retreive the content from DB its failing to write it back.
What exactly happening is when I read a doc file(Ex 160kb file) , the content in the char pointer will be "ÐÏࡱá" (instead of "ÐÏࡱá > þÿ.....") and it will be stored in DB as it is and when I retreive it back it says the size is 8 and copiesthe same in file.
So, I immediately after reading the doc, I wrote the content the content to a text file. Then I edited the text file (I deleted the white spaces after the 8th digit and till the symbol '>' but still there were lot of spaces in the file) To my surprise when I read back from DB the content was 160kb(that means the file is storing the complete info). But anyway the file was corrupted since we had manually modified the header content.
1. Is there any attribute I am missing bcoz of which I am failing to read the header completely?
2. Do I need to use anything more like serialization?
In DB(MS-SQL 2005) the column which I are using is of Data_Type 'text' (which has the capacity to hold upto 2GB)