Are there any free compression utilities that zip in real time, such as Xceed Real-Time Zip?

What I need to do is compress 64KB chunks of the file as they come from an external service, and then transfer this chunk of compressed data to the browser in real time. Xceed Real-Time is pretty awesome in how you can set the file header and then put together a few 64 KB fragments together into a whole file on a clip. This works great, and you can easily process multiple files by putting them in a loop.

My question is this: is there a free alternative compression utility that can match the complexity of Xceed? I need something that can compress and transfer parts of the file to the browser. Almost all the free alternatives I've seen require access to the entire file (s) before compression can occur. Xceed is great, but it's expensive. Just wondering if there is a free alternative that can do this. Thanks!

+4
source share
2 answers

What you are looking for is a thread compression method. The good news is that you have quite a few options. Also note that you need to think about memory, because some solutions (based on dictionaries) may require a lot of memory, so check and configure.

To answer a short question, I suggest trying LZ4.

LZ4 - http://code.google.com/p/lz4/

LZ4 is a very fast lossless compression algorithm providing a compression rate of 300 MB / s per core, scalable with a multi-core processor. It is also equipped with an extremely fast decoder at a speed of GB / s per core, typically reaching RAM limits for multi-core systems.

Benchmark:

Name Ratio C.speed D.speed MB/s MB/s LZ4 (r97) 2.084 410 1810 LZO 2.06 2.106 409 600 QuickLZ 1.5.1b6 2.237 373 420 Snappy 1.1.0 2.091 323 1070 LZF 2.077 270 570 zlib 1.2.8 -1 2.730 65 280 LZ4 HC (r97) 2.720 25 2040 zlib 1.2.8 -6 3.099 21 300 

There are many implementations available, please check: http://code.google.com/p/lz4/

LZO - http://lzo-net.sourceforge.net/

LZO.Net brings the power of Markus "FXJ" Oberhumer excellent LZO compression library (V1.08) .Net. It blocks access to the DLL with a small C # class that supports the raw speed ANSI-C library.

Snappy - https://code.google.com/p/snappy/

Snappy is a compression / decompression library. It is not intended for maximum compression or compatibility with any other compression library; instead, it targets very high speeds and reasonable compression.

Two built-in versions of C # are available:

QuickLZ - http://www.quicklz.com/

QuickLZ is the world's fastest compression library, reaching 308 MB / s per core. It can be used under a commercial license if it was acquired or under the GPL 1, 2 or 3, where everything that was released to the public must be open source.

Native implementations - QuickLZ C #

 So far, only a subset of the library has been ported, namely the setting: QLZ_COMPRESSION_LEVEL = 1 or 3 QLZ_STREAMING_BUFFER = 0 QLZ_MEMORY_SAFE = 0 
+6
source

Check out SharpCompress, written specifically for your purpose. I use it and work great for my solution. We used Xceed before re-recording.

http://sharpcompress.codeplex.com/

SharpCompress is a compression library for .NET / Mono / Silverlight / WP7 that can unzip, unzip, unzip, unzip unbzip2 and unzip using the direct reading APIs and random access files. Write support for zip / tar / bzip2 / gzip is implemented.

The main feature is support for streams that are not searchable, so large files can be processed on the fly (ie, a download stream).

+1
source

Source: https://habr.com/ru/post/1495055/


All Articles