Skip to content

Implement BufRead/Write for en/decoders alongside Read/Write #385

Discussion options

You must be logged in to vote

Having spent more time on looking into the code, I've found out, that only unprocessed bytes from underlying stream are buffed. Output proccessed bytes are decoded on demand in quantities requested (size of output buffer) at most. Thus, wrapping inflate structs in BufRead doesn't do any processed bytes unneccessary copies, if used with minimal common sense (that being e.g. not using buffering, if the end use-case is calling read_to_end).

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@chernoivanenkoofficial
Comment options

@chernoivanenkoofficial
Comment options

Answer selected by chernoivanenkoofficial
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #384 on November 25, 2023 21:34.