class Yajl::Deflate::StreamWriter

A wrapper around the Zlib::Deflate class for easier JSON stream parsing

def self.encode(obj, io)

Look up Yajl::Encoder#encode for parameter documentation

A helper method for one-off encoding to a deflate-compressed stream
def self.encode(obj, io)
  Yajl::Encoder.new.encode(obj, new(io))
end

def write(str)

A helper method to allow use similar to IO#write
def write(str)
  deflate(str)
  str.size unless str.nil?
end