# Code review: Implements Zlib::GzipWriter using System.IO.Compression.GZipStream

**URL:** <https://www.ruby-forum.com/t/code-review-implements-zlib-gzipwriter-using-system-io-compression-gzipstream/162410>\
**Category:** IronRuby\
**Created:** [March 9, 2009, 6:02pm UTC](https://www.ruby-forum.com/t/code-review-implements-zlib-gzipwriter-using-system-io-compression-gzipstream/162410 "2009-03-09T18:02:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shri\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Post date:** [March 9, 2009, 6:02pm UTC](https://www.ruby-forum.com/t/code-review-implements-zlib-gzipwriter-using-system-io-compression-gzipstream/162410/1 "2009-03-09T18:02:14Z")

</div>

> <https://github.com/shri-zz/ironruby/commit/7ca740304457ce90320e80379cc49d3551fc6147>
>
> \- GzipWriter.new ignores the level and strategy arguments for now.
> \- The argumen…ts are not marked with DefaultProtocol as it does not look like you can pass an arbitrary object responding to to\_s
> \- Most of the work was for the Ruby library API. We can change the details of the compression later if we want to.
> Removed Zlib::GZipReader.Create overloads which took RubyIO since they would not handle the case of File being monkey-patched. This also allowed some code to be factored out into the base GZipFile class.
> Implemented Zlib::GzipFile.wrap and added tests for it
> Changed App.config to only include valid paths to the Ruby libs that are included in GIT

Implements Zlib::GzipWriter using System.IO.Compression.GZipStream.

- GzipWriter.new ignores the level and strategy arguments for now.
- The arguments are not marked with DefaultProtocol as it does not look  
like you can pass an arbitrary object responding to to\_s
- Most of the work was for the Ruby library API. We can change the  
details  
of the compression later if we want to.  
Removed Zlib::GZipReader.Create overloads which took RubyIO since they  
would not handle the case of File being monkey-patched. This also  
allowed  
some code to be factored out into the base GZipFile class.  
Implemented Zlib::GzipFile.wrap and added tests for it  
Changed App.config to only include valid paths to the Ruby libs that are  
included in GIT

Thanks,  
Shri
