質問

While reading a ZIP file, can we safely assume that all file structures (by that I mean Local File Header + file data (compressed or stored) + Data Descriptor) are exactly consecutive? Can there be any irrelevant data in between?

役に立ちましたか?

解決

PkWare Appnote tells that

"Immediately following the local header for a file is the compressed or stored data for the file. The series of [local file header][file data][data descriptor] repeats for each file in the .ZIP archive."

So there should be no gaps between them.

However, I would recommend to parse and read central directory, not go through local file headers (except that you need streamed processing).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top