Parent

Methods

Yajl::Bzip2::StreamReader

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)

Public Class Methods

parse(input, options={}, buffer_size=nil, &block) click to toggle source

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 22
22:       def self.parse(input, options={}, buffer_size=nil, &block)
23:         if input.is_a?(String)
24:           input = StringIO.new(input)
25:         end
26: 
27:         Yajl::Parser.new(options).parse(new(input), buffer_size, &block)
28:       end

Public Instance Methods

read(len=nil, buffer=nil) click to toggle source

A helper method to allow use similar to IO#read

    # File lib/yajl/bzip2/stream_reader.rb, line 7
 7:       def read(len=nil, buffer=nil)
 8:         if val = super(len)
 9:           unless buffer.nil?
10:             buffer.replace(val)
11:             return buffer
12:           end
13:           super(len)
14:         else
15:           nil
16:         end
17:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.