[ https://issues.apache.org/jira/browse/COMPRESS-391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16004285#comment-16004285 ]
Stefan Bodewig commented on COMPRESS-391: ----------------------------------------- I've pushed additional commits on the COMPRESS-391 branch. Feel free to ignore what I've done. Really. Reading is implemented as well ({{parseFromLocalFileData}} reads the padding length). I've installed zipalign and it always aligns at 4 byte boundaries (and does so for all stored entries). I wonder whether alignment should be a property of {{ZipArchiveOutputStream}} in addition to {{ZipArchiveEntry}} in order to apply it to all stored entries as well. You are correct, zipalign simply adds zeros which ends up in an {{UnparseableExtraField}} when we read it. As for proposing the extra field, it won't hurt, I'm just not sure how quick the response will be (and {{l}} is not a valid hex character ;-) 0xa11e?). Hmm, take a look at "4.6.10 -Microsoft Open Packaging Growth Hint (0xa220)" this looks as if we could use it, I couldn't find any information what its real purpose would be. Of course it doesn't store the alignment value you propose. > Zip entries alignment > --------------------- > > Key: COMPRESS-391 > URL: https://issues.apache.org/jira/browse/COMPRESS-391 > Project: Commons Compress > Issue Type: New Feature > Components: Archivers > Affects Versions: 1.13 > Reporter: Zbynek Vyskovsky > Labels: features, github-import, patch > Fix For: 1.14 > > > Similarly to COMPRESS-390, there are requirements of the zip content to be > mapped directly into memory and therefore may require special alignment on > the embedded files. E.g. libraries may be aligned to page (4096-bytes) > boundary, images on 4-bytes boundary etc. By alignment it's meant the offset > from the beginning of file where the actual data stream starts, not the > header. > One of the cases was (still is?) Android APK for which zipalign utility was > created. > It would be useful if commons-compress ZipArchiveOutputStream supports > something similar directly in its API. -- This message was sent by Atlassian JIRA (v6.3.15#6346)