fiksu/s3io — pull request #2 by klausbadelt (2014-06-03 23:02:12+00:00)
Title: adding optional outbuf parameter to #read

Ruby's IO class requires a 2nd, optional parameter _outbuf_ on #read:
```ruby
read([length [, outbuf]]) # → string, outbuf, or nil
```
From [the docs](http://www.ruby-doc.org/core-2.1.2/IO.html#method-i-read):
> If the optional outbuf argument is present, it must reference a String, which will receive the data. The outbuf will contain only the received data after the method call even if it is not empty at the beginning.

This pull request will make code expecting this 2nd parameter work – for example AWS-SDK for Ruby:
```ruby
out_obj = in_s3.buckets['out-bucket'].objects['out-key']
in_obj = out_s3..buckets['in-bucket'].objects['in-key']

in_io = S3io.open(in_obj, 'r')
out_obj.write(in_io)
```
Before this patch, the above would crash with
```
# Before applying this commit
Uncaught exception: wrong number of arguments (2 for 0..1)
/Users/audiolib/src/s3io/lib/s3io/read_wrapper.rb:28:in `read'
```
Hope you find this useful!