method
buffer_filling
v1_8_6_287 -
Show latest stable
-
0 notes -
Class: Net::InternetMessageIO
- 1_8_6_287 (0)
- 1_8_7_72 (0)
- 1_8_7_330 (0)
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
buffer_filling(buf, src)
private
Hide source
# File lib/net/protocol.rb, line 306 def buffer_filling(buf, src) case src when String # for speeding up. 0.step(src.size - 1, 1024) do |i| buf << src[i, 1024] yield end when File # for speeding up. while s = src.read(1024) buf << s yield end else # generic reader src.each do |s| buf << s yield if buf.size > 1024 end yield unless buf.empty? end end