Net::SSH::Perl::Comp - Compression/Decompression base class
my $comp = Net::SSH::Perl::Comp->new( $comp_type );
is a base class for compression/decompression
classes. Currently the only such class is the Zlib implementation (using
), which is the class Net::SSH::Perl::Comp::Zlib
Each compression object generally has its own internal "state"; this
state changes when you compress or decompress data. The SSH protocol dictates
that you must have two separate
objects to compress and decompress
data: one for compression, one for decompression. So, for example, you would
create two Net::SSH::Perl::Comp
my $in = Net::SSH::Perl::Comp->new('Zlib');
my $inflated = $in->decompress($data);
my $out = Net::SSH::Perl::Comp->new('Zlib');
my $deflated = $out->compress($data);
Constructs a new compression object of compression type
and returns that object.
are provided, the class's init
called with those arguments, for any post-creation initialization.
and sets the compression level to
. This method will be called automatically from
if you've provided @args
for example, you could write:
my $comp = Net::SSH::Perl::Comp->new('Zlib', 5);
To create a new Zlib
compression object and initialize its compression
level to 5.
using the underlying compression
mechanism; returns the compressed data.
using the underlying decompression
mechanism; returns the decompressed data.
"Enables" the compression object. This is useful in the context of the
key exchange ( Kex
) classes, which create a new compression object
during key negotiation, but don't actually turn it on ("enable" it)
until receiving/sending the SSH2_MSG_NEWKEYS
objects (and subclasses) are disabled by default.
Returns the state of the "enabled" flag, ie. whether the compression
object is "turned on".
This is used by Net::SSH::Perl::Packet
when determining whether data it
receives/sends to the server should be decompressed/compressed, respectively.
Please see the Net::SSH::Perl manpage for author, copyright, and license