Methods
Public Class methods
new()
# File lib/zliby.rb, line 54
        def initialize
                @input_buffer = []
                @output_buffer = []
                @out_pos = -1
                @in_pos = -1
                @bit_bucket = 0
                @bit_count = 0

        end
Public Instance methods
adler()

Returns the adler-32 checksum of the input data.

# File lib/zliby.rb, line 64
        def adler
        end
avail_in()

Returns the number of bytes read. Normally 0 since all bytes are read at once.

# File lib/zliby.rb, line 68
        def avail_in
                @input_buffer.length - @in_pos
        end
avail_out()

Returns number of free bytes in the output buffer. As the output buffer is self expanding this normally returns 0.

# File lib/zliby.rb, line 73
        def avail_out
                @output_buffer.length - @out_pos
        end
avail_out=(size)

Allocates size bytes in output buffer. If size < avail_out it truncates the buffer.

# File lib/zliby.rb, line 78
        def avail_out= size
                size.times do 
                        if size > avail_out
                                @output_buffer.push nil
                        else
                                @output_buffer.pop
                        end
                end
        end
close()

Closes stream. Further operations will raise Zlib::StreamError

# File lib/zliby.rb, line 89
        def close
                @closed = true
        end
closed?()

True if stream closed, otherwise False.

# File lib/zliby.rb, line 94
        def closed?
                @closed
        end
data_type()

Best guess of input data, one of Zlib::BINARY, Zlib::ASCII, or Zlib::UNKNOWN

# File lib/zliby.rb, line 99
        def data_type
        end
end()

See close

# File lib/zliby.rb, line 103
        def end
                close
        end
ended?()

See closed?

# File lib/zliby.rb, line 108
        def ended?
                closed?
        end
finish()

Finishes the stream, flushes output buffer, implemented by child classes

# File lib/zliby.rb, line 113
        def finish
                close
        end
finished?()

True if stream is finished, otherwise False

# File lib/zliby.rb, line 118
        def finished?
                if @finished.nil? then
                        false
                else
                        @finished
                end
        end
flush_next_in()

Flushes input buffer and returns the data therein.

# File lib/zliby.rb, line 127
        def flush_next_in
                @in_pos = @input_buffer.length
                @finished = true
                ret = @input_buffer.pack("c*")
                @input_buffer = []
                ret
        end
flush_next_out()

Flushes the output buffer and returns all the data

# File lib/zliby.rb, line 136
        def flush_next_out
                @out_pos = @output_buffer.length
                @finished = true
                ret = @output_buffer.pack("c*")
                @output_buffer = []
                ret
        end
reset()

Reset stream. Input and Output buffers are reset.

# File lib/zliby.rb, line 145
        def reset
                @out_pos = -1
                @in_pos = -1
                @input_buffer = []
                @output_buffer = []
        end
stream_end?()

See finished.

# File lib/zliby.rb, line 153
        def stream_end?
                finished?
        end
total_in()

Size of input buffer.

# File lib/zliby.rb, line 158
        def total_in
                @input_buffer.length
        end
total_out()

Size of output buffer.

# File lib/zliby.rb, line 163
        def total_out
                @output_buffer.length
        end