Sha256: c3def0d1a9ec49ed95cd7eaf66e08f540889dceab3a058ee652bced9bbae4e85
Contents?: true
Size: 683 Bytes
Versions: 5
Compression:
Stored size: 683 Bytes
Contents
# encoding: UTF-8 module Yajl module Deflate # === Yajl::Deflate::StreamReader # # This is a wrapper around Zlib::Inflate, creating a #read method that adheres # to the IO spec, allowing for two parameters (length, and buffer) class StreamReader < ::Zlib::Inflate def initialize(io, options) @io = io super(options) end def read(len=nil, buffer=nil) buffer.replace inflate(@io.read(len)) and return unless buffer.nil? inflate(@io.read(len)) end alias :eof? :finished? def self.parse(io, options=nil) Yajl::Stream.parse(new(io, options)) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems