Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在zlib库中使用deflate函数来压缩文件。如何确定压缩文件的大小?是表示压缩文件大小的元素total_out吗?
如果您使用deflate()正确,那么您正在累积或写入压缩输出,并且可以自己将输出字节数相加。在每次调用中,输出量是调用strm.avail_out之前deflate()减去调用strm.avail_out之后的量。请参阅和zpipe.c的用法示例。deflate()inflate()
deflate()
strm.avail_out
zpipe.c
inflate()
如果您知道strm.total_out压缩输出的总大小适合.unsigned long
strm.total_out
unsigned long