Sha256: 090de6498723a5e89d928798c249dd4fa8fd3050bc03de793c7ac5edea709860

Contents?: true

Size: 446 Bytes

Versions: 7

Compression:

Stored size: 446 Bytes

Contents

module IOStreams
  module Bzip2
    class Reader < IOStreams::Reader
      # Read from a Bzip2 stream, decompressing the contents as it is read
      def self.stream(input_stream, **_args)
        Utils.load_soft_dependency('rbzip2', 'Bzip2') unless defined?(RBzip2)

        begin
          io = RBzip2.default_adapter::Decompressor.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.1.0 lib/io_streams/bzip2/reader.rb
iostreams-1.0.0 lib/io_streams/bzip2/reader.rb
iostreams-1.0.0.beta7 lib/io_streams/bzip2/reader.rb
iostreams-1.0.0.beta6 lib/io_streams/bzip2/reader.rb
iostreams-1.0.0.beta5 lib/io_streams/bzip2/reader.rb
iostreams-1.0.0.beta4 lib/io_streams/bzip2/reader.rb
iostreams-1.0.0.beta3 lib/io_streams/bzip2/reader.rb