Questions tagged [deflate]

deflate is a lossless data compression format, and also refers to implementations that compress to the deflate format. The deflate format was created by Phil Katz of PKWare for the PKZip (.zip) archive format. Public domain software provides deflate and inflate functionality in the gzip utility and the zlib library.

Documentation of the deflate format may be found in RFC-1951

588 questions
0
votes
2 answers

Compressing data

For some reason I can't find a solid example online on how to do the following, so if anyone here can help that would great I am transferring files over a socket in Java 6 and I would like to compress the data. I have looked into the ZIP Input…
E.S.
  • 2,733
  • 6
  • 36
  • 71
0
votes
1 answer

How do you write a custom deflation dictionary and implement it

How do you write a custom deflation dictionary and implement…
Loligans
  • 497
  • 9
  • 24
0
votes
1 answer

C# DeflateStream Decompress with C++

I compressed data whit DeflateStream. I can decompress whit c#, but how can i decompress whit c++ (VS2013 RC)? I tried inflate whit zlib. Not worked.
0
votes
1 answer

decompressor for deflate comprssed-data with fixed Huffman codes

I want to write a decompressor for deflate compressed-data with fixed Huffman codes. form the specification: BTYPE specifies how the data are compressed, as follows: 00 - no compression 01 - compressed with fixed Huffman…
user1604573
  • 175
  • 1
  • 2
  • 6
0
votes
1 answer

Is this the right sequence of operations when uncompressing deflated data?

I am trying to implement an inflate algorithm for deflate-compressed data with static Huffman codes. After reading the specification I came into conclusion that these the steps that I am going to need: read the block 3-bits header build Huffman…
user1604573
  • 175
  • 1
  • 2
  • 6
0
votes
1 answer

Deflater: is it possible to clone state (or rollback)?

Suppose I'm using a Deflater to compress a stream of bytes, and at some intervals I have the option of feeding it with two different byte arrays (two alternative representations of the same info), so that I can choose the most compressible one.…
leonbloy
  • 73,180
  • 20
  • 142
  • 190
0
votes
2 answers

Python PNG decoding - Huffman coding

As a part of my homework, I am supposed to write a simple PNG reader in Python. I am forbidden to use any Python libraries that work with images, and as a result I should have a list lists(rows of image) of RGB touples of single pixels. The decoder…
Vojta Hejda
  • 177
  • 2
  • 14
0
votes
1 answer

Why is the first code of a code length the number of codes of that length times 2?

I've been trying to make sense of an example inflate implementation and this is a bit confusing: static int decode(struct state *s, struct huffman *h) { int len; /* current number of bits in code */ int code; /* len bits…
0
votes
1 answer

Gzip .z unix format using c# (deflate algorithm)

For a project we're working on, we need to save a Gzip .z file in C#, in Unix format, using the deflate algorithm. I've taken a look at GZipStream, but there doesn't seem to be any option to set the file as Unix format. I've also taken a look at…
frogdr
  • 63
  • 4
0
votes
1 answer

DeflateStream not working with buffer processed from PHP implementation

I'm trying to decompress buffer compressed by php deflate implementation. Here's the code: public static void CopyTo(Stream src, Stream dest) { byte[] bytes = new byte[4096]; int cnt, i = 0; while ((cnt =…
Davita
  • 8,928
  • 14
  • 67
  • 119
0
votes
1 answer

Does the common HTTP server implementation decompress POSTed form data?

If I GZip the a POST request form data, will a HTTP server decompress it, or it only works the other way (server -> client)?
Jader Dias
  • 88,211
  • 155
  • 421
  • 625
0
votes
1 answer

Deflate - Inflate errors. Causing "incorrect header check" errors

I am working on implementing a SAMLSLO through HTTP-REDIRECT binding mechanism. Using deflate-inflate tools gives me a DataFormatException with incorrect header check. I tried this as a stand-alone. Though I did not get DataFormatException here I…
Venkster
  • 1
  • 1
  • 2
0
votes
1 answer

Gzip in apache-tomcat

I want to enable gzip for compression and I have tried many blocks of code. Unfortunately, nothing works. The server that my host is using is apache-tomcat. Do they use different code for enabling gzip or deflate? I only have access to .htaccess.…
falidoro
  • 399
  • 3
  • 14
0
votes
1 answer

DeflateStream compress/decompress inconsitency

I have the following data from a photoshop file that uses zip-compression (RFC1951): 250, 255, 159, 1, 47, 248, 63, 42, 63, 172, 229, 1, 2, 12, 0, 209, 255, 31, 225 Which decompresses to the following, x16: 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
George R
  • 3,784
  • 3
  • 34
  • 38
0
votes
1 answer

Decompressing a trunctated compressed stream (Deflate)

I'm using udp to communicate between server and client. The server has the ability to compress packets if they are too long (Deflate). Now the problem is that sometimes the packet is still too long, even after compression. After some experimenting I…
Arokh
  • 614
  • 1
  • 10
  • 18