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
46 def initialize(bytesize)
47   @inflater = Zlib::Inflate.new(Zlib::MAX_WBITS + 32)
48   @bytesize = bytesize
49 end

Public Instance methods

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