1 package CompressPlugin::Deflate ;
6 use Compress::Zlib::Common qw(:Status);
8 use Compress::Zlib qw(Z_OK Z_FINISH MAX_WBITS) ;
11 $VERSION = '2.000_05';
18 my $strategy = shift ;
20 my ($def, $status) = new Compress::Zlib::Deflate
25 -Strategy => $strategy,
26 -WindowBits => - MAX_WBITS;
28 return (undef, "Cannot create Deflate object: $status", $status)
31 return bless {'Def' => $def,
42 my $def = $self->{Def};
44 my $status = $def->deflate($_[0], $_[1]) ;
45 $self->{ErrorNo} = $status;
49 $self->{Error} = "Deflate Error: $status";
60 my $def = $self->{Def};
62 my $opt = $_[1] || Z_FINISH;
63 my $status = $def->flush($_[0], $opt);
64 $self->{ErrorNo} = $status;
68 $self->{Error} = "Deflate Error: $status";
80 my $def = $self->{Def};
82 $def->flush($_[0], Z_FINISH);
89 my $def = $self->{Def};
91 my $status = $def->deflateReset() ;
92 $self->{ErrorNo} = $status;
95 $self->{Error} = "Deflate Error: $status";
106 my $def = $self->{Def};
108 my $status = $def->deflateParams(@_);
109 $self->{ErrorNo} = $status;
112 $self->{Error} = "deflateParams Error: $status";
124 $self->{Def}->total_out();
130 $self->{Def}->total_in();
136 $self->{Def}->compressedBytes();
139 sub uncompressedBytes
142 $self->{Def}->uncompressedBytes();
151 $self->{Def}->crc32();
157 $self->{Def}->adler32();