Read-only archive of the All About Symbian forum (2001–2013) · About this archive

gzip decompression in series 60?

0 replies · 2,131 views · Started 05 February 2003

Hi,
I need some help with decompressing gzip-files with the series 60 API.
I'm using the EZDecompressor.h in EZlib which seems to be able to do it. It
is however completely undocumented and I can't get it to work. The thing I
want to do is to read from a file and put the decompressed data into a
buffer, something like this:

In the first function I open the file and create the decompressor, already
here something goes wrong I think, the compressor doesn't set it's
dictionary variable and I'm not sure about how to set it.
{
RFile file;
User::LeaveIfError(file.Open(session, fileName, EFileRead |
EFileShareReadersOnly));
CEZFileBufferManager* pFileBuffer = CEZFileBufferManager::NewL(file, file);
CEZDecompressor *pCompressor = CEZDecompressor::NewLC(*pFileBuffer);
...
}

The second function will be called multiple times for the same file and
should read chunks of the file every time.It ceates the destination buffer,
specifies the output for the decompressor and inflates.
{
...
TPtr8 localBuffer((TUint8*)pBuffer, *pSize);
pCompressor ->SetOutput(localBuffer);
pCompressor ->InflateL();
...
}

The code compiles all-right but it gets stuck in the
pCompressor ->InflateL() call. Using a trap around the call hasn't given me
anything either.
Does anyone know anytihng about this? Is there any example code or source
code for the ezlib available?
I appreciate any help.
Thanks
/ola