TranscodingStreams.jl
TranscodingStreams.jl copied to clipboard
Avoid double counting in `stats` `out` when writing to nested streams
Here is an example of the bug this PR fixes:
using Test
using TranscodingStreams
stream = NoopStream(NoopStream(IOBuffer()))
write(stream, b"foobar")
flush(stream)
@test TranscodingStreams.stats(stream).out == 6
Before this PR this would output 12 even though only 6 bytes were written to the underlying stream.