Used internally
This holds temporarily the compressed size if a stream and it's MD5 checksum.
The compressed size of a stream
The TMD5Digest of the original uncompressed stream.
Used to store the list of files to be compressed
Add a File to be compressed
Should be a fully qualified filename. Stored in the archive as just the filename without paths. To set a releative path for the file use AddPath.
The index of the filename in the list
Fully qualified FileName to be added
Adds a FileName and a relative path
Index of added file name in the list
Fully qualified filename to be compressed
Relative path to be decompressed to
Used to insert a file to be compressed into the list at a specific index
Deletes the filename at index from the list
Index of the filename to be removed
Removes all files from the list of files to be compressed
Number of files in the list to be compressed
Zero based so to do a loop using Count you must do Count-1
The number of files in the list
Used to retrieve the fully qualified filename that is to be compressed
Index of the filename you wish to retrieve the FileName from.
Used to retrieve the releative path the file should be extracted to
Index of the filename you wish to retrieve the relative path from.
Used internally to obtain the compressed size of the file
Only usefull after the file has been compressed
Index of the filename you wish to retrieve the TFileInfo from.
The information at the beggining of a TZlibArchive
Contains vital information about the archive.

Major Minor and Micro hold the version of the archive.
The file identifier
The first four bytes of the file. Z A R #0. Used to verify the type of file.
Length of the table of contents.
Used internally to be able to determine the lenght of the TOC
Checksum of the uncompressed TOC
The table of contents is stored compressed in the archive. This is used to ensure that the TOC is intact.
The structure of a table of contents entry
Used to manage various information about the size and position of a file in the TZlibArchive
The file name only
This contains no path information.
The desired relative path for the file to be extracted to.
The position of the compressed stream in the TZLibArchive stream.
The size of a compressed file
The checksum used to verify the file is the same as the original
Callback used to follow the progress of overall and current progress
Used to provide feedback to the user of the progress of compression.
TZlibWriteArchive Object
Index of the current file that is being compressed.
Total size of the InStream to be compressed
Amount of the InStream that has been compressed.
Callback for progress during decompression
TZlibReadArchive object
Total size of the InStream
Current position of the InStream
Error Callback
Used to catch error before an exception is raised.
TZlibReadArchive or TZlibWriteArchive object
Error code that has occured
Set to 0 to avoid an exception
Description of the error.
Object used to create ZibArchive files.
Creates an instance of the TZlibWriteArchive object
Compresses and write all the files in the list to OutStream
The Stream is written to starting from the beginning. The Previos contents of the stream are lost.
True if successful False otherwise
Callback used to intercept errors before an exception is raised
Callback used to imform the user of the compression progress
Stream the compressed archive it written to
If this is not assigned a TMemoryStream is automatically created and assigned to OutStream.
List of files to be compressed
Object to read and extract files made with TZLibWriteArchive
A TZlibReadArchive object is not capable of writing or changing an archive. You must use a TZLibWriteArchive object to do that.
Creates a TZlibReadArchive object and opens an archive from a TStream
Creates an instance of the object
Stream that you wish to be opened
Extract the file at Index to a user provided stream
Index of the file to be extracted
User provided stream for the compressed file to be decompressed into
Retrieves the header of the file
Contains information about the file in the archive
Index of the file you want information about
Number of files in the archive
Callback to intercept errors before they trigger an Exception
Callback used to monitor the progress of a file as it is being extracted
TStream that is currently loaded
Set to nil to close the file
Error Code
The table of contents has been corrupted. A MD5 checksum is made before the TOC is compressed. If the checksum of the extracted TOC does not match this error occurs.
Error Code
The file you are trying to open does not have the correct header, or is not a recognized file format.
Error Code
The file you are trying to compress does not match the checksum of the original file before it was compressed.
Compresses InStream into OutStream
Generic independant function to compress InStream into OutStream.
The size of the compressed stream in bytes
The TStream that you wish to be compressed
InStream is read from the begining of InStream.
The compressed stream
OutStream is written to from the current position of OutStream.Position.
Decompresses InStream to OutStream
Decompresses InStream to OutStream.
The Size of OutStream in bytes
The Stream that you wish to compress
InStream is read from position 0 to the end.
The stream that the decompressed data will be written into
OutStream is written to at the current position it happens to be in the stream.
Creates a TMD5Digest from a TMemoryStream
Use this to create a TMD5Digest from a Stream. This is used to ensure that a file matches in every way by comparing it to a previous TMD5Digest.
Returns a TMd5Digest
The stream you wish to be scanned