Giter Club home page Giter Club logo

stoolkit.zlib's Introduction

SToolkit.Zlib

Zlib manage library, based on componentace.zlib with easy usage

NuGet

Install

Nuget Package

Or Nuget console

Install-Package SToolkit.Zlib

Examples

#1

Usage

Including

using SToolkit.Zlib;

Compress data

byte[] file1 = File.ReadAllBytes("image.jpg");
byte[] compressed1 = Zlib.Compress(file1, ZlibCompressionLevel.BEST_COMPRESSION);
File.WriteAllBytes("image.jpg.compress", compressed1);

Decompress data

byte[] decompressed1 = Zlib.Decompress(compressed1, file1.Length);
File.WriteAllBytes("image_decompress.jpg", decompressed1);

Check if data compression

if (Zlib.IsCompressedByZlib(file1))
{
    Console.WriteLine("file1 - compressed by zlib");
}
else
{
    Console.WriteLine("file1 - not compressed by zlib");
}

Basic compression levels is 0-9, library contains 3 static int levels on ZLibCompressionLevel class

ZlibCompressionLevel.NO_COMPRESSION
ZlibCompressionLevel.BEST_SPEED
ZlibCompressionLevel.BEST_COMPRESSION
ZlibCompressionLevel.DEFAULT_COMPRESSION

stoolkit.zlib's People

Contributors

kn1fe avatar

Watchers

 avatar  avatar

Forkers

arunkumarrawat

stoolkit.zlib's Issues

I have picked up the zlib.net project.

In order for me to push the fixed bugs along I had to rename the project to zlib.managed, also in fixing the bugs I created a helper class that compresses the data simpler and does not require users to need to use ZInputStream or ZOutputStream themselves called MemoryZlib which has members Compress and Decompress that allows them to set:

  1. Compression levels,
  2. Pass in the output as the second parameter to the method.
  3. The first parameter is the actual raw data.

Also if you want to archive this and let the people who fork zlib.net or even somehow get the normal zlib.net to update to say Use the package 'zlib.managed' instead of this one. That package major bug fixes and has helper methods to simplify all of your zlib usage.
https://github.com/Elskom/zlib.managed/

Also I see you took the original zlib.net like what I did, and simply just made other changes to it.

Also I found some similarities as well, except what I did on mine was place the Compress and Decompress methods in an MemoryZlib class.

Also an IsCompressedByZlib that would be nice to add on mine too, if you would like you can always replace this package with mine, it contains a lot of bug fixes and can also help further develop zlib.net if 1 version is developed to instead of a ton of zlib.net based ones that contains fixes, and lacks other major ones as well at the same time.

Also my version contains some code cleanup, the csproj's are the new sdk style ones and because of that requires little to no issues updating them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.