CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2003
    Location
    Greece
    Posts
    533

    Compress memory contents

    I've found hundreds of solutions about compressing files on disk, but in my case I want to compress/decompress data placed in memory, without any loss.

    For example, is there a way of compressing PropertyBag contents on the fly? The purpose is to transfer through winsock less bytes than the original (1MB of the data I am talking can be less than 40kb in zip).
    - Better live in the digital world -

  2. #2
    Join Date
    Nov 1999
    Location
    Copenhagen, Denmark
    Posts
    265
    Check out ZLIB. It can compress data in-memory. The homepage has DLLs you can download.
    Best regards,
    S. Bro

    "I would be happy to deal with my problems one at the time if they would only line up!"
    -Paul Cilwa, "Borland C++ Insider".

    Other useful fora some of which I ruthlessly clipboarded from other peoples footers.

    MSDN: http://search.microsoft.com/us/dev/default.asp
    WIN 32 Assembler: http://board.win32asmcommunity.net/
    RDBMS: http://www.dbforums.com
    Robert's Perl Tutorial: http://www.sthomas.net/roberts-perl-tutorial.htm
    Merriam-Webster Online: http://www.m-w.com/home.htm
    Writing Unmaintainable Code: http://mindprod.com/unmain.html

  3. #3
    Join Date
    Feb 2003
    Location
    Greece
    Posts
    533

    thanks

    Thank you, great library and it needs only the zlib.dll. The rest of the code i put it outside the sample class in a standard module and now the two stand alone functions "compressdata" and "decompressdata" are more flexible. Many thanks to the author, the compressing ratio is very high, a bitmap byte array about 3mb turned to be only 20kb.
    - Better live in the digital world -

  4. #4
    Join Date
    Aug 2002
    Location
    Brazil
    Posts
    730
    Wow.. thats a iracle...
    All consequences are eternal in some way.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured