Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Library for decoding a zip file in chunk

Hi fellow overflowers, i need to decode a large zip file (around 20mb) on the ipad. Is there a way to parse the zip file in chunks? Ideally i would like to pass the decoder (let's say) 512k of data at time, and get back a chunk of decoded data, because i have a feeling that loading all the file in memory and then decompress it could lead to severe memory problems. A pointer to some incremental decoding libraries would be nice!

Thanks, Giuliano

UPDATE: the link provided by Matt in his answer worked fine for me ;)

like image 669
Giuliano Galea Avatar asked Nov 05 '22 21:11

Giuliano Galea


2 Answers

Have you tried objective-zip? http://code.google.com/p/objective-zip/

There's an example near the bottom of http://code.google.com/p/objective-zip/wiki/GettingStarted, showing how to read big files.

like image 192
thomson_matt Avatar answered Nov 11 '22 04:11

thomson_matt


I have achieve unzipping files using GCD. This examples uses unzipping of files in different thread and when done it notifies main thread and main thread updates the information.... Hope this may also be solution to your problem....

http://www.raywenderlich.com/4295/multithreading-and-grand-central-dispatch-on-ios-for-beginners-tutorial

like image 28
DShah Avatar answered Nov 11 '22 06:11

DShah