lib/multipart/post/composite_read_io.rb
# Read from IOs in order until `length` bytes have been received.
Read from IOs in order until `length` bytes have been received.
Read from IOs in order until ` length ` bytes have been received .
def read(length = nil, outbuf = nil)
        got_result = false
        outbuf = outbuf ? outbuf.replace("") : String.new
        while io = current_io
          if result = io.read(length)
            got_result ||= !result.nil?
            result.force_encoding("BINARY") if result.respond_to?(:force_encoding)
            outbuf << result
            length -= result.length if length
            break if length == 0
          end
          advance_io
        end
        (!got_result && length) ? nil : outbuf
      end
def read ( length = nil , outbuf = nil ) got_result = false outbuf = outbuf ? outbuf . replace ( "" ) : String . new while io = current_io if result = io . read ( length ) got_result ||= ! result . nil? result . force_encoding ( "BINARY" ) if result . respond_to? ( :force_encoding ) outbuf << result length -= result . length if length break if length == 0 end advance_io end ( ! got_result && length ) ? nil : outbuf end
Read from IOs in order until `length` bytes have been received.
Read from IOs in order until ` length ` bytes have been received .
length
<not_specific>
outbuf
<not_specific>