In general, I am against non-streaming APIs and want to
encourage processing data in predictable sizes to avoid
fragmentation and OOM.
There's already Zlib.deflate/inflate, which are memory based API.
And gzip also uses deflate/inflate.
Note that gzip has the length of original data at the end of data. (isize=origsize / (2^32))
Anyway IO.copy_stream like API sounds reasonable.
Current API needs to change interface to use keyword arguments to avoid using 2nd argument...