Sha256: 31c06ecd6356c97b799d76e617099662908b1943298991900e277961f136801d

Contents?: true

Size: 533 Bytes

Versions: 5

Compression:

Stored size: 533 Bytes

Contents

# encoding: UTF-8
module Yajl
  module Bzip2
    # === Yajl::Bzip2::StreamReader
    #
    # This is a wrapper around Bzip::Reader to allow it's #read method to adhere
    # to the IO spec, allowing for two parameters (length, and buffer)
    class StreamReader < ::Bzip2::Reader
      def read(len=nil, buffer=nil)
        unless buffer.nil?
          buffer.replace super(len)
          return buffer
        end
        super(len)
      end

      def self.parse(io)
        Yajl::Stream.parse(new(io))
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
brianmario-yajl-ruby-0.4.4 lib/yajl/bzip2/stream_reader.rb
brianmario-yajl-ruby-0.4.5 lib/yajl/bzip2/stream_reader.rb
brianmario-yajl-ruby-0.4.6 lib/yajl/bzip2/stream_reader.rb
brianmario-yajl-ruby-0.4.7 lib/yajl/bzip2/stream_reader.rb
brianmario-yajl-ruby-0.4.8 lib/yajl/bzip2/stream_reader.rb