Ok, I got the catch. There is a way to use the old
methods using
CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY in 5.x.
Deflate works fine. But during Inflate of the data
long uLen = unzipper.MaxRetrieveable(); returns 0. The
same code in Crypto++ 3.2 returns the actual number of
bytes. Is it a bug or I am using it wrongly ?
Thanks a ton.
Jamini
--- Jamini Samantaray <[EMAIL PROTECTED]> wrote:
> Hi
>
> Using Crypto++ 3.2 I was able to compress a string
> data. I am trying to extend the usage using the
> latest
> Crypto 5.x. The Close() method is no more available
> in
> 5.x. Is there any other equivalent way I can use the
> compression feature.
>
> Following is the way I use it using Crypto++ 3.2
>
> pchar
> UseMyImage::CompressImage(pchar UncompressedImg,
> long
> UncompLen, long *compLen)
> {
>
> Gzip zipper(MIN_COMPRESS_FASTEST);
>
> zipper.Put((unsigned char
> *)UncompressedImg,UncompLen);
> zipper.Close();
>
> long cLen = zipper.MaxRetrieveable();
>
> byte* pCompressed = new byte[cLen];
>
> zipper.Get(pCompressed,cLen);
>
> *compLen = cLen;
>
> return (char *) pCompressed;
>
> }
>
> pchar
> UseMyImage::UnCompressImage(pchar compressedImg,
> long
> compLen, long *UncompLen)
> {
>
> Gunzip unzipper;
> unzipper.Put((unsigned char
> *)compressedImg,compLen);
> unzipper.Close();
>
> long uLen = unzipper.MaxRetrieveable();
> byte* pUncompressed = new byte[(int)uLen];
>
> unzipper.Get(pUncompressed, uLen);
>
> *UncompLen = uLen;
>
> return (char *)pUncompressed;
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - File online by April 15th
> http://taxes.yahoo.com/filing.html
>
__________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
http://taxes.yahoo.com/filing.html