Add and remove files forgotten in change #27384
[p5sagit/p5-mst-13.2.git] / ext / Compress / IO / Zlib / lib / IO / Uncompress / Adapter / Identity.pm
@@ -1,15 +1,16 @@
-package UncompressPlugin::Identity;
+package IO::Uncompress::Adapter::Identity;
 
 use warnings;
 use strict;
+use bytes;
 
-use Compress::Zlib::Common qw(:Status);
+use IO::Compress::Base::Common qw(:Status);
 
 our ($VERSION);
 
 $VERSION = '2.000_05';
 
-use Compress::Zlib ();
+use Compress::Raw::Zlib ();
 
 sub mkUncompObject
 {
@@ -19,9 +20,9 @@ sub mkUncompObject
     bless { 'CompSize'   => 0,
             'UnCompSize' => 0,
             'wantCRC32'  => $crc32,
-            'CRC32'      => Compress::Zlib::crc32(''),
+            'CRC32'      => Compress::Raw::Zlib::crc32(''),
             'wantADLER32'=> $adler32,
-            'ADLER32'    => Compress::Zlib::adler32(''),
+            'ADLER32'    => Compress::Raw::Zlib::adler32(''),
           } ;
 }
 
@@ -34,13 +35,14 @@ sub uncompr
         $self->{CompSize} += length ${ $_[0] } ;
         $self->{UnCompSize} = $self->{CompSize} ;
 
-        $self->{CRC32} = Compress::Zlib::crc32($_[0],  $self->{CRC32})
+        $self->{CRC32} = Compress::Raw::Zlib::crc32($_[0],  $self->{CRC32})
             if $self->{wantCRC32};
 
         $self->{ADLER32} = Compress::Zlib::adler32($_[0],  $self->{ADLER32})
             if $self->{wantADLER32};
 
         ${ $_[1] } .= ${ $_[0] };
+        ${ $_[0] } = "";
     }
 
     return STATUS_ENDSTREAM if $eof;
@@ -49,15 +51,22 @@ sub uncompr
 
 sub reset
 {
+    my $self = shift;
+
+    $self->{CompSize}   = 0;
+    $self->{UnCompSize} = 0;
+    $self->{CRC32}      = Compress::Zlib::crc32('');
+    $self->{ADLER32}    = Compress::Zlib::adler32('');      
+
     return STATUS_OK ;
 }
 
 
-sub count
-{
-    my $self = shift ;
-    return $self->{UnCompSize} ;
-}
+#sub count
+#{
+#    my $self = shift ;
+#    return $self->{UnCompSize} ;
+#}
 
 sub compressedBytes
 {