Unverified Commit 1ebe1c8b authored by ksss's avatar ksss

Support outbuf argument for IO#read

parent 3a73a584
......@@ -181,7 +181,7 @@ class IO
nil
end
def read(length = nil)
def read(length = nil, outbuf = "")
unless length.nil?
unless length.is_a? Fixnum
raise TypeError.new "can't convert #{length.class} into Integer"
......@@ -217,7 +217,12 @@ class IO
end
end
array && array.join
if array.nil?
outbuf.replace("")
nil
else
outbuf.replace(array.join)
end
end
def readline(arg = $/, limit = nil)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment