SharpZipLib | BZip2 library written entirely in C # for the .NET platform | Compression library

 by   icsharpcode C# Version: v1.4.2 License: MIT

kandi X-RAY | SharpZipLib Summary

kandi X-RAY | SharpZipLib Summary

SharpZipLib is a C# library typically used in Utilities, Compression applications. SharpZipLib has no bugs, it has a Permissive License and it has medium support. However SharpZipLib has 1 vulnerabilities. You can download it from GitHub.

SharpZipLib (#ziplib, formerly NZipLib) is a compression library that supports Zip files using both stored and deflate compression methods, PKZIP 2.0 style and AES encryption, tar with GNU long filename extensions, GZip, zlib and raw deflate, as well as BZip2. Zip64 is supported while Deflate64 is not yet supported. 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 SharpZipLib 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#.". SharpZipLib was originally ported from the GNU Classpath java.util.zip library for use with SharpDevelop, which needed gzip/zip compression. bzip2 compression and tar archiving were added later due to popular demand. The SharpZipLib homepage has precompiled libraries available for download, API documentation, release history, samples and more.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              SharpZipLib has a medium active ecosystem.
              It has 3380 star(s) with 945 fork(s). There are 191 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 62 open issues and 351 have been closed. On average issues are closed in 177 days. There are 20 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of SharpZipLib is v1.4.2

            kandi-Quality Quality

              SharpZipLib has 0 bugs and 0 code smells.

            kandi-Security Security

              SharpZipLib has 1 vulnerability issues reported (0 critical, 0 high, 1 medium, 0 low).
              SharpZipLib code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              SharpZipLib is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              SharpZipLib releases are available to install and integrate.
              SharpZipLib saves you 17437 person hours of effort in developing the same functionality from scratch.
              It has 34579 lines of code, 0 functions and 160 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of SharpZipLib
            Get all kandi verified functions for this library.

            SharpZipLib Key Features

            No Key Features are available at this moment for SharpZipLib.

            SharpZipLib Examples and Code Snippets

            No Code Snippets are available at this moment for SharpZipLib.

            Community Discussions

            QUESTION

            Cannot extract the contents of a TGZ file using F# and SharpZipLib
            Asked 2022-Feb-22 at 01:50

            I am learning F# and Deedle. I am trying to extract the contents of this TGZ File using SharpZipLib. I downloaded the TGZ to my local drive. I think I am close because out1 works, but out2 errs. I am sure the code could be written better with pipe forwarding or composition, but it first needs to work. Does anyone have any ideas?

            ...

            ANSWER

            Answered 2022-Feb-22 at 01:44

            Does this help?

            https://stackoverflow.com/a/52200001/1594263

            Looks like you should be using CreateInputTarArchive(). I modified your example to use CreateInputTarArchive(), and it worked for me.

            BTW you're just assigning a function to out1, you're not actually calling ListContents().

            Source https://stackoverflow.com/questions/71214631

            QUESTION

            How to make nuget package:moderenwpfui generate only needed language files.(WPF project)
            Asked 2022-Feb-09 at 09:30

            How to make nuget package:moderenwpfui generate only needed language files.
            The repository for this nuget package is https://github.com/Kinnara/ModernWpf .
            When I generate my app, a lot of language files will be generated. Is there a way to generate only the language I need or preset the language file to the language I use?
            The following are all the files generated in the Debug directory, the one without the suffix is the folder, the folder contains the dll library for the language files

            ...

            ANSWER

            Answered 2022-Feb-09 at 09:30

            Under Project>References you will find ModernWpf and ModernWpf.Controls. You need to set the property Copy Local to False for both of them.

            Before you do that, backup these files and copy them manually to debug folder after doing the above steps.

            Source https://stackoverflow.com/questions/71030143

            QUESTION

            Read .tar entries in a specific order (C#, SharpLibZip)
            Asked 2022-Feb-02 at 18:33
            Background

            In this website I found several examples for reading a .tar achieve using SharpLibZip.

            Question

            In my case however I'd like to make sure that entries are read in a specific order based on their names. Is there an easy way to do so?

            More details

            My .tar archive contains monthly data with per-day files (file-01, file-02, ..., file-31). However, the data provider doesn't seem to pay attention while creating the .tar file and the entries seem to arrive in a random order.

            ...

            ANSWER

            Answered 2022-Feb-02 at 18:33

            You would need to write your own tar decoder. It is up to you to say if you would consider this to be "easy" or not. The tar format is pretty simple.

            You would need to first scan through the tar file to find all the headers, saving the file name and the offset and length of the file data for each. Then you could seek back and forth to the offset of any file to read its contents.

            This would be much more difficult if the tar file were compressed, e.g. if it were a .tar.gz file, as opposed to a .tar file.

            The tar format is documented here.

            Update:

            In a comment, the OP revealed that it is actually a .tar.bz2 file. As noted, that requires additional work to be able to randomly access entries. In addition to building an index to the tar contents, the entire .bz2 file needs to be read to build an index to the compression entry points, which do not correspond to where files start in the tar archive. Then to access a file you first would go to the closest bzip2 entry point that precedes the start of that file data, and decompress from there until you arrive at and then read out that data.

            It would be easier to simply rearchive and recompress the files into the zip format, which is designed to randomly access and extract individual entries.

            Source https://stackoverflow.com/questions/70949353

            QUESTION

            Value cannot be null when sending UWP to the Store
            Asked 2021-Jul-14 at 09:52

            I'm writing there because I'm actually experiencing an issue in which I'm not sure what is the cause.

            It is impossible to send a package to the Microsoft Store, it is automatically refused (Can't even send it to certification process).

            When I'm sending the application's package onto the Microsoft Store, after the validation process, the popup is closed an I get an error message saying :

            Value cannot be null , parameter : source

            The package compiles fine and I get no errors. (For more clarifications, it's a Desktop Bridge UWP because it uses runFullTrust, but it always worked before).

            Due to huge problem of compilation with a library called DotNetZip (The package won't compile on release mode), I switched to another library called SharpZipLib, which is now working really nice and I don't get any issue when compiling (getting a good msixupload that can be opened).

            So, I'm wondering if the issue is related with the Microsoft Store servers or with the app itself.

            Thank you in advance, and don't hesitate to ask if anything is needed to be added to this question.

            ...

            ANSWER

            Answered 2021-Jul-14 at 09:52

            In case someone encounters the same issue, here is a short answer on how to fix the issue.

            • Right click on the Desktop Bridge Package
            • Select Manage NuGet packages
            • Uninstall the package SDK.Buildtools

            You should now be able to compile the package and publish it on the store.

            Source https://stackoverflow.com/questions/68323759

            QUESTION

            When should I call Finish on the ZipOutputStream (SharpZipLib)
            Asked 2021-Jun-24 at 14:06

            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 the central directory at the end of the zip file and flush the stream" and that it "is automatically called when the stream is closed". So I wonder if I should call Finish() method at all if I call Close() anyway.

            UPDATE: the question should have been stated another way: why should I use Finish() method if I can call Dispose() or Close() that will do the job (including calling Finish() method)?

            ...

            ANSWER

            Answered 2021-Jun-24 at 13:35

            From the documentation of ZipOutputStream - Finish():

            This is automatically called when the stream is closed.

            As for the closing, the ZipOutputStream needs to be properly disposed. There is no need to call for Close method.

            Source https://stackoverflow.com/questions/68116606

            QUESTION

            Will the GZip type compression ratio change when using different libraries like Zlib in NodeJS and SharpZipLib in .Net?
            Asked 2021-May-25 at 17:01

            Background: I am testing compression ratio for our device. From device the data is sent as Json payloads. It's a JArray format. I will get the size of this data in Bytes. It goes to converter. In converter this data is been compressed using Zlib library implemented in NodeJS. I don't have access to this code. And I don't know NodeJS. I know only C#.

            Is that okay to do compression using SharpZipLib or any other GZip compression library in .Net to replicate the job of the converter. How much accurate it will be? Will the compression vary largely because of using different libraries?

            ...

            ANSWER

            Answered 2021-May-25 at 09:38

            The compression ratio will be mostly depending on the compression algorithm and what compression settings are used. Deflate is one of the most common. I would not expect any significant difference in size.

            But even if the same algorithm is used there might be different headers used by different libraries. If you want backward compatibility you need to have a library that is compatible. See also zip vs gzip vs zlib.

            The best way to check if there is any size difference or backward compatibility issues is to test it.

            Source https://stackoverflow.com/questions/67684973

            QUESTION

            Why am I getting GZip compression size of a string more than the original size after compression when using SharpZipLib in C#
            Asked 2021-May-25 at 15:47

            My string is a Json file (test.json) with the below content

            ...

            ANSWER

            Answered 2021-May-25 at 15:47

            Your benchmark has some fairly fundamental problems:

            1. You're using UTF-16 to encode the input string to bytes when calculating its length (UTF8Encoding.Unicode is just an unclear way of writing Encoding.Unicode, which is UTF-16). That encodes to 2 bytes per character, but most of those bytes will be 0.
            2. You're base64-encoding your output. While this is a way to print arbitrary binary data as text, it uses 4 characters to represent 3 bytes of data, so you're increasing the size of your output by 33%.
            3. You're then using UTF-16 to turn the base64-encoded string into bytes again, which takes 2 bytes per character again. So that's an artificial 2x added to your result...

            It so happens that the two uses of UTF-16 more-or-less cancel out, but the base64-encoding bit is still responsible for a lot of the discrepancies you're seeing.

            Take that out, and you get a compression ratio of: 0.80338985.

            That's not bad, given that compression introduces overheads: there's data which always needs to appear in a GZip stream, and it's there regardless of how well your data compresses. You can only really expect compression to make any significant difference on larger inputs.

            See here.

            Source https://stackoverflow.com/questions/67690865

            QUESTION

            How to read data from inner archives without extracting zip file?
            Asked 2021-Apr-22 at 08:44

            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 possible, Let me know how to get this.

            ...

            ANSWER

            Answered 2021-Apr-22 at 08:44

            Based on this answer, you can open a file within the zip as a Stream. You can also open a ZipFile from a Stream. I'm sure you can see where this is heading.

            Source https://stackoverflow.com/questions/67209489

            QUESTION

            Azure.Security.KeyVault.Secrets: az is not recognized as an internal or external command
            Asked 2021-Mar-17 at 15:03

            I'm developing a web application using .Net Core and leveraging Azure services (Virtual Machine Windows Server 2016, Database PostgreSQL and Azure Key Vault). Below is my .csproj file:

            ...

            ANSWER

            Answered 2021-Mar-17 at 15:03

            I solved the problem by installing the Azure CLI and logging in as described here: https://docs.microsoft.com/cli/azure/install-azure-cli-windows?tabs=azure-cli

            Source https://stackoverflow.com/questions/66025763

            QUESTION

            Determining if a PDF File with Cloud File path is Password protected or Not (path starting with https:\\)
            Asked 2021-Mar-10 at 04:23

            I am Using DotNetZip (from NuGet Package). This will normally work for a File path having ("@C:) but once if use the Cloud File Path like (https:) it is giving me IBM437 error. I can use this package but need to introduce some encoding which is the other problem.

            I tried using SharpZipLib (another NuGet Package) but couldn’t find any information on internet related to it for a Cloud File Path. (http:).

            I also tried Spire PDF but it throws File doesn't exist (Parameter 'fileName') error for password protected PDF.

            URL’s for NuGet Packages - DotNetZip - https://www.nuget.org/packages/DotNetZip/ SharpZipLib- https://www.nuget.org/packages/SharpZipLib.NETStandard/

            Please let me know if any more information is required.

            ...

            ANSWER

            Answered 2021-Mar-10 at 04:23

            You can try to download the .pdf file as a local temp file and then check could open it without a password. Just try the C# console app below:

            Source https://stackoverflow.com/questions/66494930

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install SharpZipLib

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/icsharpcode/SharpZipLib.git

          • CLI

            gh repo clone icsharpcode/SharpZipLib

          • sshUrl

            git@github.com:icsharpcode/SharpZipLib.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Compression Libraries

            zstd

            by facebook

            Luban

            by Curzibn

            brotli

            by google

            upx

            by upx

            jszip

            by Stuk

            Try Top Libraries by icsharpcode

            ILSpy

            by icsharpcodeC#

            SharpDevelop

            by icsharpcodeC#

            AvalonEdit

            by icsharpcodeC#

            AvaloniaILSpy

            by icsharpcodeC#

            WpfDesigner

            by icsharpcodeC#