This is a wrapper around Bzip::Reader to allow it’s # method to adhere to the IO spec, allowing for two parameters (length, and buffer)
Helper method for one-off parsing from a bzip2-compressed stream
See Yajl::Parser#parse for parameter documentation
# File lib/yajl/bzip2/stream_reader.rb, line 23
23: def self.parse(input, options={}, buffer_size=nil, &block)
24: if input.is_a?(String)
25: input = StringIO.new(input)
26: end
27:
28: Yajl::Parser.new(options).parse(new(input), buffer_size, &block)
29: end
A helper method to allow use similar to IO#read
# File lib/yajl/bzip2/stream_reader.rb, line 8
8: def read(len=nil, buffer=nil)
9: if val = super(len)
10: unless buffer.nil?
11: buffer.replace(val)
12: return buffer
13: end
14: super(len)
15: else
16: nil
17: end
18: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.