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