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
325
326
327
|
# File 'lib/fluent/plugin/in_s3.rb', line 325
def content_type
'application/x-gzip'.freeze
end
|
#ext ⇒ Object
321
322
323
|
# File 'lib/fluent/plugin/in_s3.rb', line 321
def ext
'gz'.freeze
end
|
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
|
# File 'lib/fluent/plugin/in_s3.rb', line 332
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
|