Sha256: 664ad0bb7d5f82b21cd7b281404583dae7c1edd5772452aa0f87f03f6ba90991
Contents?: true
Size: 671 Bytes
Versions: 9
Compression:
Stored size: 671 Bytes
Contents
module HTTP class Response class Streamer def initialize(str, encoding: Encoding::BINARY) @io = StringIO.new str @encoding = encoding end def readpartial(size = nil, outbuf = nil) unless size if defined?(HTTP::Client::BUFFER_SIZE) size = HTTP::Client::BUFFER_SIZE elsif defined?(HTTP::Connection::BUFFER_SIZE) size = HTTP::Connection::BUFFER_SIZE end end chunk = @io.read size, outbuf chunk.force_encoding(@encoding) if chunk end def close @io.close end def sequence_id -1 end end end end
Version data entries
9 entries across 9 versions & 2 rubygems