Skip to content

Conversation

@twiss
Copy link
Member

@twiss twiss commented Aug 26, 2025

To allow streaming decompression of bzip2 data.

data = await streamReadToEnd(data);
}
data = toStream(data);
return data.pipeThrough(new Unbzip2Stream());
Copy link
Collaborator

@larabr larabr Aug 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more of a comment on the stream tools API, but I think the interaction between the helpers is confusing; I think we should have ArrayStream support pipeThrough; or alternatively add a (required) arg to toStream like convertArrayStream so that it takes care of it internally.

In any case the toStream function docs need updating, since it's advertise to always return a ReadableStream

Copy link
Member Author

@twiss twiss Aug 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to use ArrayStreams here because in that case all of the data gets decompressed regardless of what happens after it, since ArrayStreams don't have backpressure support. Since we want to limit the output size of the stream afterwards (in a future PR), we want to use a real stream here.

You're right that the docs need updating, though.

@twiss twiss force-pushed the unbzip2-stream branch 2 times, most recently from 2093378 to 6da27bd Compare September 1, 2025 16:31
@twiss twiss force-pushed the unbzip2-stream branch 2 times, most recently from 009f50d to dfb68d9 Compare November 14, 2025 13:51
@twiss twiss marked this pull request as ready for review November 14, 2025 13:52
To allow streaming decompression of bzip2 data.
larabr
larabr previously approved these changes Nov 17, 2025
@larabr larabr self-requested a review November 17, 2025 11:04
@larabr larabr dismissed their stale review November 17, 2025 11:04

Need to update dependencies

@larabr larabr merged commit 1af590a into openpgpjs:main Nov 17, 2025
25 of 26 checks passed
@twiss twiss deleted the unbzip2-stream branch November 18, 2025 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants