Skip to content

Z_SYNC_FLUSH support #222

Open
Open
@BenoitZugmeyer

Description

@BenoitZugmeyer

What can't you do right now?

I have this use case. I'd like to concatenate deflate streams, so I need to use Z_SYNC_FLUSH before finishing the stream to have deterministic trailing bytes. Without this, I would have to inflate the stream to know where it finishes.

An optimal solution

When invoking .push(...), add a parameter to ask for a sync flush, ex:

stream.push(data, SYNC_FLUSH)

How is this done by other libraries?

Pako allows to pass an arbitrary flush mode to push: https://github.com/nodeca/pako/blob/62cb729e7813176ce2d2694b89c8724680fca383/lib/deflate.js#L178-L200

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions