2 package IO::Uncompress::Base ;
8 our ($VERSION, @EXPORT_OK, %EXPORT_TAGS);
10 $VERSION = '2.000_05';
12 use constant G_EOF => 0 ;
13 use constant G_ERR => -1 ;
15 use Compress::Zlib::Common ;
16 use Compress::Zlib::ParseParameters ;
20 use Scalar::Util qw(readonly);
21 use List::Util qw(min);
25 push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ;
26 #Exporter::export_ok_tags('all') ;
39 if ( length *$self->{Prime} ) {
40 #$$out = substr(*$self->{Prime}, 0, $size, '') ;
41 $$out = substr(*$self->{Prime}, 0, $size) ;
42 substr(*$self->{Prime}, 0, $size) = '' ;
43 if (length $$out == $size) {
44 #*$self->{InputLengthRemaining} -= length $$out;
47 $offset = length $$out ;
50 my $get_size = $size - $offset ;
52 if ( defined *$self->{InputLength} ) {
53 #*$self->{InputLengthRemaining} += length *$self->{Prime} ;
54 #*$self->{InputLengthRemaining} = *$self->{InputLength}
55 # if *$self->{InputLengthRemaining} > *$self->{InputLength};
56 $get_size = min($get_size, *$self->{InputLengthRemaining});
59 if (defined *$self->{FH})
60 { *$self->{FH}->read($$out, $get_size, $offset) }
61 elsif (defined *$self->{InputEvent}) {
63 while (length $$out < $size) {
65 if ($got = *$self->{InputEvent}->($$out, $get_size)) <= 0;
68 if (length $$out > $size ) {
69 #*$self->{Prime} = substr($$out, $size, length($$out), '');
70 *$self->{Prime} = substr($$out, $size, length($$out));
71 substr($$out, $size, length($$out)) = '';
74 *$self->{EventEof} = 1 if $got <= 0 ;
77 no warnings 'uninitialized';
78 my $buf = *$self->{Buffer} ;
79 $$buf = '' unless defined $$buf ;
80 #$$out = '' unless defined $$out ;
81 substr($$out, $offset) = substr($$buf, *$self->{BufferOffset}, $get_size);
82 *$self->{BufferOffset} += length($$out) - $offset ;
85 *$self->{InputLengthRemaining} -= length $$out;
87 $self->saveStatus(length $$out < 0 ? STATUS_ERROR : 0) ;
96 return if ! defined $_[0] || length $_[0] == 0 ;
98 if (defined *$self->{FH} || defined *$self->{InputEvent} ) {
99 *$self->{Prime} = $_[0] . *$self->{Prime} ;
102 my $len = length $_[0];
104 if($len > *$self->{BufferOffset}) {
105 *$self->{Prime} = substr($_[0], 0, $len - *$self->{BufferOffset}) . *$self->{Prime} ;
106 *$self->{InputLengthRemaining} = *$self->{InputLength};
107 *$self->{BufferOffset} = 0
110 *$self->{InputLengthRemaining} += length($_[0]);
111 *$self->{BufferOffset} -= length($_[0]) ;
120 my $truncate = shift;
121 #print "smartSeek to $offset\n";
123 # TODO -- need to take prime into account
124 if (defined *$self->{FH})
125 { *$self->{FH}->seek($offset, SEEK_SET) }
127 *$self->{BufferOffset} = $offset ;
128 substr(${ *$self->{Buffer} }, *$self->{BufferOffset}) = ''
137 my $out_data = shift ;
139 if (defined *$self->{FH}) {
140 # flush needed for 5.8.0
141 defined *$self->{FH}->write($out_data, length $out_data) &&
142 defined *$self->{FH}->flush() ;
145 my $buf = *$self->{Buffer} ;
146 substr($$buf, *$self->{BufferOffset}, length $out_data) = $out_data ;
147 *$self->{BufferOffset} += length($out_data) ;
154 return $_[0]->smartRead($_[1], $_[2]) == $_[2];
161 return 0 if length *$self->{Prime};
163 if (defined *$self->{FH})
164 { *$self->{FH}->eof() }
165 elsif (defined *$self->{InputEvent})
166 { *$self->{EventEof} }
168 { *$self->{BufferOffset} >= length(${ *$self->{Buffer} }) }
175 *$self->{ErrorNo} = 0 ;
176 ${ *$self->{Error} } = '' ;
182 my $errno = shift() + 0 ;
183 #return $errno unless $errno || ! defined *$self->{ErrorNo};
184 #return $errno unless $errno ;
186 *$self->{ErrorNo} = $errno;
187 ${ *$self->{Error} } = '' ;
189 return *$self->{ErrorNo} ;
198 #return $retval if ${ *$self->{Error} };
200 ${ *$self->{Error} } = shift ;
201 *$self->{ErrorNo} = shift() + 0 if @_ ;
203 #warn "saveErrorString: " . ${ *$self->{Error} } . " " . *$self->{Error} . "\n" ;
210 $self->saveErrorString(0, $_[0]);
220 my $errno = *$self->{ErrorNo};
221 my $error = ${ *$self->{Error} };
225 *$self->{ErrorNo} = $errno ;
226 ${ *$self->{Error} } = $error ;
234 return ${ *$self->{Error} } ;
240 return *$self->{ErrorNo};
246 return $self->saveErrorString(undef, "Header Error: $_[0]", STATUS_ERROR);
252 return $self->saveErrorString(G_ERR, "Trailer Error: $_[0]", STATUS_ERROR);
258 return $self->HeaderError("Truncated in $_[0] Section");
266 my $got = shift || Compress::Zlib::ParseParameters::new();
269 'BlockSize' => [1, 1, Parse_unsigned, 16 * 1024],
270 'AutoClose' => [1, 1, Parse_boolean, 0],
271 'Strict' => [1, 1, Parse_boolean, 0],
272 #'Lax' => [1, 1, Parse_boolean, 1],
273 'Append' => [1, 1, Parse_boolean, 0],
274 'Prime' => [1, 1, Parse_any, undef],
275 'MultiStream' => [1, 1, Parse_boolean, 0],
276 'Transparent' => [1, 1, Parse_any, 1],
277 'Scan' => [1, 1, Parse_boolean, 0],
278 'InputLength' => [1, 1, Parse_unsigned, undef],
279 'BinModeOut' => [1, 1, Parse_boolean, 0],
281 $self->getExtraParams(),
284 #'Todo - Revert to ordinary file on end Z_STREAM_END'=> 0,
289 $got->parse($Valid, @_ )
290 or $self->croakError("${class}: $got->{Error}") ;
300 my $append_mode = shift ;
302 my $class = ref $obj;
303 $obj->croakError("$class: Missing Input parameter")
306 my $inValue = shift ;
310 $got = $obj->checkParams($class, undef, @_)
314 my $inType = whatIsInput($inValue, 1);
316 $obj->ckInputParam($class, $inValue, 1)
322 or $obj->croakError("${class}: $obj->{Error}");
324 if ($inType eq 'buffer' || $inType eq 'code') {
325 *$obj->{Buffer} = $inValue ;
326 *$obj->{InputEvent} = $inValue
327 if $inType eq 'code' ;
330 if ($inType eq 'handle') {
331 *$obj->{FH} = $inValue ;
332 *$obj->{Handle} = 1 ;
333 # Need to rewind for Scan
334 #seek(*$obj->{FH}, 0, SEEK_SET) if $got->value('Scan');
335 *$obj->{FH}->seek(0, SEEK_SET) if $got->value('Scan');
339 $mode = '+<' if $got->value('Scan');
340 *$obj->{StdIO} = ($inValue eq '-');
341 *$obj->{FH} = new IO::File "$mode $inValue"
342 or return $obj->saveErrorString(undef, "cannot open file '$inValue': $!", $!) ;
346 setBinModeInput(*$obj->{FH}) ;
349 *$obj->{Buffer} = \$buff ;
353 *$obj->{InputLength} = $got->parsed('InputLength')
354 ? $got->value('InputLength')
356 *$obj->{InputLengthRemaining} = $got->value('InputLength');
357 *$obj->{BufferOffset} = 0 ;
358 *$obj->{AutoClose} = $got->value('AutoClose');
359 *$obj->{Strict} = $got->value('Strict');
360 #*$obj->{Strict} = ! $got->value('Lax');
361 *$obj->{BlockSize} = $got->value('BlockSize');
362 *$obj->{Append} = $got->value('Append');
363 *$obj->{AppendOutput} = $append_mode || $got->value('Append');
364 *$obj->{Transparent} = $got->value('Transparent');
365 *$obj->{MultiStream} = $got->value('MultiStream');
367 # TODO - move these two into RawDeflate
368 *$obj->{Scan} = $got->value('Scan');
369 *$obj->{ParseExtra} = $got->value('ParseExtra')
370 || $got->value('Strict') ;
371 #|| ! $got->value('Lax') ;
373 *$obj->{Prime} = $got->value('Prime') || '' ;
374 *$obj->{Pending} = '';
376 *$obj->{PlainBytesRead} = 0;
377 *$obj->{InflatedBytesRead} = 0;
378 *$obj->{UnCompSize_32bit} = 0;
379 *$obj->{TotalInflatedBytesRead} = 0;
380 *$obj->{NewStream} = 0 ;
381 *$obj->{EventEof} = 0 ;
382 *$obj->{ClassName} = $class ;
383 *$obj->{Params} = $got ;
385 my $status = $obj->mkUncomp($class, $got);
388 unless defined $status;
392 unless *$obj->{Transparent};
395 *$obj->{Type} = 'plain';
397 #$status = $obj->mkIdentityUncomp($class, $got);
398 $obj->pushBack(*$obj->{HeaderPending}) ;
401 push @{ *$obj->{InfoList} }, *$obj->{Info} ;
403 $obj->saveStatus(0) ;
414 my $inType = whatIsInput($_[0], $_[1]);
416 $self->croakError("$from: input parameter not a filename, filehandle, array ref or scalar ref")
419 if ($inType eq 'filename' )
421 $self->croakError("$from: input filename is undef or null string")
422 if ! defined $_[0] || $_[0] eq '' ;
424 if ($_[0] ne '-' && ! -e $_[0] )
426 return $self->saveErrorString(undef,
427 "input file '$_[0]' does not exist", STATUS_ERROR);
439 my $class = (caller)[0] ;
440 my $name = (caller(1))[3] ;
442 $obj->croakError("$name: expected at least 1 parameters\n")
450 my $x = new Validator($class, *$obj->{Error}, $name, $input, $output)
453 push @_, $output if $haveOut && $x->{Hash};
455 my $got = $obj->checkParams($name, undef, @_)
462 while (my($k, $v) = each %$input)
467 $obj->_singleTarget($x, 1, $k, $v, @_)
471 return keys %$input ;
477 foreach my $pair (@{ $x->{Pairs} })
479 my ($from, $to) = @$pair ;
480 $obj->_singleTarget($x, 1, $from, $to, @_)
484 return scalar @{ $x->{Pairs} } ;
487 #if ($x->{outType} eq 'array' || $x->{outType} eq 'hash')
488 if (! $x->{oneOutput} )
490 my $inFile = ($x->{inType} eq 'filenames'
491 || $x->{inType} eq 'filename');
493 $x->{inType} = $inFile ? 'filename' : 'buffer';
494 my $ot = $x->{outType} ;
495 $x->{outType} = 'buffer';
497 foreach my $in ($x->{oneInput} ? $input : @$input)
502 $obj->_singleTarget($x, $inFile, $in, \$out, @_)
506 { push @$output, \$out }
508 { $output->{$in} = \$out }
514 # finally the 1 to 1 and n to 1
515 return $obj->_singleTarget($x, 1, $input, $output, @_);
517 croak "should not be here" ;
525 ${ $x->{Error} } = $string ;
534 my $inputIsFilename = shift;
541 if ($x->{outType} eq 'filename') {
544 if $x->{Got}->value('Append') ;
545 $x->{fh} = new IO::File "$mode $output"
546 or return retErr($x, "cannot open file '$output': $!") ;
547 binmode $x->{fh} if $x->{Got}->valueOrDefault('BinModeOut');
551 elsif ($x->{outType} eq 'handle') {
553 binmode $x->{fh} if $x->{Got}->valueOrDefault('BinModeOut');
554 if ($x->{Got}->value('Append')) {
555 seek($x->{fh}, 0, SEEK_END)
556 or return retErr($x, "Cannot seek to end of output filehandle: $!") ;
561 elsif ($x->{outType} eq 'buffer' )
564 unless $x->{Got}->value('Append');
565 $x->{buff} = $output ;
570 defined $self->_rd2($x, $input, $inputIsFilename)
575 my $inputIsFilename = ($x->{inType} ne 'array');
577 for my $element ( ($x->{inType} eq 'hash') ? keys %$input : @$input)
579 defined $self->_rd2($x, $element, $inputIsFilename)
585 if ( ($x->{outType} eq 'filename' && $output ne '-') ||
586 ($x->{outType} eq 'handle' && $x->{Got}->value('AutoClose'))) {
588 or return retErr($x, $!);
589 #or return $gunzip->saveErrorString(undef, $!, $!);
601 my $inputIsFilename = shift;
603 my $z = createSelfTiedObject($x->{Class}, *$self->{Error});
605 $z->_create($x->{Got}, 1, $input, @_)
611 while (($status = $z->read($x->{buff})) > 0) {
614 or return $z->saveErrorString(undef, "Error writing to output file: $!", $!);
619 return $z->closeError(undef)
630 return $_[0] if ref($_[0]);
644 wantarray ? @{ *$self->{InfoList} } : *$self->{Info};
653 if (defined *$self->{CompressedInputLength}) {
654 if (*$self->{CompressedInputLengthRemaining} == 0) {
655 delete *$self->{CompressedInputLength};
659 $size = min($size, *$self->{CompressedInputLengthRemaining} );
660 *$self->{CompressedInputLengthRemaining} -= $size ;
663 my $status = $self->smartRead($buff, $size) ;
664 return $self->saveErrorString(STATUS_ERROR, "Error Reading Data")
668 *$self->{Closed} = 1 ;
669 *$self->{EndStream} = 1 ;
670 return $self->saveErrorString(STATUS_ERROR, "unexpected end of file", STATUS_ERROR);
685 # >0 - ok, number of bytes read
691 return G_EOF if *$self->{Closed} ;
692 #return G_EOF if !length *$self->{Pending} && *$self->{EndStream} ;
693 return G_EOF if *$self->{EndStream} ;
696 my $scan_mode = shift ;
698 if (*$self->{Plain}) {
700 my $len = $self->smartRead(\$tmp_buff, *$self->{BlockSize}) ;
702 return $self->saveErrorString(G_ERR, "Error reading data: $!", $!)
706 *$self->{EndStream} = 1 ;
709 *$self->{PlainBytesRead} += $len ;
710 $$buffer .= $tmp_buff;
716 if (*$self->{NewStream}) {
718 *$self->{NewStream} = 0 ;
719 *$self->{EndStream} = 0 ;
720 *$self->{Uncomp}->reset();
723 unless my $magic = $self->ckMagic();
724 *$self->{Info} = $self->readHeader($magic);
726 return G_ERR unless defined *$self->{Info} ;
728 push @{ *$self->{InfoList} }, *$self->{Info} ;
730 # For the headers that actually uncompressed data, put the
731 # uncompressed data into the output buffer.
732 $$buffer .= *$self->{Pending} ;
733 my $len = length *$self->{Pending} ;
734 *$self->{Pending} = '';
740 my $status = $self->readBlock(\$temp_buf, *$self->{BlockSize}, $outSize) ;
742 if $status == STATUS_ERROR ;
745 if ($status == STATUS_OK) {
746 my $before_len = defined $$buffer ? length $$buffer : 0 ;
747 $status = *$self->{Uncomp}->uncompr(\$temp_buf, $buffer,
748 (defined *$self->{CompressedInputLength} &&
749 *$self->{CompressedInputLengthRemaining} <= 0) ||
750 $self->smartEof(), $outSize);
752 return $self->saveErrorString(G_ERR, *$self->{Uncomp}{Error}, *$self->{Uncomp}{ErrorNo})
753 if $self->saveStatus($status) == STATUS_ERROR;
755 $self->postBlockChk($buffer) == STATUS_OK
758 #$buf_len = *$self->{Uncomp}->count();
759 $buf_len = length($$buffer) - $before_len;
762 *$self->{InflatedBytesRead} += $buf_len ;
763 *$self->{TotalInflatedBytesRead} += $buf_len ;
764 my $rest = 0xFFFFFFFF - *$self->{UnCompSize_32bit} ;
765 if ($buf_len > $rest) {
766 *$self->{UnCompSize_32bit} = $buf_len - $rest - 1;
769 *$self->{UnCompSize_32bit} += $buf_len ;
773 if ($status == STATUS_ENDSTREAM) {
775 *$self->{EndStream} = 1 ;
776 $self->pushBack($temp_buf) ;
780 if (*$self->{Info}{TrailerLength})
782 my $trailer_size = *$self->{Info}{TrailerLength} ;
784 my $got = $self->smartRead(\$trailer, $trailer_size) ;
785 if ($got != $trailer_size) {
786 return $self->TrailerError("trailer truncated. Expected " .
787 "$trailer_size bytes, got $got")
789 $self->pushBack($trailer) ;
793 $self->chkTrailer($trailer) == G_ERR
796 if (*$self->{MultiStream} && ! $self->smartEof()) {
797 #&& (length $temp_buf || ! $self->smartEof())){
798 *$self->{NewStream} = 1 ;
799 *$self->{EndStream} = 0 ;
806 # return the number of uncompressed bytes read
813 # return *$self->{NewStream} ||
814 # *$self->{EndStream} ;
820 return 1 if ! defined *$self->{InfoList};
821 return scalar @{ *$self->{InfoList} } ;
827 # >0 - ok, number of bytes read
833 return G_EOF if *$self->{Closed} ;
834 return G_EOF if !length *$self->{Pending} && *$self->{EndStream} ;
838 #$self->croakError(*$self->{ClassName} .
839 # "::read: buffer parameter is read-only")
840 # if Compress::Zlib::_readonly_ref($_[0]);
843 $self->croakError(*$self->{ClassName} . "::read: buffer parameter is read-only")
844 if readonly(${ $_[0] });
846 $self->croakError(*$self->{ClassName} . "::read: not a scalar reference $_[0]" )
847 unless ref $_[0] eq 'SCALAR' ;
851 $self->croakError(*$self->{ClassName} . "::read: buffer parameter is read-only")
858 my $offset = $_[2] || 0;
860 # the core read will return 0 if asked for 0 bytes
861 return 0 if defined $length && $length == 0 ;
863 $length = $length || 0;
865 $self->croakError(*$self->{ClassName} . "::read: length parameter is negative")
868 $$buffer = '' unless *$self->{AppendOutput} || $offset ;
870 # Short-circuit if this is a simple read, with no length
871 # or offset specified.
872 unless ( $length || $offset) {
873 if (length *$self->{Pending}) {
874 $$buffer .= *$self->{Pending} ;
875 my $len = length *$self->{Pending};
876 *$self->{Pending} = '' ;
881 $len = $self->_raw_read($buffer)
882 while ! *$self->{EndStream} && $len == 0 ;
887 # Need to jump through more hoops - either length or offset
888 # or both are specified.
889 my $out_buffer = \*$self->{Pending} ;
891 while (! *$self->{EndStream} && length($$out_buffer) < $length)
893 my $buf_len = $self->_raw_read($out_buffer);
898 $length = length $$out_buffer
899 if length($$out_buffer) < $length ;
902 $$buffer .= "\x00" x ($offset - length($$buffer))
903 if $offset > length($$buffer) ;
904 #substr($$buffer, $offset) = substr($$out_buffer, 0, $length, '') ;
905 substr($$buffer, $offset) = substr($$out_buffer, 0, $length) ;
906 substr($$out_buffer, 0, $length) = '' ;
909 #$$buffer .= substr($$out_buffer, 0, $length, '') ;
910 $$buffer .= substr($$out_buffer, 0, $length) ;
911 substr($$out_buffer, 0, $length) = '' ;
922 if ( ! defined $/ ) {
924 1 while $self->read($data) > 0 ;
931 while ($self->read($paragraph) > 0 ) {
932 if ($paragraph =~ s/^(.*?\n\n+)//s) {
933 *$self->{Pending} = $paragraph ;
944 my $endl = quotemeta($/); # quote in case $/ contains RE meta chars
945 while ($self->read($line) > 0 ) {
946 if ($line =~ s/^(.*?$endl)//s) {
947 *$self->{Pending} = $line ;
948 $. = ++ *$self->{LineNo} ;
953 $. = ++ *$self->{LineNo} if defined($line);
961 my $current_append = *$self->{AppendOutput} ;
962 *$self->{AppendOutput} = 1;
963 my $lineref = $self->_getline();
964 *$self->{AppendOutput} = $current_append;
971 $self->croakError(*$self->{ClassName} .
972 "::getlines: called in scalar context\n") unless wantarray;
974 push(@lines, $line) while defined($line = $self->getline);
980 goto &getlines if wantarray;
988 return $buf if $self->read($buf, 1);
995 *$self->{Pending} = "" unless defined *$self->{Pending} ;
996 *$self->{Pending} = $_[0] . *$self->{Pending} ;
1003 #return \"" if ! defined *$self->{Trailing} ;
1004 #return \*$self->{Trailing} ;
1006 if (defined *$self->{FH} || defined *$self->{InputEvent} ) {
1007 return *$self->{Prime} ;
1010 my $buf = *$self->{Buffer} ;
1011 my $offset = *$self->{BufferOffset} ;
1012 return substr($$buf, $offset, -1) ;
1021 return (*$self->{Closed} ||
1022 (!length *$self->{Pending}
1023 && ( $self->smartEof() || *$self->{EndStream}))) ;
1031 if (*$self->{Plain}) {
1032 $in = *$self->{PlainBytesRead} ;
1035 $in = *$self->{TotalInflatedBytesRead} ;
1038 my $pending = length *$self->{Pending} ;
1040 return 0 if $pending > $in ;
1041 return $in - $pending ;
1046 # todo - what to do if close is called before the end of the gzip file
1047 # do we remember any trailing data?
1050 return 1 if *$self->{Closed} ;
1057 if (defined *$self->{FH}) {
1058 if ((! *$self->{Handle} || *$self->{AutoClose}) && ! *$self->{StdIO}) {
1059 #if ( *$self->{AutoClose}) {
1061 $status = *$self->{FH}->close();
1062 return $self->saveErrorString(0, $!, $!)
1063 if !*$self->{InNew} && $self->saveStatus($!) != 0 ;
1065 delete *$self->{FH} ;
1068 *$self->{Closed} = 1 ;
1082 my $position = shift;
1083 my $whence = shift ;
1085 my $here = $self->tell() ;
1089 if ($whence == SEEK_SET) {
1090 $target = $position ;
1092 elsif ($whence == SEEK_CUR) {
1093 $target = $here + $position ;
1095 elsif ($whence == SEEK_END) {
1096 $target = $position ;
1097 $self->croakError(*$self->{ClassName} . "::seek: SEEK_END not allowed") ;
1100 $self->croakError(*$self->{ClassName} ."::seek: unknown value, $whence, for whence parameter");
1103 # short circuit if seeking to current offset
1104 return 1 if $target == $here ;
1106 # Outlaw any attempt to seek backwards
1107 $self->croakError( *$self->{ClassName} ."::seek: cannot seek backwards")
1108 if $target < $here ;
1110 # Walk the file to the new offset
1111 my $offset = $target - $here ;
1114 $self->read($buffer, $offset) == $offset
1123 return defined *$self->{FH}
1124 ? fileno *$self->{FH}
1131 # my $self = shift ;
1132 # return defined *$self->{FH}
1133 # ? binmode *$self->{FH}
1137 *BINMODE = \&binmode;
1150 #return sub { croak "$name Not Available" ; } ;
1151 return sub { croak "$name Not Available: File opened only for intput" ; } ;
1155 *print = _notAvailable('print');
1156 *PRINT = _notAvailable('print');
1157 *printf = _notAvailable('printf');
1158 *PRINTF = _notAvailable('printf');
1159 *write = _notAvailable('write');
1160 *WRITE = _notAvailable('write');
1163 #*syswrite = \&_notAvailable;
1165 #package IO::_infScan ;
1167 #*_raw_read = \&IO::Uncompress::Base::_raw_read ;
1168 #*smartRead = \&IO::Uncompress::Base::smartRead ;
1169 #*smartWrite = \&IO::Uncompress::Base::smartWrite ;
1170 #*smartSeek = \&IO::Uncompress::Base::smartSeek ;
1172 #sub mkIdentityUncomp
1174 # my $self = shift ;
1175 # my $class = shift ;
1178 # *$self->{Uncomp} = UncompressPlugin::Identity::mkUncompObject($self, $class, $got)
1186 #package UncompressPlugin::Identity;
1191 #our ($VERSION, @ISA, @EXPORT);
1193 #$VERSION = '2.000_05';
1195 #use constant STATUS_OK => 0;
1196 #use constant STATUS_ENDSTREAM => 1;
1197 #use constant STATUS_ERROR => 2;
1201 # my $class = shift ;
1203 # bless { 'CompSize' => 0,
1204 # 'UnCompSize' => 0,
1212 # my $self = shift ;
1213 # my $from = shift ;
1218 # $self->{CompSize} += length $$from ;
1219 # $self->{UnCompSize} = $self->{CompSize} ;
1223 # return STATUS_ENDSTREAM if $eof;
1224 # return STATUS_OK ;
1229 # my $self = shift ;
1230 # return $self->{UnCompSize} ;
1235 # return STATUS_OK ;
1241 # return STATUS_OK ;
1245 package IO::Uncompress::Base ;