I am using the System.IO.Compression in .net 4.5 and ZipArchive and ZipFile are used to add txt files to the archive. There are around 75 files . The files when put in a folder and measured the size, it was around 15 KB
But when used to put in archive using the ZipArchive the zip file size generated was of 21KB. Am I doing something wrong or this ZipArhive is just to put the files into an archive single file rather than compressing ?
Is that Deflate alogrithm used for the .zip creation ? This is what I have done. Is there any high level compression that can be used ?for .7zip the file size is even smaller, around 1KB only
using (ZipArchive zippedFile = ZipFile.Open(zipFileName, ZipArchiveMode.Create))
{
foreach (string file in filesTobeZipped)
{
zippedFile.CreateEntryFromFile(file, Path.GetFileName(file), CompressionLevel.Optimal);
}
}