Class Net::SSH::Transport::Compress::ZLibCompressor
In: lib/net/ssh/transport/compress/zlib-compressor.rb
Parent: Compressor

The "zlib" compression algorithm.

Methods

compress   configure   new  

Public Class methods

Creates a new ZLibCompressor instance using the default configuration options.

[Source]

    # File lib/net/ssh/transport/compress/zlib-compressor.rb, line 31
31:           def initialize
32:             init_deflater( Zlib::DEFAULT_COMPRESSION )
33:           end

Public Instance methods

Deflates the text using the Zlib deflate interface.

[Source]

    # File lib/net/ssh/transport/compress/zlib-compressor.rb, line 43
43:           def compress( text )
44:             @deflater.deflate( text, Zlib::SYNC_FLUSH )
45:           end

Reconfigures this instance with the given Hash of options. The only supported option is :level, which must be one of the Zlib constants.

[Source]

    # File lib/net/ssh/transport/compress/zlib-compressor.rb, line 38
38:           def configure( options )
39:             init_deflater( options[:level] ) if options.has_key?(:level)
40:           end

[Validate]