Sha256: b1d0d930a38e84bdb7e9d56f3b13ae700b2fc2f168a8462f026093da317706df

Contents?: true

Size: 457 Bytes

Versions: 12

Compression:

Stored size: 457 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("bzip2-ffi", "Bzip2", "bzip2/ffi") unless defined?(::Bzip2::FFI)

        begin
          io = ::Bzip2::FFI::Reader.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/reader.rb
iostreams-1.10.2 lib/io_streams/bzip2/reader.rb
iostreams-1.10.1 lib/io_streams/bzip2/reader.rb
iostreams-1.10.0 lib/io_streams/bzip2/reader.rb
iostreams-1.9.0 lib/io_streams/bzip2/reader.rb
iostreams-1.8.0 lib/io_streams/bzip2/reader.rb
iostreams-1.7.0 lib/io_streams/bzip2/reader.rb
iostreams-1.6.2 lib/io_streams/bzip2/reader.rb
iostreams-1.6.1 lib/io_streams/bzip2/reader.rb
iostreams-1.6.0 lib/io_streams/bzip2/reader.rb
iostreams-1.5.1 lib/io_streams/bzip2/reader.rb
iostreams-1.5.0 lib/io_streams/bzip2/reader.rb