zip compress/decompress question...
| Wed, 2006-01-04 16:27 | |
|
Hello,
I want to compress and decompress a string buffer. I've used the following code to do that: in my header file I have: #include <EZBufman.h> ...... and I derive my class from MEZBufferManager ........... private: void InitializeL(CEZZStream &aZStream); void NeedInputL(CEZZStream &aZStream); void NeedOutputL(CEZZStream &aZStream); void FinalizeL(CEZZStream &aZStream); ............ In my cpp file I have: #include <ezcompressor.h> #include <ezdecompressor.h> ..................... TBuf8<256> buffer=_L8("This is a test to see if the zip compression/decompression is working!"); TO COMPRESS ...................................... TBuf8<256> outBuffer; TBuf8<256> inBuffer; inBuffer.Copy(buffer); CEZCompressor* iCompressor=CEZCompressor::NewL(*this,CEZCompressor::EBestCompression,CEZCompressor::EMaxWBits,CEZCompressor::EDefMemLevel,CEZCompressor::EHuffmanOnly); CleanupStack::PushL(iCompressor); iCompressor->CompressL(outBuffer,inBuffer); CleanupStack::PopAndDestroy(); ....................................... TO DECOMPRESS ................................... TBuf8<256> inBuffer; inBuffer.Copy(buffer); TBuf8<256> outBuffer; CEZDecompressor* iDecompressor=CEZDecompressor::NewL(*this); CleanupStack::PushL(iDecompressor); iDecompressor->DecompressL(outBuffer,inBuffer); CleanupStack::PopAndDestroy(); My problem is that the compressed string has almost the same size as the uncompressed string. What's wrong with my code ? Thanks! |
|






Forum posts: 44
Forum posts: 78
I wanted to know that when we compress the input files and when we create the output file do we get the .Zip file as out put.? And if its the zip file can we open it WINZIP for the windows.
Regards
Girish