The "zlib" compression algorithm.
Methods
Public Class methods
Creates a new ZLibCompressor instance using the default configuration options.
[ show 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.
[ show 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.
[ show 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