lib/oci/object_storage/transfer/multipart/internal/file_part_io_wrapper.rb
# The source file, identified by either a File/Tempfile object or a path to the file
# @return [String, File, Tempfile]
The source file, identified by either a File/Tempfile object or a path to the file
The source file identified by either a File / Tempfile object or a path to the file
def read_internal(bytes, output_buffer)
              if bytes
                data = @file_handle.read([remaining_bytes, bytes].min)
                data = nil if data == ''
              end
              data = @file_handle.read(remaining_bytes) unless bytes
              @position += data.bytesize if data
               "If the optional outbuf argument is present, it must reference a String, which will receive the data.
               The outbuf will contain only the received data after the method call even if it is not empty at the
               beginning."
               So we use String's replace() method to sub in the data we read, or an empty string if there was
               no data read
              if output_buffer
                output_buffer.replace(data || '')
              else
                data
              end
            end
def read_internal ( bytes , output_buffer ) if bytes data = @file_handle . read ( [ remaining_bytes , bytes ] . min ) data = nil if data == '' end data = @file_handle . read ( remaining_bytes ) unless bytes @position += data . bytesize if data if output_buffer output_buffer . replace ( data || '' ) else data end end
The source file, identified by either a File/Tempfile object or a path to the file
The source file identified by either a File / Tempfile object or a path to the file
# From IO docs (https://ruby-doc.org/core-2.3.1/IO.html#method-i-read): # # "If the optional outbuf argument is present, it must reference a String, which will receive the data. # The outbuf will contain only the received data after the method call even if it is not empty at the # beginning." # # So we use String's replace() method to sub in the data we read, or an empty string if there was # no data read
None
String, File, Tempfile
bytes
output_buffer