anzip 2.0.7 copy "anzip: ^2.0.7" to clipboard
anzip: ^2.0.7 copied to clipboard

A dart library for zip files / streams.

A dart library for zip files / streams.

Features #

Currently only the decompression function is supported.

  • Support for both AES and zip standard encryption methods
  • Support for Zip64 format
  • Store (No Compression) and Deflate compression method
  • Extract files from split zip files (Ex: z01, z02,...zip)

Usage #

// Open a zip file and paras header.
final zipFile = await ZipFile.file(File('path'));

// Gat all file headers.
final headers = zipFile.fileHeaders;

// Get a zip entry source.
final entrySource = await zipFile.getEntrySource(headers.first);

// Zip entry source can be read into memory or saved to a file.
...

// Close resource
await entrySource?.close();

Or use use and file_system:

final fileSystem = LocalFileSystem();
final zipFile = await ZipFile.file(fileSystem.file(path));
await zipFile.openRead().use((handle) async {
    for (final header in zipFile.fileHeaders) {
        await zipFile.getZipEntrySource(handle, header).use((source) =>
            fileSystem
                .openSink(join(output, header.fileName), recursive: true)
                .buffered()
                .use((sink) => sink.writeFromSource(source)));
    }
});

References #

3
likes
130
points
60
downloads

Publisher

unverified uploader

Weekly Downloads

A dart library for zip files / streams.

Repository (GitHub)

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

anio, collection, convert, file_system, meta, path, pointycastle

More

Packages that depend on anzip