Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.
/ SBYZipArchive Public archive

SBYZipArchive is a simple unzip library to extract files from a large archive.

License

Notifications You must be signed in to change notification settings

shoby/SBYZipArchive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SBYZipArchive

Build Status

SBYZipArchive is a simple unzip library to extract files from a large archive. You can extract contents without expanding the whole archive.

Usage

Synchronous extraction for a small file

NSURL *url = [NSURL URLWithString:@"zip_file_path"];

SBYZipArchive *archive = [[SBYZipArchive alloc] initWithContentsOfURL:url error:nil];
[archive loadEntriesWithError:nil];

SBYZipEntry *entry = archive.entries[0];

NSData *data = [entry dataWithError:nil];

Asynchronous extraction for a large file

NSURL *url = [NSURL URLWithString:@"zip_file_path"];

SBYZipArchive *archive = [[SBYZipArchive alloc] initWithContentsOfURL:url error:nil];
[archive loadEntriesWithError:nil];

SBYZipEntry *entry = archive.entries[0];

NSURL *destinationURL = [NSURL URLWithString:@"destination_directory_path"];

[entry unzipToURL:destinationURL success:^(NSURL *unzippedFileLocation) {
    NSData *data = [NSData dataWithContentsOfURL:unzippedFileLocation];
} failure:^(NSError *error) {
    NSLog(@"%@", error);
} progress:^(NSUInteger bytesUnzipped, NSUInteger totalBytes) {
    NSLog(@"progress:%f", (double)bytesUnzipped/totalBytes);
}];

License

SBYZipArchive is licensed under the MIT license. Included minizip is licensed under the zlib license.

About

SBYZipArchive is a simple unzip library to extract files from a large archive.

Resources

License

Stars

Watchers

Forks

Packages

No packages published