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
6
votes
3 answers

Are zlib.compress on Python and Deflater.deflate on Java (Android) compatible?

I am porting a Python application to Android and, at some point, this application has to communicate with a Web Service, sending it compressed data. In order to do that it uses the next method: def stuff(self, data): "Convert into UTF-8 and…
Edu Zamora
  • 1,492
  • 1
  • 19
  • 30
6
votes
2 answers

JavaScript inflate implementation (possibly FF 3.6 only)

I'm writing some scripts that are using the HTML 5 file API in FireFox 3.6. I got some deflated (compressed) files, and I need to inflate (uncompress) them. I found a few scripts while googling, but none of them have tests. So I'm a bit reluctant to…
August Lilleaas
  • 54,010
  • 13
  • 102
  • 111
6
votes
1 answer

php - Get compressed contents using cURL

I need to get content of various web pages. Some of them are compressed using different methods (gzip, deflate, etc). I've searched on the Internet and found the solution for gzipped content: $ch =…
Bé Khỏe Bé Pro
  • 313
  • 1
  • 3
  • 9
6
votes
1 answer

Non symmetric java compression

I have a data sample: byte[] b = new byte[]{120, 1, -67, -107, -51, 106, 20, 81, 16, -123, 107, 18, -51, -60, 31, -30, 117, -4, -53, -60, -123, 25, 70, 71, 23, -111, 89, 12, 8, -83, 49, 4, -14, -93, -63, 73, 32, 89, -55, -112, -123, 10, -30, 66, 69,…
user2078222
  • 135
  • 10
6
votes
1 answer

Compression of zip archive

I'm trying to compress directory content into zip archive using java. Everything is fine, but I just want to clarify some facts. Here is the code which I use to compress files: public void pack(@Nonnull String archiveName, @Nonnull File outputDir,…
Gregory Kalabin
  • 1,760
  • 1
  • 19
  • 45
6
votes
2 answers

Setting Size of Java Deflater (and Inflater) Output Byte Buffer

I need to deflate one or more byte arrays and later inflate them back to normal size. I've looked over the example given in the api docs, and found some other examples. After looking these examples over, I have two questions which may be unrelated,…
Tango
  • 649
  • 1
  • 12
  • 29
6
votes
1 answer

mod deflate not compressing subdirectories of root

I am about 48 hours into trying to solve a gzip deflate issue and realize I may need to ask for help, hehehe. I have finally gotten the deflate module enabled on my shared Unix server via .htaccess after realizing I needed to turn on compression in…
5
votes
2 answers

Compressing (Gzip or Deflate) Shows, Lists and views in Couchdb

It seems that couchdb automatically compress all its _attachments when requested with the correct header. But unfortunately this doesn't happen for views, show or lists. Is there any way to achieve a compression before returning the result to the…
zanona
  • 12,345
  • 25
  • 86
  • 141
5
votes
3 answers

How to rebuild the dynamic Huffman tree from DEFLATE

This question is in regards to section 3.2.7 of RFC-1951, rebuilding the dynamic Huffman tree. Each code is defined by a sequence of code lengths, such that all codes of a given bit length have lexicographically consecutive values. For example,…
Dave P
  • 145
  • 8
5
votes
2 answers

Add .gz file to .zip archive without decompressing and re-compressing?

Assume that the gzip file and zip archive both use DEFLATE. Since both would store the same raw compressed data for the specific file, is it possible to add a pre-compressed .gz file to an existing .zip archive? Some metadata would likely be lost…
Albeit
  • 738
  • 10
  • 21
5
votes
1 answer

DeflateStream CopyTo MemoryStream

Tyring to compress and decompress MemoryStream but it seems that CopyTo does not work like it's expected? Why? How to fix this? public static MemoryStream Compress(MemoryStream originalStream) { Console.WriteLine("Original before compressing…
A191919
  • 3,422
  • 7
  • 49
  • 93
5
votes
2 answers

Does Gzip/Deflate recognize patterns

I am studying the inner-workings of Gzip, and I understand that it uses a combination of Huffman Coding and LZ77. I also realize that a Gzip file is divided into blocks, and each block has a dictionary built for it. Then frequent occurrences of…
YAHsaves
  • 1,697
  • 12
  • 33
5
votes
3 answers

Node.js/Javascript Equivalent of Java's Deflater class

I have a Java backend that uses Inflater. I wish to feed data to it via Node.js. Is there any equivalent to the Deflater class? EDIT: I should clarify a little. I have tried using https://github.com/dankogai/js-deflate and then base64 encoding the…
Alec Gorge
  • 17,110
  • 10
  • 59
  • 71
5
votes
3 answers

GZip or Deflate for HTTP compression

Which compression method is better? I've heard lots of back and forth about GZip being more widely used, but Deflate being faster (in some instances). Is there an accepted standard on which one to use and why?
Scott
  • 13,735
  • 20
  • 94
  • 152
5
votes
3 answers

How to compress a String in Android

I am trying to compress a large string object. This is what i tried, but i am unable to understand how to get compressed data, and how to define different type of compression tools. This is what i got from Android docs. byte[] input =…
dev90
  • 7,187
  • 15
  • 80
  • 153