class HTTPX::Transcoder::GZIP::Inflater

  1. lib/httpx/transcoder/gzip.rb
Superclass: Object

Methods

Public Class

  1. new

Public Instance

  1. call

Public Class methods

new(bytesize)
[show source]
   # File lib/httpx/transcoder/gzip.rb
48 def initialize(bytesize)
49   @inflater = Zlib::Inflate.new(Zlib::MAX_WBITS + 32)
50   @bytesize = bytesize
51 end

Public Instance methods

call(chunk)
[show source]
   # File lib/httpx/transcoder/gzip.rb
53 def call(chunk)
54   buffer = @inflater.inflate(chunk)
55   @bytesize -= chunk.bytesize
56   if @bytesize <= 0
57     buffer << @inflater.finish
58     @inflater.close
59   end
60   buffer
61 end