At hand ProgramTo extract svgz to SVG.
Previously, I used WinRAR for manual decompression, So I thought svgz was in the ZIP format (because it is basically the same as the zip compression ratio). Now I know that it is in the gzip compression format.
Before solving this problem, I had to look for vclzip, ziptv, 7zip, and other related components. I did not expect it to be so easy:
The tcompressionstream and tdecompressionstream classes in the idzlib unit can be used,
This unit also provides easy-to-use compressstream (), compressstring (), decompressstream (), and other functions.
During compression, you can select the compression type (zlib, Gzip, etc.) and compression ratio, which are easy to use.
You can also use the tidcompressorzlib class in the idcompressorzlib unit.
According to its usage (such as web page compression), Gzip should be a very suitable format for text compression. Different from the tools provided by zlib, Gzip is: gzip can be decompressed by common compression tools.
With this, I may not consider using other compression tools in the program in the future.