anzip 1.0.5 copy "anzip: ^1.0.5" to clipboard
anzip: ^1.0.5 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.open(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();
await zipFile.close();

Or use use and file_system:

final fileSystem = LocalFileSystem();
await ZipFile.open(fileSystem.file(file)).use((zip) async {
  for (final header in zip.fileHeaders) {
    await zip.getEntrySource(header).use((entrySource) async {
      if (entrySource == null) return;
      await fileSystem
          .openSink(join(output, header.fileName), recursive: true)
          .use((sink) => sink.buffer().writeSource(entrySource));
    });
  }
});
3
likes
0
points
34
downloads

Publisher

unverified uploader

Weekly Downloads

A dart library for zip files / streams.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

anio, collection, path, pointycastle

More

Packages that depend on anzip