Closed LinusKardellInfobric closed 5 months ago
inputBufferSize = bufferSize > 0 ? bufferSize : (int) Methods.ZSTD_CStreamInSize().EnsureZstdSuccess();
Looks like it should be ZSTD_DStreamInSize
instead of ZSTD_CStreamInSize
Some tests have failed, such as RoundTrip_BatchToStreaming
Looks like it should be
ZSTD_DStreamInSize
instead ofZSTD_CStreamInSize
Unrelated to this change, but OK, I changed that.
Some tests have failed, such as
RoundTrip_BatchToStreaming
Turns out when we're completely done with a frame, calling DecompressStream again with no input will return 9 (the minimum possible ZSTD frame size) rather than 0. I've changed it to only keep the result of DecompressStream calls that made some progress.
@LinusKardellInfobric Thanks!
Previously, Read and ReadAsync would only return once the output buffer had been filled, or the inner stream returned 0 (i.e. when the inner stream ended). That meant it would not return already decoded data until it got more data from the inner stream, even if no more data was currently available. Now, instead:
This does have the drawback that each call to Read will only call innerStream.Read at most once, so the amount of data the caller can get from a single Read call is limited by inputBufferSize.
Fixes #32