--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: "Requests that <tt>length</tt> bytes, starting at <tt>offset</tt> bytes from the beginning of the file, be read from the file identified by <tt>handle</tt>. (The <tt>handle</tt> should be a value obtained via the #open method.) Returns immediately with a Request object. If a block is given, it will be invoked when the server responds."
- !ruby/struct:SM::Flow::P 
  body: The :data property of the response will contain the requested data, assuming the call was successful.
- !ruby/struct:SM::Flow::VERB 
  body: "  request = sftp.read(handle, 0, 1024) do |response|\n    if response.eof?\n      puts &quot;end of file reached before reading any data&quot;\n    elsif !response.ok?\n      puts &quot;error (#{response})&quot;\n    else\n      print(response[:data])\n    end\n  end\n  request.wait\n"
- !ruby/struct:SM::Flow::P 
  body: "To read an entire file will usually require multiple calls to #read, unless you know in advance how large the file is."
full_name: Net::SFTP::Session#read
is_singleton: false
name: read
params: |
  read(handle, offset, length) -> request
  read(handle, offset, length) { |response| ... } -> request

visibility: public
