Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You need to use the <code>nowrap</code> option of <code>Deflater</code> to produce a raw deflate stream with no headers or trailers. Then you will need to wrap that raw deflate stream with the appropriate zip headers and trailers yourself.</p> <p>To create a single deflate stream on multiple processors, you need to be able to flush the compressed output to a byte boundary (for the pieces that are not the last piece) using the <code>Z_SYNC_FLUSH</code> operation in <a href="http://zlib.net/" rel="nofollow">zlib</a>. (The last piece would be finished normally.) Then the pieces can be simply concatenated.</p> <p>The Java 7 (but not Java 6) <a href="http://docs.oracle.com/javase/7/docs/api/java/util/zip/Deflater.html" rel="nofollow">documentation</a> supports this with the optional fourth parameter of the <code>deflate()</code> method. That can be set to <code>SYNC_FLUSH</code>.</p> <p>Breaking up the data in this way will degrade compression, since each block cannot benefit from the history of the preceding block. This can be solved using the <code>setDictionary()</code> method. Provide to each thread both the data to compress as well as the 32K bytes of uncompressed data that precedes it. Then use the 32K with <code>setDictionary()</code>, followed by the <code>deflate()</code>.</p> <p>You can see <a href="http://zlib.net/pigz/" rel="nofollow">pigz</a> for an example of parallel compression in C using zlib directly.</p> <p>Once you have your deflate stream, you wrap it appropriately to make it a zip file. See the <a href="http://www.pkware.com/documents/casestudies/APPNOTE.TXT" rel="nofollow">appnote for the zip file format</a>. You will also need to compute the <a href="http://docs.oracle.com/javase/7/docs/api/java/util/zip/CRC32.html" rel="nofollow">CRC-32</a> of the uncompressed data to be able to fill in those fields.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload