now I use java gzip to compress a file. and I want to use gunzip of Crptlib to  decompress it. but when I use like below ,there are some errors in funcion processheader(), DecodeHeader();,etc. But I use winrar tool to decompress it correctly . the file is binary file. thanks
    decText contains the file (to be decompressed)'s all bytes. I use   CFile's Read method to read.
   
    1 CFile myfile("F:\\aa.000.zip", CFile::modeRead);
    2  int length = myfile.getLength();
    3   byte * decText = new byte[length]; 
    4     myfile.Read(decText,length);
 
    5     Gunzip unzipper;
     6    unzipper.Put((const unsigned char*)decText,length);
     7     unzipper.Close();
     8     long uLen1 = unzipper.MaxRetrieveable();
     9     byte* pUncompressed1 = new byte[(int)uLen1];
     10    unzipper.Get(pUncompressed1, uLen1);
 
 
when run the line 6. there will be errors . kenerl.dll etc. I want to know that is why . thanks how to use it correctly ? but when I use gzip to compress a string ,then use gunzip to decompress it . It is ok .when use it to a file. it is wrong . I am looking forward to your reply. thanks .
 
 
 
 
 
 



Do You Yahoo!?
150万曲MP3疯狂搜,带您闯入音乐殿堂
美女明星应有尽有,搜遍美图、艳图和酷图
1G就是1000兆,雅虎电邮自助扩容!

Reply via email to