- high-level wrapper: add documentation for recently introduced Z_SYNC_FLUSH

master
Tino Lange 2015-06-09 21:07:48 +02:00
rodzic a75010e2cc
commit 0d64e15c82
2 zmienionych plików z 18 dodań i 10 usunięć

Wyświetl plik

@ -47,7 +47,9 @@ var Z_DEFLATED = 8;
*
* Compressed result, generated by default [[Deflate#onData]]
* and [[Deflate#onEnd]] handlers. Filled after you push last chunk
* (call [[Deflate#push]] with `Z_FINISH` / `true` param).
* (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you
* push a chunk with explicit flush (call [[Deflate#push]] with
* `Z_SYNC_FLUSH` param).
**/
/**
@ -171,8 +173,9 @@ var Deflate = function(options) {
*
* Sends input data to deflate pipe, generating [[Deflate#onData]] calls with
* new compressed chunks. Returns `true` on success. The last data block must have
* mode Z_FINISH (or `true`). That flush internal pending buffers and call
* [[Deflate#onEnd]].
* mode Z_FINISH (or `true`). That will flush internal pending buffers and call
* [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you
* can use mode Z_SYNC_FLUSH, keeping the compression context.
*
* On fail call [[Deflate#onEnd]] with error code and return false.
*
@ -272,8 +275,9 @@ Deflate.prototype.onData = function(chunk) {
* - status (Number): deflate status. 0 (Z_OK) on success,
* other if not.
*
* Called once after you tell deflate that input stream complete
* or error happenned. By default - join collected chunks,
* Called once after you tell deflate that the input stream is
* complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
* or if an error happened. By default - join collected chunks,
* free memory and fill `results` / `err` properties.
**/
Deflate.prototype.onEnd = function(status) {

Wyświetl plik

@ -30,7 +30,9 @@ var toString = Object.prototype.toString;
*
* Uncompressed result, generated by default [[Inflate#onData]]
* and [[Inflate#onEnd]] handlers. Filled after you push last chunk
* (call [[Inflate#push]] with `Z_FINISH` / `true` param).
* (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you
* push a chunk with explicit flush (call [[Inflate#push]] with
* `Z_SYNC_FLUSH` param).
**/
/**
@ -150,8 +152,9 @@ var Inflate = function(options) {
*
* Sends input data to inflate pipe, generating [[Inflate#onData]] calls with
* new output chunks. Returns `true` on success. The last data block must have
* mode Z_FINISH (or `true`). That flush internal pending buffers and call
* [[Inflate#onEnd]].
* mode Z_FINISH (or `true`). That will flush internal pending buffers and call
* [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you
* can use mode Z_SYNC_FLUSH, keeping the decompression context.
*
* On fail call [[Inflate#onEnd]] with error code and return false.
*
@ -272,8 +275,9 @@ Inflate.prototype.onData = function(chunk) {
* - status (Number): inflate status. 0 (Z_OK) on success,
* other if not.
*
* Called once after you tell inflate that input stream complete
* or error happenned. By default - join collected chunks,
* Called either after you tell inflate that the input stream is
* complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
* or if an error happened. By default - join collected chunks,
* free memory and fill `results` / `err` properties.
**/
Inflate.prototype.onEnd = function(status) {