Skip to content

A simple class for ZIP uncompress, test and get ZIP information

License

Notifications You must be signed in to change notification settings

JosePineiro/LittleUnZip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LittleUnZip. A simple class for ZIP uncompress, test and get zip information

The class is in safe managed code in one class. No need external dll. The class work in 32, 64 bit or ANY.

The code is full comented and include simple example for using the class.

Uncompress file functions:

Open an existing ZIP file for extract, test or get info.

LittleUnZip zip = new LittleUnZip("c:\\directory\\file.zip");

Extract full contents of a ZIP file into the output folder. Optionally you can put a progress bar.

using (LittleUnZip zip = new LittleUnZip("file.zip"))
    zip.Extract("c:\\directory", true);

Extract "test.txt" of a ZIP file into "C:\extract\test.txt".

using (LittleUnZip zip = new LittleUnZip("file.zip"))
    zip.ExtractFile("test.txt", "C:\\extract\\test.txt");

Extract the second file of a ZIP file into the physical file.

using (LittleUnZip zip = new LittleUnZip("file.zip"))
    zip.ExtractFile(zip.zipFileEntrys[1], "C:\\test\\" + zip.zipFileEntrys[1].filename);

Close zip file. This function is automatic call when dispose LittleUnZip

zip.Close()

Aditional stream functions:

Open an stream for extract or test files.

using (Stream zipStream = new FileStream("file.zip", FileMode.Open, FileAccess.Read))
    LittleUnZip zip = new LittleUnZip(zipStream);

Extract the second file of a ZIP file into one stream.

string outPathFilename = "C:\\test\\" + zip.zipFileEntrys[1].filename;

using (Stream output = new FileStream(outPathFilename, FileMode.Create, FileAccess.Write))
using (LittleUnZip zip = new LittleUnZip("file.zip"))
    zip.ExtractFile(zip.zipFileEntrys[1], output);

Extract the "test.txt" file of a ZIP file into one stream.

string outPathFilename = "C:\\test\\test.txt";

using (Stream output = new FileStream(outPathFilename, FileMode.Create, FileAccess.Write))
using (LittleUnZip zip = new LittleUnZip("file.zip"))
    zip.ExtractFile("test.txt", output);

Use

LittleUnZip can:

  • Decompress in little time
  • Use little code
  • Use little memmory
  • Little learning for use
  • Work without DLLs. You only need add LittleUnZip.cs to you proyect.

LittleUnZip can not:

  • Decompress a large zip ( > 2.147.483.647 bytes)
  • Decompress other metods than Storage and Deflate
  • Create ZIP file. Use LittleZip class.
  • Descompress Split Zip files.

About

A simple class for ZIP uncompress, test and get ZIP information

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages