gzip

GZIPInputStream to String

First of all, I'm sorry if my terminology is a bit amateur, try to bear with me ;) I am attempting to convert the gzipped body of a HTTP response to plaintext. I've taken the byte array of this response and converted it to a ByteArrayInputStream. I've then converted this to a GZIPInputStream. I now want to read the GZIPInputStream and s...

How to compress every file in a folder using Ant and Gzip

Suppose I have a folder with many files. I want to have a .gz version of each file (not a tar.gz with all files). How do I do that with Ant? Ant's doesn't accept a list of files, only operates on one. So how do I repeat this for all files, with a certain extension, in a directory? ...

How to gzip ajax requests with Struts 2?

How to gzip an ajax response with Struts2? I tried to create a filter but it didn't work. At client-side I'm using jQuery and the ajax response I'm expecting is in json. This is the code I used on server: ByteArrayOutputStream out = new ByteArrayOutputStream(); GZIPOutputStream gz = new GZIPOutputStream(out); gz.write(json....

Any Library/Class To Decode/Encode Gzip, compress, x-gzip or x-compress?

Any Php Class To Decode/Incode Strings with Gzip, compress, x-gzip or x-compress Algorithm . Thanks ...

If we use apache or lightspeed web server, and use gzip on our content, will it compute that compression for EVERY request?

I was just wondering, it seems like a trivial thing, but the question arises, does the web server compute compression on files for every request that is made? if so, that would be hell CPU heavy as the site grows, what are the possible work arounds if that is the case? I thought it would be nice to pre compress files and use some mod_re...

Files that apache Gzips, is it cached or not? or it just wastes CPU every time a request is made?

Title says it all.. ...

What's wrong with this gzip format?

I use the following python code to download web pages from servers with gzip compression: url = "http://www.v-gn.de/wbb/" import urllib2 request = urllib2.Request(url) request.add_header('Accept-encoding', 'gzip') response = urllib2.urlopen(request) content = response.read() response.close() import gzip from StringIO import StringIO ht...

GZipStream is cutting off last part of XML

I have created an extension method called AddGZip which looks like the following: public static void AddGZip(this HttpResponse response) { response.Filter = new GZipStream(response.Filter, CompressionMode.Compress); response.AppendHeader("Content-Encoding", "gzip"); } This is a very cut down version of the code: var response ...

Java GZip an object and serialize it using MappedByteBuffer

I'm serializing a large 3d array to disk.The original data is around 50MB and GZiped output is in Kb's size.But the operation takes around 5 sec's.I would like to optimize it for time.I was thinking weather it would be any better to use a mapped read/write since i have seen it has better performance than the usual stream writing.But don...

How to set mod_deflate preferred compression method to deflate

The title says it all. mod_deflate always sends gzip data when the request header Accept-Encoding is gip, deflate. How can I tell mod_deflate to prefer to send deflate (NOT zlib) instead of gzip? If this isn't possible...why would the develpers name the module mod_deflate when it can't deflate. Also, what is the best way, if any, for ...

One library for deflate, gzip, and zlib in .net

First, let's define some commonly confused terms: deflate = compression_algorithm; zlib = header + deflate + trailer; gzip = header + deflate + trailer; I'm looking for a library that will basically let me do the following: if(method == "gzip"){ Response.Filter = new CompressionLibrary.OutputStream(Response.Filter, CompressionLib...

gzunip -c and gzcat

Hi fellows, Could anyone tell why is gunzip -c so much slower than gzcat ? I though they were essentially the same.. cheers, f. ...

IE's XMLhttpRequest's getResponseHeader("Content-Length") absent when Content-Encoded sent

Why won't IE let me see the get the Content-Length header with getResponseHeader()? I know there the headers are being sent; I can see them with Wireshark. IE just won't let me get them. If the Content-Encoding header is NOT sent, regardless of if the content-is gzipped or not, I can get them just fine. Sample Code: function getX...

Ruby zlib::Gzip not working properly

I was in the middle of creating an inport/export system that could encode a costume data structure in an xml tree and then read it back and recreate the object. I got the xml part to work fine but when I discovered that the xml file was 1.5mb when the original ruby::Marshal file was only 105kb I decided that it would be a good idea to co...

GZip a string for output from Coldfusion results in "Content Encoding Error" in browsers

I am trying to GZip content in a variable to output to the browser. To start I am making this very simple and not worrying about browsers that do not support gzip. Also I have put this together from researching several methods that I could find on the web. Some of them from people that may be reading this question. <cfsavecontent var...

Is there any way of compressing the tagfile in vim

Hi, I was following the guide at teuton.blogspot.com to set up autocompletion, when I ran the command: `ctags –R --c++-kinds=+p --fields=+iaS --extra=+q \ -f ~/.vim/commontags /usr/include` to generate a tagfile, only to realise that the command would generate a 'commontags'-file of 1.5GB a bit larger, than I'd have liked it to b...

apache mod_deflate not compressing

Hi, I've done the following to enable and configure mod_deflate in apache running on ubuntu >sudo a2enmod deflate >sudo apache2ctl restart >sudo vi deflate.conf <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml application/x-javascript text/javascript application/javascript DeflateFilt...

Ajax framework failed to load with Gzip compression on IE only

Well, I got gzip working, but there are issues with IE. (works fine with FF and Chrome) Message: ASP.NET Ajax client-side framework failed to load. (and many other js related errors) How can I prevent gzip compression on ie browsers ?? Other people who had similar issues enabled compression in IIS and that seems to solve the issue, but ...

Creating and Extracting a tgz archive in Rails

Does anyone know how to archive a folder and its contained files as a tgz archive using Rails? What I would like todo is archive the contents of the folder and then have another script which extracts the same folder that was archived. All of the archiving techniques that I've come across are pretty complicated, I was wondering if there ...

How to tell if a file is gzip compressed?

I have a Python program which is going to take text files as input. However, some of these files may be gzip compressed. Is there a cross-platform, usable from Python way to determine if a file is gzip compressed or not? Is the following reliable or could an ordinary text file 'accidentally' look gzip-like enough for me to get false po...