Sha256: e456337fd7afa68e69ec311324f34496adb21d9b591ca657207df9c552d9a4a7

Contents?: true

Size: 457 Bytes

Versions: 12

Compression:

Stored size: 457 Bytes

Contents

module IOStreams
  module Bzip2
    class Writer < IOStreams::Writer
      # Write to a stream, compressing with Bzip2
      def self.stream(input_stream, original_file_name: nil, **args)
        Utils.load_soft_dependency("bzip2-ffi", "Bzip2", "bzip2/ffi") unless defined?(::Bzip2::FFI)

        begin
          io = ::Bzip2::FFI::Writer.new(input_stream, args)
          yield io
        ensure
          io&.close
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
iostreams-1.10.3 lib/io_streams/bzip2/writer.rb
iostreams-1.10.2 lib/io_streams/bzip2/writer.rb
iostreams-1.10.1 lib/io_streams/bzip2/writer.rb
iostreams-1.10.0 lib/io_streams/bzip2/writer.rb
iostreams-1.9.0 lib/io_streams/bzip2/writer.rb
iostreams-1.8.0 lib/io_streams/bzip2/writer.rb
iostreams-1.7.0 lib/io_streams/bzip2/writer.rb
iostreams-1.6.2 lib/io_streams/bzip2/writer.rb
iostreams-1.6.1 lib/io_streams/bzip2/writer.rb
iostreams-1.6.0 lib/io_streams/bzip2/writer.rb
iostreams-1.5.1 lib/io_streams/bzip2/writer.rb
iostreams-1.5.0 lib/io_streams/bzip2/writer.rb