1 package IO::Uncompress::Adapter::Identity;
7 use IO::Compress::Base::Common qw(:Status);
13 use Compress::Raw::Zlib ();
17 my $crc32 = 1; #shift ;
20 bless { 'CompSize' => 0,
22 'wantCRC32' => $crc32,
23 'CRC32' => Compress::Raw::Zlib::crc32(''),
24 'wantADLER32'=> $adler32,
25 'ADLER32' => Compress::Raw::Zlib::adler32(''),
34 if (defined ${ $_[0] } && length ${ $_[0] }) {
35 $self->{CompSize} += length ${ $_[0] } ;
36 $self->{UnCompSize} = $self->{CompSize} ;
38 $self->{CRC32} = Compress::Raw::Zlib::crc32($_[0], $self->{CRC32})
39 if $self->{wantCRC32};
41 $self->{ADLER32} = Compress::Zlib::adler32($_[0], $self->{ADLER32})
42 if $self->{wantADLER32};
44 ${ $_[1] } .= ${ $_[0] };
48 return STATUS_ENDSTREAM if $eof;
56 $self->{CompSize} = 0;
57 $self->{UnCompSize} = 0;
58 $self->{CRC32} = Compress::Raw::Zlib::crc32('');
59 $self->{ADLER32} = Compress::Raw::Zlib::adler32('');
68 # return $self->{UnCompSize} ;
74 return $self->{UnCompSize} ;
80 return $self->{UnCompSize} ;
91 return $self->{CRC32};
97 return $self->{ADLER32};