Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET Real time zip file creation

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #20068 |


    I wrote a piece of sw that is getting data from a device.
    I’m storing the data in binary files in a specific folder. Each 5MB, I create a new binary.

    For the moment, I filling this directory, and when I stop getting data, I launch zip process that takes all binary files one by one and copy them in the archive.

    My concern is it’s taking too much time (I need to zip 500-600 files of 5MB). What I do:

    foreach (AbstractFile file in sourceFolder.GetFiles(true, null))
        MainForm.SetStatusMessage(“Closing ZIP… (Archiving ” + i + ” of ” + nbOfFiles.ToString() + “)”);
        file.CopyTo(archive, true);

    where archive is a ZipArchive object.

    I would like to improve my algorithm starting the sippage while getting data:

    Each time I receive a binary, I do :

    DiskFile file = new DiskFile(pFileName);
    file.CopyTo(archive, true);

    It’s good for the first 20 binary files, but when we reach the 100th file, the copy to the archive is taking to much cpu and time.

    How can I do with Xceed component to generate this ZIP file in real time ?



    Imported from legacy forums. Posted by Ben (had 1495 views)

    User (Old forums)
    Post count: 23064

    If you do not need to manipulate the archive in between adding new files until the whole archive is constructed, then you should use Real-Time Zip for .NET.  It will zip your stream as it is coming it.


    ZipWriter( Stream outputStream )

    WriteLocalHeader, WriteData

      WeiteLocalHeader, WriteData

       …( for each file)


    You can read more in the documentation on how to use this :



    Imported from legacy forums. Posted by André (had 1293 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.