Class: Fluent::Plugin::S3Input::GzipExtractor
Instance Attribute Summary
Attributes inherited from Extractor
#log
Instance Method Summary
collapse
Methods inherited from Extractor
#configure, #initialize
Instance Method Details
#content_type ⇒ Object
358
359
360
|
# File 'lib/fluent/plugin/in_s3.rb', line 358
def content_type
'application/x-gzip'.freeze
end
|
#ext ⇒ Object
354
355
356
|
# File 'lib/fluent/plugin/in_s3.rb', line 354
def ext
'gz'.freeze
end
|
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
|
# File 'lib/fluent/plugin/in_s3.rb', line 365
def (io)
parts = []
loop do
unused = nil
Zlib::GzipReader.wrap(io) do |gz|
parts << gz.read
unused = gz.unused
gz.finish
end
io.pos -= unused ? unused.length : 0
break if io.eof?
end
io.close
parts.join
end
|