diff --git a/lib/client.rb b/lib/client.rb index 7481319..cfa1f01 100644 --- a/lib/client.rb +++ b/lib/client.rb @@ -41,8 +41,12 @@ def initialize(data, chunk_size) @file = data end - def read(foo) - @file.read(@size) + def read(foo, out = nil) + if out && out.respond_to?("write") + @file.read(@size, out) + else + @file.read(@size) + end end def eof!