mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 18:25:13 +08:00
zipEntry.rawContent was a getter that exposed the retained buffer of an in-memory entry and returned null for a file-backed or streaming one, so the still-compressed bytes of a member read through ZipFile could not be obtained at all. Replace it with rawContent(), rawContentSync() and rawContentIterator(), which mirror content(), contentSync() and contentIterator() but return the bytes as stored, without decompressing or verifying them. They work for every entry that has readable content, return caller-owned buffers from the buffered variants, and accept a maxSize bound on the compressed size. Signed-off-by: Philipp Dunkel <pip@pipobscure.com> PR-URL: https://github.com/nodejs/node/pull/66801 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>