Class: Yajl::Deflate::StreamWriter

### Home Classes Methods

### In Files

- lib/yajl/deflate/stream_writer.rb

### Parent

Zlib::Deflate

### Methods

- ::encode
- #write

### Class/Module Index

Quicksearch

- Yajl
- Yajl::Bzip2
- Yajl::Bzip2::StreamReader
- Yajl::Bzip2::StreamWriter
- Yajl::Deflate
- Yajl::Deflate::StreamReader
- Yajl::Deflate::StreamWriter
- Yajl::Encoder
- Yajl::Gzip
- Yajl::Gzip::StreamReader
- Yajl::Gzip::StreamWriter
- Yajl::HttpStream
- Yajl::HttpStream::HttpError
- Yajl::HttpStream::InvalidContentType
- Yajl::Parser
- JSON
- JSON::GeneratorError
- JSON::JSONError
- JSON::ParserError
- Kernel
- Object

No matching classes.

# Yajl::Deflate::StreamWriter

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

### Public Class Methods

encode(obj, io) click to toggle source

A helper method for one-off encoding to a deflate-compressed stream

Look up Yajl::Encoder#encode for parameter documentation

    # File lib/yajl/deflate/stream_writer.rb, line 15
    def self.encode(obj, io)
      Yajl::Encoder.new.encode(obj, new(io))
    end

### Public Instance Methods

write(str) click to toggle source

A helper method to allow use similar to IO#write

    # File lib/yajl/deflate/stream_writer.rb, line 7
    def write(str)
      deflate(str)
      str.size unless str.nil?
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.