Sha256: 95a1b9dd5aa619be5a8db5de277384c23959a25340cca7e141a8c03980072e1d

Contents?: true

Size: 658 Bytes

Versions: 2

Compression:

Stored size: 658 Bytes

Contents

# encoding: utf-8

module LogStash
  module Outputs
    class OSS
      class GzipFile
        extend Forwardable

        def_delegators :@gzip_writer, :write, :close
        attr_reader :file, :gzip_writer

        def initialize(file)
          @file = file
          @gzip_writer = Zlib::GzipWriter.new(file)
        end

        def path
          @gzip_writer.to_io.path
        end

        def size
          if @gzip_writer.pos == 0
            0
          else
            @gzip_writer.flush
            @gzip_writer.to_io.size
          end
        end

        def fsync
          @gzip_writer.to_io.fsync
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
logstash-output-oss-0.1.2-java lib/logstash/outputs/oss/gzip_file.rb
logstash-output-oss-0.1.1-java lib/logstash/outputs/oss/gzip_file.rb