Skip to content

zlib.inflateRawSync how do I get the number of bytes read? #8874

Closed
@smyt1

Description

@smyt1
  • Version: v6.7.0 (applies to previous versions as well)
  • Platform:Darwin [hostname] 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64
  • Subsystem: zlib

zlib.inflateRawSync returns the decompressed data. AFAICT it does not indicate how many bytes were read from the input buffer. Is there a way to find that?

Use case: some ZIP writers use the "data descriptor" feature of the pkzip file format. The CRC-32 checksum of the uncompressed data and the lengths actually appear directly after the deflated data, so you need to know the number of bytes that the deflator read in order to jump ahead to those fields. FWIW zip libraries leveraging zlib, like yauzl, do not bother with the checksum.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.zlibIssues and PRs related to the zlib subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions