×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    11

    How to use CEZCompressor (how to flush output data to output buffer) ?

    Hi,

    I am trying to use the CEZCompressor-class defines in EZCompressor.h to compress a descriptor. I do something like this:

    // "this" is implementing MEZBufferManager,
    // but the implementation I have left the methods "empty"
    iCompressor=CEZCompressor::NewL(*this);
    // InitializeL() of MEZBufferManager gets called by the above call

    iCompressed=HBufC8::NewL(20000); // allocating space for output
    TPtr8 ptrCompressed=iCompressed->Des();
    iCompressor->SetOutput(ptrCompressed);
    iCompressor->SetInput(*data); // data is HBufC8 with input data
    // the input data in my tests is NOT longer than the output buffer

    TBool def=iCompressor->DeflateL();
    // NeedsInputL() of MEZBufferManager gets called in the above call
    // Return value (def) is ETrue and by inspection the all
    // avail input has been consumed, but there is only 2 bytes in
    // total output (this might be the 2 bytes zlib header, I guess...)

    // iCompressor->OutputDescriptor().Length() is also just 2

    What am I doing wrong? Or what do I have to do, to get the full output flushed to the output buffer? I have tried additional calls to DeflateL() without any further result. Also, what does the return-value of DeflateL() mean?

    Hope someone can give me some hints ;o)

    Best regards,
    Leslie

  2. #2
    Registered User
    Join Date
    Dec 2004
    Location
    India,Kochi
    Posts
    14

    ezcompressor

    hi
    which are the libraries to be linked for ezcompressor to work properly?is there any documentation related to ezcompressor .h or any links available


    thanks in advance
    vijayasree

  3. #3
    Registered User
    Join Date
    Feb 2006
    Posts
    35

    Re: How to use CEZCompressor (how to flush output data to output buffer) ?

    Hi
    You use::

    http://www.symbian.com/developer/tec...2C2/index.html




    ////////////////////////////////////////////
    D:\SYMBIAN\7.0S\NOKIA_7710_SDK\SERIES90EX\DIALOG\SRC\Dialogappui.cpp(231) :

    error C2665: 'NewLC' : none of the 2 overloads can convert parameter 1 from type 'class CDialogAppUi'

    Dialogappui.obj - 1 error(s), 0 warning(s)

    /////////////////////////////////////////
    error is in this

    void CDialogAppUi:isplayEditorDialogL()
    {


    CEZCompressor* iCompressor=CEZCompressor::NewLC(*this);





    }

    Thanks in advance..
    Last edited by pinki121; 2007-06-25 at 05:09.

  4. #4
    Registered User
    Join Date
    May 2004
    Posts
    6

    Re: How to use CEZCompressor (how to flush output data to output buffer) ?

    Does the class CDialogAppUi inherit from MEZBufferManager?

    If it doesn't, the compiler won't be able to cast *this to the MEZBufferManager& required by CEZCompressor::NewLC.

    You need to implement these four methods:

    virtual void InitializeL(CEZZStream &aZStream);
    virtual void NeedInputL(CEZZStream &aZStream);
    virtual void NeedOutputL(CEZZStream &aZStream);
    virtual void FinalizeL(CEZZStream &aZStream);

    Alternatively, instantiate one of the supplied implementations of MEZBufferManager such as CEZFileToGzipBM.

    Michael

  5. #5
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    51

    Re: How to use CEZCompressor (how to flush output data to output buffer) ?

    How exactly do the BufferManagers work? What are the four API's supposed to do, and when are you supposed to call them?

    I don't understand how the parameters are supposed to be generated as CEZZStream doesn't seem to have any kind of constructor.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×