Questions tagged [sharpziplib]

#ziplib (SharpZipLib) is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform.

The #ziplib (SharpZipLib) is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform. It is implemented as an assembly (installable in the GAC), and thus can easily be incorporated into other projects (in any .NET language). The creator of #ziplib put it this way: "I've ported the zip library over to C# because I needed gzip/zip compression and I didn't want to use libzip.dll or something like this. I want all in pure C#."

Reference: http://www.icsharpcode.net/opensource/sharpziplib/

Installation

SharpZipLib can most easily be installed through its NuGet package.

Install-Package SharpZipLib
272 questions
0
votes
1 answer

Creating a zip archive from memory stream in .Net Core

I'm trying to create a zip archive from memory stream and when I download it from my API on the web-side it tells me the archive is corrupt when I try to open it (and not much else, the download itself is successful). This is the code I use for…
WageSlave
  • 1
  • 2
0
votes
0 answers

How to limit the size of generated ZIPs?

I'm using : ICSharpCode.SharpZipLib.Zip.FastZip z = new ICSharpCode.SharpZipLib.Zip.FastZip(); So i'm generating a zip regarding a folder. This folder contains several files. z.CreateEmptyDirectories = true; z.CreateZip("Temp.zip", directory, true,…
0
votes
1 answer

When should I call Finish on the ZipOutputStream (SharpZipLib)

SharpZipLib is a .Net implementation for Java library for working with archives. It provides ZipOutputStream class, which derives from DeflaterOutputStream and has Finish() method. In the docs here it is stated that the Finish() method "will write…
Eleonora
  • 3
  • 2
0
votes
1 answer

How to read data from inner archives without extracting zip file?

I have a zip file which contains inner zip file (Ex:ZipFile1.zip->ZipFile2.zip->file.txt). I want to read the data of inner archive file content (file.txt) using ICSharpCode.SharpZipLib library without extracting to disk. Is it possible? If it is…
MOHANRAJ G
  • 75
  • 9
0
votes
2 answers

How to fix System.UnauthorizedAccessException when decompressing bz2 file?

Im trying to decompress a bz2 file via code using the ICSharpCode.SharpZipLib. It seems no matter where I make my file, even though I have FULL ACCESS control over it, I keep getting this Exception. Any help greatly appreciated. using System; using…
tap
  • 553
  • 2
  • 8
  • 16
0
votes
1 answer

SharpZipLib Deflater creates bad data

Original compressed data can be correctly inflated back. However, if I inflate data, deflate, and again inflate, resulting data are incorrect (e.g. simple data extraction, its modification and again compression - only now when testing no…
mnn
  • 1,952
  • 4
  • 28
  • 51
0
votes
2 answers

Decompressing zlib compressed data using SharpZipLib

I am looking at the following line of c++ code, where "zlib.h" is included int err = compress2(compressed.get(), &dest_len, reinterpret_cast(plain_text.c_str()), …
pjmaracs
  • 118
  • 8
0
votes
1 answer

C# Unzip a textfile (.GetInputStream()) from an archive to string using SharpZipLib

How do you unzip a textfile from a zip archive to string? Does the textfile also need MemoryStream or StreamReader like the image binary? Specifically: foreach (ZipEntry e in zipFile) { if (e.IsFile) { …
ina
  • 19,167
  • 39
  • 122
  • 201
0
votes
0 answers

SharpZipLib issues with WinZip version file

Hi i'm triying to uncompress a zip file with the library SharpZipLib v1.2.0 but i can't make it works. The file that i try to uncompress was made with WinZip 9.0 and have password protection I use this code for try to uncompress file but the throw…
Alejandro Mora
  • 157
  • 3
  • 16
0
votes
0 answers

SharpZipLib compression level between creating or updating a zip file

I've got a couple of questions regarding the use of ShareZipLib. I'm using 2 different methods to create a zip file and updating one which seems like overkill. Is there a better way? Create Zip File: using (var zipFile = File.Open(zipFilename,…
Thierry
  • 6,142
  • 13
  • 66
  • 117
0
votes
1 answer

Decompress stream from HttpClient using SharpZipLib in Xamarin.Forms

I am trying decompress stream from HttpClient using SharpZipLib in Xamarin.Forms. This code perfectly works on iOS, but on Android CanDecompressEntry() always returns false. What i'm missing? Maybe Android need some permissions? …
0
votes
1 answer

How to compress file data with ICSharpCode.SharpZipLib and upload using HttpClient?

I'm using ICSharpCode.SharpZipLib and doing the following: reading a file content, compressing (zlib) and then uploading to a server using HttpClient.PostAsync My regular approach (as works for corresponding download) would be to create a compressed…
balazska
  • 963
  • 6
  • 25
0
votes
1 answer

.Net : Unzipping Gz file : Insufficient memory to continue the execution of the program

So I have been using the method below to unzip .gz files and its been working really well. It uses SharpZip. Now I am using larger files and it seems to be trying to unzip everything in memory giving me : Insufficient memory to continue the…
Burf2000
  • 5,001
  • 14
  • 58
  • 117
0
votes
1 answer

sharpziplib FastZip extract rar error cannot find central directory c#

i want to extract RAR file using FastZip, here is my code : FastZip fastZip = new FastZip(); fastZip.CreateEmptyDirectories = true; if (password != "") { fastZip.Password =…
Fath Bakri
  • 161
  • 1
  • 12
0
votes
0 answers

How write memorystream into ZipFile

I have a zip file. I want open it with SharpZipLib and add a new ZipEntry to it that it is created in memory. I am new to SharpZipLib. I googled very much but couldn't find similar problem. My Sample Code is: public Stream GetNewZipFileStream(string…