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
9
votes
4 answers

Unexpected end of ZLIB input stream

I'm trying to round-trip a JSON string to a byte array with DeflaterOutputStream, but the code below throwing java.io.EOFException: Unexpected end of ZLIB input stream. It works when you replace the string with "Hello world", or if you remove a few…
slipheed
  • 7,170
  • 3
  • 27
  • 38
9
votes
3 answers

okhttp 3: how to decompress gzip/deflate response manually using Java/Android

I know that okhttp3 library by default it adds the header Accept-Encoding: gzip and decodes the response automatically for us. The problem I'm dealing with a host that only accepts a header like: Accept-Encoding: gzip, deflate if I don't add the…
Desolator
  • 22,411
  • 20
  • 73
  • 96
9
votes
2 answers

What are some good strategies for determining block size in a deflate algorithm?

I'm writing a compression library as a little side project, and I'm far enough along (My library can extract any standard gzip file, as well as produce compliant (but certainly not yet optimal) gzip output) that it's time to figure out a meaningful…
David Hay
  • 3,027
  • 2
  • 27
  • 29
9
votes
1 answer

Java Decompress a string compressed with zlib deflate

As the title says. How do you decompress a compressed string which was compressed with zlib deflate? What is the solid way of doing it with an explanation?
user4942382
9
votes
3 answers

AngularJS - How to deflate and encode/decode to base64 all jsons request?

Lets say i have several $resources and some $http around my angular application: myApp.factory('Note', function($resource) { return $resource('http://', {id: '@id'}, { 'index': { method: 'GET', isArray: true }, 'update': { method:…
Jakub Kuchar
  • 1,665
  • 2
  • 23
  • 39
8
votes
1 answer

Is there an official (or common) file extention or suffix for deflated files?

Gzipped files typically end in .gz. But, is there an official (or common) file extension or suffix for deflated files? I could not find any.
Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
8
votes
1 answer

Apache mod_deflate not compressing json output

I've followed all the steps in multiple tutorials to enable mod_deflate in Apache but I'm still not seeing compression (in Fiddler) when I issue requests for json (via PHP script) to my local web server. Compression isn't necessary for my browser to…
tomfumb
  • 3,669
  • 3
  • 34
  • 50
8
votes
1 answer

Caching Images, JS and CSS in Apache using deflate

I am currently caching my CSS, JS and images using deflate in my Apache configuration. Here's my code: AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType…
Tech4Wilco
  • 6,740
  • 5
  • 46
  • 81
8
votes
1 answer

GZip or Deflate compression for asp.net mvc 2 without access to server config

I tried to use the method described here ASP.NET MVC Action Filter - Caching and Compression . At first the results where encouraging as indeed the server started sending GZip encoded files but after further testing, at times, in pages with…
mrichana
  • 83
  • 3
8
votes
1 answer

Deflater.deflate and small output buffers

I'm seeing a strange situation with small output buffers with Java 8u45 and the java.util.Deflater.deflate(byte[] b, int off, int len, int flush) method when used with small output buffers. (I'm working on some low level networking code related to…
Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136
8
votes
4 answers

Compress/Decompress NSString in objective-c (iphone) using GZIP or deflate

I have a web-service running on Windows Azure which returns JSON that I consume in my iPhone app. Unfortunately, Windows Azure doesn't seem to support the compression of dynamic responses yet (long story) so I decided to get around it by returning…
Steven Elliott
  • 3,214
  • 5
  • 29
  • 40
8
votes
1 answer

Java Deflater strategies - DEFAULT_STRATEGY, FILTERED and HUFFMAN_ONLY

I'm trying to find a balance between performance and degree of compression when gzipping a Java webapp response. In looking at the Deflater class, I can set a level and a strategy. The levels are self explanatory - BEST_SPEED to…
Keyur
  • 302
  • 3
  • 12
8
votes
2 answers

enable gzip module on wampserver

I want enable Gzip module on wamp server and i open two mod in httpd.conf LoadModule deflate_module modules/mod_deflate.so LoadModule headers_module modules/mod_headers.so some configs at bottom SetOutputFilter…
sid zhang
  • 91
  • 1
  • 3
7
votes
1 answer

Best zip compression level for JSON or text files?

Has anyone performed some tests (size and speed) for the selection of the 'best' compression level of the Java zip deflater, to be used on general/miscellaneous JSON or text files? If yes which level do you recommend? Thanks.
Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
7
votes
1 answer

Compress Outgoing Requests in Angular 2+

I want to use gzip or deflate compression on outgoing POST and PUT JSON requests to an API project from an Angular 4 application. Presently, I'm using HttpClient to send the requests. I've tried using pako or zlib to generate the compressed content,…
Matt Eland
  • 348
  • 1
  • 4
  • 13
1 2
3
39 40