côdeazur brasil lab
FZip
FZip is an Actionscript 3 class library to load, modify and create standard ZIP archives.
FZip parses ZIP archives progressively, allowing access to contained files while the archive is loading.
API Documentation
Download
License
FZip is released under the OSI approved zlib/libpng license.
Authors
Claus Wahlers and Max Herkender
Donate
If you like FZip, please consider a small donation. We would greatly apprechiate it! (it pays our hosting bills)
Demo
Loads a ZIP archive containing 1000 PNG icons (available for download from famfamfam) and displays the icons on screen while loading.
Launch demo (requires Flash Player 9)
Limitations
- When run in the Flash Player browser plugin, FZip can't uncompress compressed files in ZIPs. See Checksum Patch below to workaround this. This doesn't apply when FZip runs in the AIR runtime, or when all files contained in the ZIP are stored uncompressed.
- FZip generally can't read ZIPs that make use of Data Descriptors. Examples of such ZIPs are those created by the Mac OS X Archiver utility, SWCs, JARs, etc. (Fixed)
Checksum Patch
This patch is not required if FZip runs in the Adobe AIR runtime or if the files in the ZIP archive are stored uncompressed (formats such as GIF, JPEG, PNG or SWF for example are already compressed and do not need to be recompressed).
In order to be able to decompress compressed files in a ZIP archive, FZip requires the presence of an Adler32 checksum in addition to the standard CRC32 checksums contained in ZIP archives.
We provide a Python script that unobtrusively injects Adler32 checksums into ZIP archives. It is included in the FZip distribution under the 'tools' directory. In order to use this script, Python needs to be installed.
We also provide a Java tool to inject Adler32 checksums (courtesy of Damien Biggs, thanks!).
History
FZip 1.5 (11/27/2009)
- FZip is now able to parse ZIP archives with data descriptors (those created by the Mac OS X Archiver utility, SWCs, JARs, etc).
- Java Adler32 injector added, courtesy of Damien Biggs (thanks!).
- Moved to GitHub. This History section ist hereby discontinued. For latest developments please check the commit history on GitHub. Please also consider logging bugs as you run into them. Thanks!
FZip 1.0.062 (02/28/2008)
- Bug fix: Using namespaces for states seemed to be not a very good idea,
some users experienced weird RTEs when parsing ZIPs. We now use function
references to maintain state which seems to work much better. If you ever
got a
ReferenceError: Error #1065: Variable parse is not defined. at deng.fzip::FZipFile/parse()
, this is very much likely fixed now.
FZip 1.0.059 (02/25/2008)
- New API function (contributed by Ray Greenwell, thanks!)
- loadBytes(bytes:ByteArray):void
- The
serialize
method now writes Adler32 checksums if the new includeAdler32 argument is set totrue
.
FZip 1.0.055 (12/21/2007)
- Bug fix: Compiler errors in non-AIR projects and development environments.
- New API functions to create/modify ZIP archives:
addFile(name:String, content:ByteArray = null):FZipFile
addFileAt(index:uint, name:String, content:ByteArray = null):FZipFile
addFileFromString(name:String, content:String, charset:String = "utf-8"):FZipFile
addFileFromStringAt(index:uint, name:String, content:String, charset:String = "utf-8"):FZipFile
removeFileAt(index:uint):FZipFile
serialize(stream:IDataOutput):void
FZip 1.0.051 (10/04/2007)
- Adobe AIR Beta 2 deprecated ByteArray.inflate(), FZip was thus no longer working in AIR. Fixed, FZip now uses ByteArray.uncompress(CompressionAlgorithm.DEFLATE).
- Parse errors now throw an exception if no event listener is found for FZipErrorEvent.PARSE_ERROR.
FZip 1.0.049 (07/13/2007)
- Bug fix: Adobe AIR support introduced a critical bug that made FZip stop working in the regular Flash Player.
FZip 1.0.048 (06/25/2007)
- Bug fix: Typos in FZipLibrary documentation.
FZip 1.0.045 (06/22/2007)
- Added support for Adobe Air. The Adobe Air runtime provides a low level deflate method, making it possible to load any ZIP archive and decompress compressed files without the need of injecting Adler32 checksums.
- Bug fix: There was a problem with filenames containing special characters. Filename encoding now defaults to UTF-8. In case the filenames are encoded differently in your ZIP, you can specify the encoding in the FZip constructor.
- Added FZipLibrary class for higher level access to files in a ZIP archive. FZipLibrary processes files (based on file extensions) from an FZip instance and converts them into usable formats. Files can be converted to either a BitmapData or DisplayObject classes. Data embedded in SWF files (like classes) can also be retrieved. Flash's built-in Loader class is used to convert formats, so the only formats currently supported are ones that Loader supports. As of this writing they are SWF, JPEG, GIF, and PNG.
FZip 1.0.029 (10/11/2006)
- Initial Release.