Skip to content

Commit

Permalink
Added section to readme demonstrating streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
abbeycode committed Jun 18, 2015
1 parent 3458e6d commit c3c8fd0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@ NSData *extractedData = [archive extractDataFromFile:@"a file in the archive.jpg
error:&error];
```

## Streaming a file

For large files, you may not want the whole contents in memory at once. You can handle it one "chunk" at a time, like so:

```Objective-C
BOOL success = [archive extractBufferedDataFromFile:@"a file in the archive.jpg"
error:&error
action:
^(NSData *dataChunk, CGFloat percentDecompressed) {
NSLog(@"Decompressed: %f%%", percentDecompressed);
// Do something with the NSData chunk
}];
```
# Installation
Expand Down

0 comments on commit c3c8fd0

Please sign in to comment.