ActionScript GZIP compression library

This is an ActionScript library for encoding (compressing and uncompressing) files using the GZIP compressed file format. The source code for the ActionScript GZIP encoding library is hosted on Google Code; the code is available under the Mozilla Public License, v. 1.1.

Where it’s been used:

You can leave a comment, or trackback from your own site.

15 Comments so far


  1. Danny Patterson is reported to have said:

    links from TechnoratiSince I actually needed to get at the raw binary gzip data returned by the server, I had to change my code to use the low-level URLLoader class that is built-in to Flash Player. To remove the GZIP header returned in the HTTP response data, I used anopen-source library


  2. Adobe - Developer Center : Compressing files and data is reported to have said:

    Kramer auto Pingback[…] These files are from the open-source ActionScript GZIP compression library written by H. Paul […]


  3. Extending the Flex HTTP Service to Support Binary Data is reported to have said:

    Kramer auto Pingback[…] this particular case, we pass the binary data to Paul Robertson’s excellent GZIPEncoder3 and decode it to obtain the actual result and then pass it on to HTTPService’s processResult so […]


  4. Alex is reported to have said:

    Hi Paul,

    I was pretty excited to find your GZIP library and was going to use it in my project. But then I discovered that it doesn’t work with Flex. Flex’s implementation of ByteArray.compress() is different than AIR’s and supports only default zlib compression. Any idea why are they different? Will Flex ever support gzip?

    Thanks,
    Alex


  5. Paul is reported to have said:

    @Alex:

    Just to clarify, the library does work with Flex (I’ve only ever used it with Flex) as long as your Flex app runs in AIR. However, the library doesn’t work in Flash Player 9, so it doesn’t work in a Flex app that runs in the browser (or a non-Flex app that runs in the browser, for that matter).

    The additional functionality (compression using the Deflate algorithm rather than zlib) was added in AIR — as you’ve noted, Flash Player only supports zlib.

    The good news is that the functionality that was added in AIR has been rolled back into Flash Player for the next release (Flash Player “Astro”), which is currently available as a public beta. I haven’t updated the library to support that new functionality, obviously, but I plan to do so soon.


  6. はてなブックマーク - FZip - codeazur brasil lab is reported to have said:

    Kramer auto Pingback[…] actionscript, library AS3 で ZIP 解凍。GZIP はhttp://probertson.com/projects/gzipencoder/。 […]


  7. akhil is reported to have said:

    this library is working with desktop AIR application. But i want to use this library in web application flex. how can i do this

    thank you


  8. Paul is reported to have said:

    @akhil:
    Others have also commented on this, above. As I replied, it is theoretically possible to use the library in a Flash Player (browser) application now that the raw DEFLATE compression is supported in Flash Player. However, the refactoring work to support it turned out to be more complex than I thought so I haven’t had a chance to finish it up.

    Obviously there is interest in it, so I’ll try to take a look at it soon and see what I can do to get it working.


  9. Paul Robertson is reported to have said:

    For everyone who’s asked (and I’m surprised how many have), I’ve got a beta (barely tested) version of the library with support for Flash Player-only projects (no AIR dependencies). See the full post for details.


  10. Mark Lynch is reported to have said:

    Hi Paul,

    Thanks for the great piece of code - I’ve taken your new version and used it with Anirudh’s code (with some minor modification) to make a drop in replacement for HTTPService which will handle both gzip’d and non gzip’d content.

    http://www.learnosity.com/techblog/index.cfm/2009/3/19/More-of-AIR-Gzip-compression

    Great work.
    Thanks,
    Mark


  11. Lynch Consulting Blog is reported to have said:

    links from Technoratimy best sherlock holmes head on I rapidly deduced that Charles as well as proxying the request was also decompressing it helpfully for me. Luckily I’d already come across the solution to the problem courtesy of Anirudh Sasikumar (GzipHTTPService) andPaul Robertson (Gzip Encoder). I made some minor modifications to Anirudh’s Gzip HTTP Service to do two things. Always send the header ‘Accept-Encoding’:’gzip’ if running a Desktop (Aka AIR) app. Handle the case where the Gzip response that comes back is not gzip compressed.


  12. Joe Corner-Reeve is reported to have said:

    Hello guys,
    Is your compression function in actionscript 3?

    Wow! I think because we need high-level compression by function like WinRar, 7z or kgb compressing functions. How do i know about currect encoder by rar, 7z or kgb compressed files?
    Where do i find encodes from internet?

    I have problem of adobe air while my sample file will compressing onto compressed file. But adobe air application was killed by debug while compression process lose that long time.. :(

    I need processbar on panel like WinRar with process panel while compressor will to be final created compressed files?

    Thank you! Ragards, Joe Corne-Reeve


  13. Paul Robertson is reported to have said:

    @Joe:
    The compression is built into AIR/Flash Player, so it runs in native code, not in ActionScript. Other compression formats such as the ones you mention would either need to be included in the player or rewritten in ActionScript.

    Unfortunately, the compression and decompression run synchronously in Flash Player/AIR, so there’s no way to get progress notifications (or even run any other code) while they’re running.


  14. k.chandra shekar is reported to have said:

    hi paul

    I am trying to compress the files in flex app using flash player 10 but it is not working in fp10 give me exact solution how to compress files in flex web application development not in the air
    i neede so how to do pls help me the ways
    bye


  15. Gregor Rot is reported to have said:

    For flash player 10 that supports gzip comp/decomp, the only thing that needed to be changed in the code is:

    data.compress(…) -> data.inflate();
    data.uncompress(…) -> data.deflate();

    Gregor

Add your comment





Comment notes

Please keep comments on topic. Comments that are inappropriate or offensive will be edited or removed.

Paragraphs and line breaks are automatically converted to HTML, and quotation marks are converted to “smart” quotes.

The following XHTML tags can be used: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> . All others will be removed.

Articles by Type

Articles by Topic

Random Reading

Currently...

Subscribe