Method: Net::HTTPResponse::Inflater#read

Defined in:
lib/net/http/response.rb

#read(clen, dest, ignore_eof = false) ⇒ Object

Reads clen bytes from the socket, inflates them, then writes them to dest. ignore_eof is passed down to Net::BufferedIO#read

Unlike Net::BufferedIO#read, this method returns more than clen bytes. At this time there is no way for a user of Net::HTTPResponse to read a specific number of bytes from the HTTP response body, so this internal API does not return the same number of bytes as were requested.

See bugs.ruby-lang.org/issues/6492 for further discussion.



399
400
401
402
403
# File 'lib/net/http/response.rb', line 399

def read clen, dest, ignore_eof = false
  temp_dest = inflate_adapter(dest)

  @socket.read clen, temp_dest, ignore_eof
end