1 package IO::Compress::Adapter::Deflate ;
7 use IO::Compress::Base::Common qw(:Status);
9 use Compress::Raw::Zlib qw(Z_OK Z_FINISH MAX_WBITS) ;
19 my $strategy = shift ;
21 my ($def, $status) = new Compress::Raw::Zlib::Deflate
26 -Strategy => $strategy,
27 -WindowBits => - MAX_WBITS;
29 return (undef, "Cannot create Deflate object: $status", $status)
32 return bless {'Def' => $def,
41 my $def = $self->{Def};
43 my $status = $def->deflate($_[0], $_[1]) ;
44 $self->{ErrorNo} = $status;
48 $self->{Error} = "Deflate Error: $status";
59 my $def = $self->{Def};
61 my $opt = $_[1] || Z_FINISH;
62 my $status = $def->flush($_[0], $opt);
63 $self->{ErrorNo} = $status;
67 $self->{Error} = "Deflate Error: $status";
79 my $def = $self->{Def};
81 $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();
137 $self->{Def}->compressedBytes();
140 sub uncompressedBytes
143 $self->{Def}->uncompressedBytes();
152 $self->{Def}->crc32();
158 $self->{Def}->adler32();