Flowdock
method

buffer_filling

Importance_0
buffer_filling(buf, src) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/net/protocol.rb, line 421
    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 |str|
          buf << str
          yield if buf.size > 1024
        end
        yield unless buf.empty?
      end
    end
Register or log in to add new notes.