nsIZipWriter: support alignment for individual files

NEW
Unassigned

Status

()

P5
normal
5 years ago
a year ago

People

(Reporter: swu, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [necko-would-take])

(Reporter)

Description

5 years ago
This is a follow up bug from bug 959047 comment 8.

To provide more general and flexible support for alignment, we can implement an API as follow, which allows different alignment size for files in a zip.

void addAlignedEntryStream(in AUTF8String aZipEntry, in PRTime aModTime,
                           in int32_t aCompression, in nsIInputStream aStream,
                           in boolean aQueue, in uint32_t aAlignSize);

For each file in zip, we need to save the aligment size in the extra field.
Below is a proposed Mozilla proprietary extra field.

   Value        Size        Description
   -----        ----        -----------
   0xAA01       2 bytes     Tag for this "extra" block type
   TSize        2 bytes     Size of the store data
   AlignSize    2 bytes     Alignment size
   Padding      Variable    Padding information for alignment

For more information on extra field in zip, please read "Extensible data fields" section in:
http://www.pkware.com/documents/casestudies/APPNOTE.TXT
Whiteboard: [necko-would-take]
You need to log in before you can comment on or make changes to this bug.