DIZipWriter is a Delphi component to create PKZip-compatible ZIP archives. Archive output is completely stream-based and works with any TStream descendant. DIZipWriter therefore direclty writes to files (
TFileStream), memory (
TMemoryStream), or even database BLOBs (
TBlobStream). Convenience functions to work files and file based archives are available.
DIZipWriter's functionality is contained in its main class,
TDIZipWriter, with methods to create new ZIP archives and write various types of data like:
DIZipWriter allows applications to write to an archive entry as many times as they seem necessary. This allows to create the new archive entry even before the first chunk of data is available. As data flows in (for example from a slow download), they can write it in small chunks at a time.
DIZipWriter outputs all data to the archive straight away, with no need for temporary storage: It does not create any temporary files and does not use huge amount of memory for buffering. It is nevertheless possible to create an archive entirely in memory if desired.
DIZipWriter stores a global archive comment as well as individual comments for each individual entry. Long file names are supported, just as absolute and relative path names.
Full Source for D7-XE5