From 2ced07ccaf7682b9ec8fb3bcc3dc8d2bb2798c61 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Mon, 3 Apr 2017 18:15:13 -0700 Subject: zlib: support all ArrayBufferView types PR-URL: https://github.com/nodejs/node/pull/12223 Reviewed-By: Matteo Collina Reviewed-By: James M Snell Reviewed-By: Anna Henningsen --- doc/api/zlib.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 56 insertions(+), 13 deletions(-) (limited to 'doc/api/zlib.md') diff --git a/doc/api/zlib.md b/doc/api/zlib.md index 928070d577..a91456bb0b 100644 --- a/doc/api/zlib.md +++ b/doc/api/zlib.md @@ -300,7 +300,7 @@ ignored by the decompression classes. * `level` {integer} (compression only) * `memLevel` {integer} (compression only) * `strategy` {integer} (compression only) -* `dictionary` {Buffer|Uint8Array} (deflate/inflate only, empty dictionary by +* `dictionary` {Buffer|TypedArray|DataView} (deflate/inflate only, empty dictionary by default) See the description of `deflateInit2` and `inflateInit2` at @@ -477,9 +477,9 @@ Returns a new [Unzip][] object with an [options][]. -All of these take a [Buffer][], [Uint8Array][], or string as the first -argument, an optional second argument to supply options to the `zlib` classes -and will call the supplied callback with `callback(error, result)`. +All of these take a [`Buffer`][], [`TypedArray`][], [`DataView`][], or string as +the first argument, an optional second argument to supply options to the `zlib` +classes and will call the supplied callback with `callback(error, result)`. Every method has a `*Sync` counterpart, which accept the same arguments, but without a callback. @@ -488,6 +488,9 @@ without a callback. -- `buffer` {Buffer|Uint8Array|string} +- `buffer` {Buffer|TypedArray|DataView|string} Compress a chunk of data with [Deflate][]. @@ -509,6 +515,9 @@ Compress a chunk of data with [Deflate][]. -- `buffer` {Buffer|Uint8Array|string} +- `buffer` {Buffer|TypedArray|DataView|string} Compress a chunk of data with [DeflateRaw][]. @@ -530,6 +542,9 @@ Compress a chunk of data with [DeflateRaw][]. -- `buffer` {Buffer|Uint8Array|string} +- `buffer` {Buffer|TypedArray|DataView|string} Decompress a chunk of data with [Gunzip][]. @@ -551,6 +569,9 @@ Decompress a chunk of data with [Gunzip][]. -- `buffer` {Buffer|Uint8Array|string} +- `buffer` {Buffer|TypedArray|DataView|string} Compress a chunk of data with [Gzip][]. @@ -572,6 +596,9 @@ Compress a chunk of data with [Gzip][]. -- `buffer` {Buffer|Uint8Array|string} +- `buffer` {Buffer|TypedArray|DataView|string} Decompress a chunk of data with [Inflate][]. @@ -593,6 +623,9 @@ Decompress a chunk of data with [Inflate][]. -- `buffer` {Buffer|Uint8Array|string} +- `buffer` {Buffer|TypedArray|DataView|string} Decompress a chunk of data with [InflateRaw][]. @@ -614,6 +650,9 @@ Decompress a chunk of data with [InflateRaw][]. -- `buffer` {Buffer|Uint8Array|string} +- `buffer` {Buffer|TypedArray|DataView|string} Decompress a chunk of data with [Unzip][]. @@ -644,5 +686,6 @@ Decompress a chunk of data with [Unzip][]. [InflateRaw]: #zlib_class_zlib_inflateraw [Unzip]: #zlib_class_zlib_unzip [`.flush()`]: #zlib_zlib_flush_kind_callback -[Buffer]: buffer.html -[Uint8Array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array +[`Buffer`]: buffer.html#buffer_class_buffer +[`DataView`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView +[`TypedArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray -- cgit v1.2.3