Sha256: b55626be79eaeaf75c7cad5f1ed64e176f26fc2a436ae063b21f6bb7c28db4df

Contents?: true

Size: 444 Bytes

Versions: 7

Compression:

Stored size: 444 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("rbzip2", "Bzip2") unless defined?(RBzip2)

        begin
          io = RBzip2.default_adapter::Compressor.new(input_stream)
          yield io
        ensure
          io&.close
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
iostreams-1.3.3 lib/io_streams/bzip2/writer.rb
iostreams-1.3.2 lib/io_streams/bzip2/writer.rb
iostreams-1.3.1 lib/io_streams/bzip2/writer.rb
iostreams-1.3.0 lib/io_streams/bzip2/writer.rb
iostreams-1.2.1 lib/io_streams/bzip2/writer.rb
iostreams-1.2.0 lib/io_streams/bzip2/writer.rb
iostreams-1.1.1 lib/io_streams/bzip2/writer.rb