3 ms·
Zip files can be streamed. See for example https://developer.android.com/reference/java/util/zip/ZipInputStream.html https://developer.android.com/reference/jav
by tobias3 10y ago
Zip files can be streamed. See for example https://developer.android.com/reference/java/util/zip/ZipInputStream.html https://developer.android.com/reference/java/util/zip/ZipInp...
It even allows you to stream the zip while creating it, i.e. you do not need to know the compressed size of the files before starting to write the compressed file content.
- deleted 10y ago[deleted]
- pierrec 10y agoI wonder how their API degrades when the stream doesn't support seeking (as is often the case over HTTP, or like in gp's example of using pipes). The whole doc you linked to, and the feature of on-the-fly decompression, seems to assume that the stream is seekable.
- tobias3 10y agoInputStreams are not seekable (see https://developer.android.com/reference/java/io/InputStream.html https://developer.android.com/reference/java/io/InputStream.... ). You can also have a look at a zip file spec to see that they can be streamed: https://users.cs.jmu.edu/buchhofp/forensics/formats/pkzip.html https://users.cs.jmu.edu/buchhofp/forensics/formats/pkzip.ht...
- pierrec 10y agoOK, makes sense. The headers at the end of the file are only required if you want to extract specific files out of order. Love the clarity of that spec, btw.