123456789_123456789_123456789_123456789_123456789_

Class: Net::HTTPGenericRequest::Chunker

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: lib/net/http/generic_request.rb

Class Method Summary

Instance Method Summary

Constructor Details

.new(sock) ⇒ Chunker

[ GitHub ]

  
# File 'lib/net/http/generic_request.rb', line 243

def initialize(sock)
  @sock = sock
  @prev = nil
end

Instance Method Details

#finish

[ GitHub ]

  
# File 'lib/net/http/generic_request.rb', line 255

def finish
  @sock.write("0\r\n\r\n")
end

#write(buf)

[ GitHub ]

  
# File 'lib/net/http/generic_request.rb', line 248

def write(buf)
  # avoid memcpy() of buf, buf can huge and eat memory bandwidth
  rv = buf.bytesize
  @sock.write("#{rv.to_s(16)}\r\n", buf, "\r\n")
  rv
end