# File lib/paperclip/iostream.rb, line 16
  def stream_to object, path_or_file, in_blocks_of = 8192
    dstio = case path_or_file
            when String   then File.new(path_or_file, "wb+")
            when IO       then path_or_file
            when Tempfile then path_or_file
            end
    buffer = ""
    object.rewind
    while object.read(in_blocks_of, buffer) do
      dstio.write(buffer)
    end
    dstio.rewind
    dstio
  end