||nsDeflateConverter is a stream converter applies the deflate compression
method to the data.
An interface for a zip archiver that can be used from script.
The interface supports both a synchronous method of archiving data and a
queueing system to allow operations to be prepared then run in sequence
with notification after completion.
Operations added to the queue do not get performed until performQueue is
called at which point they will be performed in the order that they were
added to the queue.
Operations performed on the queue will throw any errors out to the
An attempt to perform a synchronous operation while the background queue
is in progress will throw NS_ERROR_IN_PROGRESS.
Entry names should use /'s as path separators and should not start with
It is not generally necessary to add directory entries in order to add file
entries within them, however it is possible that some zip programs may
experience problems what that.
||nsZipDataStream handles the writing an entry's into the zip file.
It is set up to wither write the data as is, or in the event that compression
has been requested to pass it through a stream converter.
Currently only the deflate compression method is supported.
The CRC checksum for the entry's data is also generated here.
||nsZipHeader represents an entry from a zip file.
||nsZipWriter is used to create and add to zip files.
It is based on the spec available at
The basic structure of a zip file created is slightly simpler than that
illustrated in the spec because certain features of the zip format are
[local file header 1]
[file data 1]
[local file header n]
[file data n]
[end of central directory record]
||Fully reads the required amount of data. Keeps reading until all the
data is retrieved or an error is hit.
||ZIP file data is stored little-endian. These are helper functions to read and
write little endian data to/from a char buffer.
The off argument, where present, is incremented according to the number of
bytes consumed from the buffer.