class HTTPX::Plugins::Brotli::Inflater

  1. lib/httpx/plugins/brotli.rb
Superclass: Object

Methods

Public Class

  1. new

Public Instance

  1. call

Public Class methods

new(bytesize)
[show source]
   # File lib/httpx/plugins/brotli.rb
22 def initialize(bytesize)
23   @inflater = ::Brotli::Decompressor.new
24   @bytesize = bytesize
25 end

Public Instance methods

call(chunk)
[show source]
   # File lib/httpx/plugins/brotli.rb
27 def call(chunk)
28   buffer = @inflater.process(chunk)
29   @bytesize -= chunk.bytesize
30   raise Error, "Unexpected end of compressed stream" if @bytesize <= 0 && !@inflater.finished?
31 
32   buffer
33 end