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 167

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

Instance Method Details

#finish

[ GitHub ]

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

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

#write(buf)

[ GitHub ]

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

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