zlib

Multithreaded Unzipping In Java

ⅰ亾dé卋堺 提交于 2019-12-04 05:50:20
So, I'm trying to do read-only access of a zip file in Java, decompressing in a multithreaded manner, because my standard simple singly-threaded solution of ZipFile/ZipEntry using the enumeration and inputstreams and what-not results in it taking about five full seconds just to decompress into memory a 50-meg zipfile which takes one second AT MOST for my disk to read without decompressing. However, the entire Java zip library is synchronized to an incredibly-obnoxious degree, no doubt because it's all abstracted for reading/writing/etc. in the same code instead of having nice efficient non

C/C++ Packing and Compression [closed]

耗尽温柔 提交于 2019-12-04 05:45:59
I'm working on a commercial project that requires a couple of files to be bundled (packed) into an archive and then compressed. Right now we have zlib in our utility library, but it doesn't look like zlib has the functionality to compress multiple files into one archive. Does anyone know of free libraries I'd be able to use for this? Amber Perhaps libtar ? Also under a BSD license. 7Zip has a full SDK for several languages including C and C++. The compression is extremely good, albeit not very fast. The code is licensed under the LGPL. You could use libzip - it's under a BSD-like licence so it

How can I decompress a vector of deflated data with Boost?

情到浓时终转凉″ 提交于 2019-12-04 04:53:50
问题 I have a vector that contains zlib-compressed (deflated) data. I would like to decompress it with Boost's filtering_istream . There is only one example on their site, which operates on a stream of data (as opposed to a vector that I have). vector<char> compressed_buffer; compressed_buffer.resize(cdh.length); file.read(&compressed_buffer[0], cdh.length); filtering_istream in; in.push(zlib_decompressor()); in.push(something(compressed_data)); // what should "something" be? I would like to get

How to inflate a partial zlib file

徘徊边缘 提交于 2019-12-04 04:29:59
I have the first contiguous 2/3rds of a file that was compressed with zlib's deflate() function. The last 1/3 was lost in transmission. The original uncompressed file was 600KB. Deflate was called multiple times by the transmitter while chopping the original file into chunk sizes of 2KB and passing Z_NO_FLUSH until the end of file when Z_FINISH was passed. The resulting complete compressed file was transmitted, but partially lost as described. Is it possible to recover part of the original file? If so, any suggestions on how? I'm using both the plain C implementation of ZLIB, and/or the Python

How to fix undefined references to inflate/deflate functions?

烈酒焚心 提交于 2019-12-04 04:29:57
问题 I am trying to compile existing code provided in examples by zlib , but it is giving me error at the first place itself: nikhil@nikhil-Vostro-3500:~/zlib-1.2.8/examples$ gcc -o zpipe -g zpipe.c /tmp/ccVZzqsb.o: In function `def': /home/nikhil/zlib-1.2.8/examples/zpipe.c:32: undefined reference to `deflateInit_' /home/nikhil/zlib-1.2.8/examples/zpipe.c:40: undefined reference to `deflateEnd' /home/nikhil/zlib-1.2.8/examples/zpipe.c:51: undefined reference to `deflate' /home/nikhil/zlib-1.2.8

Creating a gzip stream from separately compressed chunks

▼魔方 西西 提交于 2019-12-04 02:16:05
问题 I like to be able to generate a gzip (.gz) file using concurrent CPU threads. I.e., I would be deflating separate chunks from the input file with separately initialized z_stream records. The resulting file should be readable by zlib's inflate() function in a classic single threaded operation. Is that possible? Even if it requires customized zlib code? The only requirement would be that the currently existing zlib's inflate code could handle it. Update The pigz source code demonstrates how it

Installing latest 1.44 boost library under ubuntu 10.04

。_饼干妹妹 提交于 2019-12-03 22:55:15
I have ubuntu 10.04 and want to install the latest boost library 1.44_0 I downloaded the tar.gz file and unpacked it into /usr/local/boost_1_44_0 I already have the boost 1.40 version install from synaptic. So I want to compile and link against 1.44 because I'm wanting to use some new libraries that are not in the older version such as the property tree. But, I'm having some issues getting it going. Ran sudo ./bootstrap.sh (that went fine) Ran ./bjam install There were errors with bzip2. gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.4.3/release/threading-multi/file_descriptor.o gcc.compile

How to retrieve data from a attached zip file in Blackberry application?

北城以北 提交于 2019-12-03 21:48:49
I am using eclipse to build application for Blackberry. I attached a zip file with my application. Please help me, I don't know how to retrieve data form the zip file in application development. In BlackBerry we can use two compression standarts: GZip and ZLib . Choose one, then compress your file and add to project. Then you should be able to open it as an resource. After that decompress it with GZIPInputStream or ZLibInputStream accordingly. Example (uncompress and print text from test.gz attached to project): try { InputStream inputStream = getClass().getResourceAsStream("test.gz");

Static libpng link with visual studio 2010

主宰稳场 提交于 2019-12-03 21:04:48
I'm trying to add PNG support to my application and thus I want to include libpng. I know it needs zlib and thus I downloaded that as well. I went into the png folder/projects/vstudio and I opened the solution. I compiled it and it went just fine. I added some headers from it into my application and I copied the lib files. My program is a dll written in c++ which is later used from C#. When I run it in C# it complains about not finding my dll (tough if I remove the png part it works fine). I've had this problem before and it usually means a dll dependency is wrong. Now... libpng compiled both

Compression and decompression problem with zlib.Net

穿精又带淫゛_ 提交于 2019-12-03 20:23:51
问题 I am using ZLIB.Net and I just don't understand what should I do to compress a stream which is not FileStream , but MemoryStream . By doing: byte[] buffer = ASCIIEncoding.ASCII.GetBytes("Hello World"); MemoryStream outStream = new MemoryStream(); zlib.ZOutputStream outZStream = new zlib.ZOutputStream( outStream, zlib.zlibConst.Z_BEST_COMPRESSION); outZStream.Write(buffer, 0, buffer.Length); outZStream.finish(); buffer = outStream.GetBuffer(); Debug.WriteLine(DateTime.Now.ToString() + ":" +