2 package IO::Uncompress::Base ;
8 our (@ISA, $VERSION, @EXPORT_OK, %EXPORT_TAGS);
9 #@ISA = qw(Exporter IO::File);
13 $VERSION = '2.000_13';
15 use constant G_EOF => 0 ;
16 use constant G_ERR => -1 ;
18 use IO::Compress::Base::Common;
19 #use Parse::Parameters ;
23 use Scalar::Util qw(readonly);
24 use List::Util qw(min);
28 push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ;
29 #Exporter::export_ok_tags('all') ;
42 if (defined *$self->{InputLength} &&
43 *$self->{InputLengthRemaining} <= 0) {
47 if ( length *$self->{Prime} ) {
48 #$$out = substr(*$self->{Prime}, 0, $size, '') ;
49 $$out = substr(*$self->{Prime}, 0, $size) ;
50 substr(*$self->{Prime}, 0, $size) = '' ;
51 if (length $$out == $size || defined *$self->{InputLength}) {
52 *$self->{InputLengthRemaining} -= length $$out;
55 $offset = length $$out ;
58 my $get_size = $size - $offset ;
60 if ( defined *$self->{InputLength} ) {
61 $get_size = min($get_size, *$self->{InputLengthRemaining});
64 if (defined *$self->{FH})
65 { *$self->{FH}->read($$out, $get_size, $offset) }
66 elsif (defined *$self->{InputEvent}) {
68 while (length $$out < $size) {
70 if ($got = *$self->{InputEvent}->($$out, $get_size)) <= 0;
73 if (length $$out > $size ) {
74 #*$self->{Prime} = substr($$out, $size, length($$out), '');
75 *$self->{Prime} = substr($$out, $size, length($$out));
76 substr($$out, $size, length($$out)) = '';
79 *$self->{EventEof} = 1 if $got <= 0 ;
82 no warnings 'uninitialized';
83 my $buf = *$self->{Buffer} ;
84 $$buf = '' unless defined $$buf ;
85 #$$out = '' unless defined $$out ;
86 substr($$out, $offset) = substr($$buf, *$self->{BufferOffset}, $get_size);
87 if (*$self->{ConsumeInput})
88 { substr($$buf, 0, $get_size) = '' }
90 { *$self->{BufferOffset} += length($$out) - $offset }
93 *$self->{InputLengthRemaining} -= length $$out;
95 $self->saveStatus(length $$out < 0 ? STATUS_ERROR : STATUS_OK) ;
104 return if ! defined $_[0] || length $_[0] == 0 ;
106 if (defined *$self->{FH} || defined *$self->{InputEvent} ) {
107 *$self->{Prime} = $_[0] . *$self->{Prime} ;
108 *$self->{InputLengthRemaining} += length($_[0]);
111 my $len = length $_[0];
113 if($len > *$self->{BufferOffset}) {
114 *$self->{Prime} = substr($_[0], 0, $len - *$self->{BufferOffset}) . *$self->{Prime} ;
115 *$self->{InputLengthRemaining} = *$self->{InputLength};
116 *$self->{BufferOffset} = 0
119 *$self->{InputLengthRemaining} += length($_[0]);
120 *$self->{BufferOffset} -= length($_[0]) ;
129 my $truncate = shift;
130 #print "smartSeek to $offset\n";
132 # TODO -- need to take prime into account
133 if (defined *$self->{FH})
134 { *$self->{FH}->seek($offset, SEEK_SET) }
136 *$self->{BufferOffset} = $offset ;
137 substr(${ *$self->{Buffer} }, *$self->{BufferOffset}) = ''
146 my $out_data = shift ;
148 if (defined *$self->{FH}) {
149 # flush needed for 5.8.0
150 defined *$self->{FH}->write($out_data, length $out_data) &&
151 defined *$self->{FH}->flush() ;
154 my $buf = *$self->{Buffer} ;
155 substr($$buf, *$self->{BufferOffset}, length $out_data) = $out_data ;
156 *$self->{BufferOffset} += length($out_data) ;
163 return $_[0]->smartRead($_[1], $_[2]) == $_[2];
171 return 0 if length *$self->{Prime} || *$self->{PushMode};
173 if (defined *$self->{FH})
174 { *$self->{FH}->eof() }
175 elsif (defined *$self->{InputEvent})
176 { *$self->{EventEof} }
178 { *$self->{BufferOffset} >= length(${ *$self->{Buffer} }) }
185 *$self->{ErrorNo} = 0 ;
186 ${ *$self->{Error} } = '' ;
192 my $errno = shift() + 0 ;
193 #return $errno unless $errno || ! defined *$self->{ErrorNo};
194 #return $errno unless $errno ;
196 *$self->{ErrorNo} = $errno;
197 ${ *$self->{Error} } = '' ;
199 return *$self->{ErrorNo} ;
208 #return $retval if ${ *$self->{Error} };
210 ${ *$self->{Error} } = shift ;
211 *$self->{ErrorNo} = shift() + 0 if @_ ;
213 #warn "saveErrorString: " . ${ *$self->{Error} } . " " . *$self->{Error} . "\n" ;
220 $self->saveErrorString(0, $_[0]);
230 my $errno = *$self->{ErrorNo};
231 my $error = ${ *$self->{Error} };
235 *$self->{ErrorNo} = $errno ;
236 ${ *$self->{Error} } = $error ;
244 return ${ *$self->{Error} } ;
250 return *$self->{ErrorNo};
256 return $self->saveErrorString(undef, "Header Error: $_[0]", STATUS_ERROR);
262 return $self->saveErrorString(G_ERR, "Trailer Error: $_[0]", STATUS_ERROR);
268 return $self->HeaderError("Truncated in $_[0] Section");
274 return $self->TrailerError("Truncated in $_[0] Section");
282 my $got = shift || IO::Compress::Base::Parameters::new();
285 'BlockSize' => [1, 1, Parse_unsigned, 16 * 1024],
286 'AutoClose' => [1, 1, Parse_boolean, 0],
287 'Strict' => [1, 1, Parse_boolean, 0],
288 #'Lax' => [1, 1, Parse_boolean, 1],
289 'Append' => [1, 1, Parse_boolean, 0],
290 'Prime' => [1, 1, Parse_any, undef],
291 'MultiStream' => [1, 1, Parse_boolean, 0],
292 'Transparent' => [1, 1, Parse_any, 1],
293 'Scan' => [1, 1, Parse_boolean, 0],
294 'InputLength' => [1, 1, Parse_unsigned, undef],
295 'BinModeOut' => [1, 1, Parse_boolean, 0],
296 #'ConsumeInput' => [1, 1, Parse_boolean, 0],
298 $self->getExtraParams(),
301 #'Todo - Revert to ordinary file on end Z_STREAM_END'=> 0,
306 $got->parse($Valid, @_ )
307 or $self->croakError("${class}: $got->{Error}") ;
317 my $append_mode = shift ;
319 my $class = ref $obj;
320 $obj->croakError("$class: Missing Input parameter")
323 my $inValue = shift ;
327 $got = $obj->checkParams($class, undef, @_)
331 my $inType = whatIsInput($inValue, 1);
333 $obj->ckInputParam($class, $inValue, 1)
339 or $obj->croakError("${class}: $obj->{Error}");
341 if ($inType eq 'buffer' || $inType eq 'code') {
342 *$obj->{Buffer} = $inValue ;
343 *$obj->{InputEvent} = $inValue
344 if $inType eq 'code' ;
347 if ($inType eq 'handle') {
348 *$obj->{FH} = $inValue ;
349 *$obj->{Handle} = 1 ;
350 # Need to rewind for Scan
351 #seek(*$obj->{FH}, 0, SEEK_SET) if $got->value('Scan');
352 *$obj->{FH}->seek(0, SEEK_SET) if $got->value('Scan');
356 $mode = '+<' if $got->value('Scan');
357 *$obj->{StdIO} = ($inValue eq '-');
358 *$obj->{FH} = new IO::File "$mode $inValue"
359 or return $obj->saveErrorString(undef, "cannot open file '$inValue': $!", $!) ;
362 *$obj->{LineNo} = $. = 0;
363 setBinModeInput(*$obj->{FH}) ;
366 *$obj->{Buffer} = \$buff ;
370 *$obj->{InputLength} = $got->parsed('InputLength')
371 ? $got->value('InputLength')
373 *$obj->{InputLengthRemaining} = $got->value('InputLength');
374 *$obj->{BufferOffset} = 0 ;
375 *$obj->{AutoClose} = $got->value('AutoClose');
376 *$obj->{Strict} = $got->value('Strict');
377 *$obj->{BlockSize} = $got->value('BlockSize');
378 *$obj->{Append} = $got->value('Append');
379 *$obj->{AppendOutput} = $append_mode || $got->value('Append');
380 *$obj->{ConsumeInput} = $got->value('ConsumeInput');
381 *$obj->{Transparent} = $got->value('Transparent');
382 *$obj->{MultiStream} = $got->value('MultiStream');
384 # TODO - move these two into RawDeflate
385 *$obj->{Scan} = $got->value('Scan');
386 *$obj->{ParseExtra} = $got->value('ParseExtra')
387 || $got->value('Strict') ;
389 *$obj->{Prime} = $got->value('Prime') || '' ;
390 *$obj->{Pending} = '';
392 *$obj->{PlainBytesRead} = 0;
393 *$obj->{InflatedBytesRead} = 0;
394 *$obj->{UnCompSize} = new U64;
395 *$obj->{CompSize} = new U64;
396 *$obj->{TotalInflatedBytesRead} = 0;
397 *$obj->{NewStream} = 0 ;
398 *$obj->{EventEof} = 0 ;
399 *$obj->{ClassName} = $class ;
400 *$obj->{Params} = $got ;
402 if (*$obj->{ConsumeInput}) {
408 my $status = $obj->mkUncomp($class, $got);
411 unless defined $status;
415 unless *$obj->{Transparent};
418 *$obj->{Type} = 'plain';
420 #$status = $obj->mkIdentityUncomp($class, $got);
421 $obj->pushBack(*$obj->{HeaderPending}) ;
424 push @{ *$obj->{InfoList} }, *$obj->{Info} ;
426 $obj->saveStatus(STATUS_OK) ;
437 my $inType = whatIsInput($_[0], $_[1]);
439 $self->croakError("$from: input parameter not a filename, filehandle, array ref or scalar ref")
442 if ($inType eq 'filename' )
444 $self->croakError("$from: input filename is undef or null string")
445 if ! defined $_[0] || $_[0] eq '' ;
447 if ($_[0] ne '-' && ! -e $_[0] )
449 return $self->saveErrorString(undef,
450 "input file '$_[0]' does not exist", STATUS_ERROR);
462 my $class = (caller)[0] ;
463 my $name = (caller(1))[3] ;
465 $obj->croakError("$name: expected at least 1 parameters\n")
473 my $x = new Validator($class, *$obj->{Error}, $name, $input, $output)
476 push @_, $output if $haveOut && $x->{Hash};
478 my $got = $obj->checkParams($name, undef, @_)
481 *$obj->{MultiStream} = $got->value('MultiStream');
482 $got->value('MultiStream', 0);
488 # while (my($k, $v) = each %$input)
491 # unless defined $v ;
493 # $obj->_singleTarget($x, $k, $v, @_)
497 # return keys %$input ;
503 foreach my $pair (@{ $x->{Pairs} })
505 my ($from, $to) = @$pair ;
506 $obj->_singleTarget($x, $from, $to, @_)
510 return scalar @{ $x->{Pairs} } ;
513 if (! $x->{oneOutput} )
515 my $inFile = ($x->{inType} eq 'filenames'
516 || $x->{inType} eq 'filename');
518 $x->{inType} = $inFile ? 'filename' : 'buffer';
520 foreach my $in ($x->{oneInput} ? $input : @$input)
525 $obj->_singleTarget($x, $in, $output, @_)
532 # finally the 1 to 1 and n to 1
533 return $obj->_singleTarget($x, $input, $output, @_);
535 croak "should not be here" ;
543 ${ $x->{Error} } = $string ;
556 $x->{buff} = \$buff ;
559 if ($x->{outType} eq 'filename') {
562 if $x->{Got}->value('Append') ;
563 $x->{fh} = new IO::File "$mode $output"
564 or return retErr($x, "cannot open file '$output': $!") ;
565 binmode $x->{fh} if $x->{Got}->valueOrDefault('BinModeOut');
569 elsif ($x->{outType} eq 'handle') {
571 binmode $x->{fh} if $x->{Got}->valueOrDefault('BinModeOut');
572 if ($x->{Got}->value('Append')) {
573 seek($x->{fh}, 0, SEEK_END)
574 or return retErr($x, "Cannot seek to end of output filehandle: $!") ;
579 elsif ($x->{outType} eq 'buffer' )
582 unless $x->{Got}->value('Append');
583 $x->{buff} = $output ;
588 defined $self->_rd2($x, $input, $output)
593 for my $element ( ($x->{inType} eq 'hash') ? keys %$input : @$input)
595 defined $self->_rd2($x, $element, $output)
601 if ( ($x->{outType} eq 'filename' && $output ne '-') ||
602 ($x->{outType} eq 'handle' && $x->{Got}->value('AutoClose'))) {
604 or return retErr($x, $!);
618 my $z = createSelfTiedObject($x->{Class}, *$self->{Error});
620 $z->_create($x->{Got}, 1, $input, @_)
628 while (($status = $z->read($x->{buff})) > 0) {
630 print $fh ${ $x->{buff} }
631 or return $z->saveErrorString(undef, "Error writing to output file: $!", $!);
632 ${ $x->{buff} } = '' ;
636 if (! $x->{oneOutput} ) {
637 my $ot = $x->{outType} ;
640 { push @$output, $x->{buff} }
641 elsif ($ot eq 'hash')
642 { $output->{$input} = $x->{buff} }
649 unless *$self->{MultiStream};
651 $status = $z->nextStream();
654 unless $status == 1 ;
657 return $z->closeError(undef)
668 return $_[0] if ref($_[0]);
682 wantarray ? @{ *$self->{InfoList} } : *$self->{Info};
691 if (defined *$self->{CompressedInputLength}) {
692 if (*$self->{CompressedInputLengthRemaining} == 0) {
693 delete *$self->{CompressedInputLength};
694 *$self->{CompressedInputLengthDone} = 1;
697 $size = min($size, *$self->{CompressedInputLengthRemaining} );
698 *$self->{CompressedInputLengthRemaining} -= $size ;
701 my $status = $self->smartRead($buff, $size) ;
702 return $self->saveErrorString(STATUS_ERROR, "Error Reading Data")
706 *$self->{Closed} = 1 ;
707 *$self->{EndStream} = 1 ;
708 return $self->saveErrorString(STATUS_ERROR, "unexpected end of file", STATUS_ERROR);
722 # >0 - ok, number of bytes read
728 return G_EOF if *$self->{Closed} ;
729 #return G_EOF if !length *$self->{Pending} && *$self->{EndStream} ;
730 return G_EOF if *$self->{EndStream} ;
733 my $scan_mode = shift ;
735 if (*$self->{Plain}) {
737 my $len = $self->smartRead(\$tmp_buff, *$self->{BlockSize}) ;
739 return $self->saveErrorString(G_ERR, "Error reading data: $!", $!)
743 *$self->{EndStream} = 1 ;
746 *$self->{PlainBytesRead} += $len ;
747 $$buffer .= $tmp_buff;
753 if (*$self->{NewStream}) {
755 $self->gotoNextStream() > 0
758 # For the headers that actually uncompressed data, put the
759 # uncompressed data into the output buffer.
760 $$buffer .= *$self->{Pending} ;
761 my $len = length *$self->{Pending} ;
762 *$self->{Pending} = '';
768 my $status = $self->readBlock(\$temp_buf, *$self->{BlockSize}, $outSize) ;
770 if $status == STATUS_ERROR ;
774 if ($status == STATUS_OK) {
775 my $beforeC_len = length $temp_buf;
776 my $before_len = defined $$buffer ? length $$buffer : 0 ;
777 $status = *$self->{Uncomp}->uncompr(\$temp_buf, $buffer,
778 defined *$self->{CompressedInputLengthDone} ||
779 $self->smartEof(), $outSize);
781 return $self->saveErrorString(G_ERR, *$self->{Uncomp}{Error}, *$self->{Uncomp}{ErrorNo})
782 if $self->saveStatus($status) == STATUS_ERROR;
784 $self->postBlockChk($buffer) == STATUS_OK
787 $self->filterUncompressed($buffer);
789 $buf_len = length($$buffer) - $before_len;
792 *$self->{CompSize}->add($beforeC_len - length $temp_buf) ;
794 *$self->{InflatedBytesRead} += $buf_len ;
795 *$self->{TotalInflatedBytesRead} += $buf_len ;
796 *$self->{UnCompSize}->add($buf_len) ;
799 if ($status == STATUS_ENDSTREAM) {
801 *$self->{EndStream} = 1 ;
802 $self->pushBack($temp_buf) ;
806 my $trailer_size = *$self->{Info}{TrailerLength} ;
808 if (*$self->{Info}{TrailerLength})
810 $got = $self->smartRead(\$trailer, $trailer_size) ;
813 if ($got == $trailer_size) {
814 $self->chkTrailer($trailer) == STATUS_OK
818 return $self->TrailerError("trailer truncated. Expected " .
819 "$trailer_size bytes, got $got")
821 $self->pushBack($trailer) ;
824 if (! $self->smartEof()) {
825 *$self->{NewStream} = 1 ;
827 if (*$self->{MultiStream}) {
828 *$self->{EndStream} = 0 ;
836 # return the number of uncompressed bytes read
844 return *$self->{Uncomp}->reset();
847 sub filterUncompressed
854 # return *$self->{NewStream} ||
855 # *$self->{EndStream} ;
862 my $status = $self->gotoNextStream();
866 *$self->{TotalInflatedBytesRead} = 0 ;
867 *$self->{LineNo} = $. = 0;
876 if (! *$self->{NewStream}) {
880 # TODO - make this more efficient if know the offset for the end of
881 # the stream and seekable
882 $status = $self->read($buffer)
889 *$self->{NewStream} = 0 ;
890 *$self->{EndStream} = 0 ;
892 *$self->{UnCompSize}->reset();
893 *$self->{CompSize}->reset();
896 unless my $magic = $self->ckMagic();
897 *$self->{Info} = $self->readHeader($magic);
900 unless defined *$self->{Info} ;
903 push @{ *$self->{InfoList} }, *$self->{Info} ;
911 return 1 if ! defined *$self->{InfoList};
912 return scalar @{ *$self->{InfoList} } ;
918 # >0 - ok, number of bytes read
924 return G_EOF if *$self->{Closed} ;
925 return G_EOF if !length *$self->{Pending} && *$self->{EndStream} ;
929 #$self->croakError(*$self->{ClassName} .
930 # "::read: buffer parameter is read-only")
931 # if Compress::Raw::Zlib::_readonly_ref($_[0]);
934 $self->croakError(*$self->{ClassName} . "::read: buffer parameter is read-only")
935 if readonly(${ $_[0] });
937 $self->croakError(*$self->{ClassName} . "::read: not a scalar reference $_[0]" )
938 unless ref $_[0] eq 'SCALAR' ;
942 $self->croakError(*$self->{ClassName} . "::read: buffer parameter is read-only")
949 my $offset = $_[2] || 0;
951 # the core read will return 0 if asked for 0 bytes
952 return 0 if defined $length && $length == 0 ;
954 $length = $length || 0;
956 $self->croakError(*$self->{ClassName} . "::read: length parameter is negative")
959 $$buffer = '' unless *$self->{AppendOutput} || $offset ;
961 # Short-circuit if this is a simple read, with no length
962 # or offset specified.
963 unless ( $length || $offset) {
964 if (length *$self->{Pending}) {
965 $$buffer .= *$self->{Pending} ;
966 my $len = length *$self->{Pending};
967 *$self->{Pending} = '' ;
972 $len = $self->_raw_read($buffer)
973 while ! *$self->{EndStream} && $len == 0 ;
978 # Need to jump through more hoops - either length or offset
979 # or both are specified.
980 my $out_buffer = \*$self->{Pending} ;
982 while (! *$self->{EndStream} && length($$out_buffer) < $length)
984 my $buf_len = $self->_raw_read($out_buffer);
989 $length = length $$out_buffer
990 if length($$out_buffer) < $length ;
993 $$buffer .= "\x00" x ($offset - length($$buffer))
994 if $offset > length($$buffer) ;
995 #substr($$buffer, $offset) = substr($$out_buffer, 0, $length, '') ;
996 substr($$buffer, $offset) = substr($$out_buffer, 0, $length) ;
997 substr($$out_buffer, 0, $length) = '' ;
1000 #$$buffer .= substr($$out_buffer, 0, $length, '') ;
1001 $$buffer .= substr($$out_buffer, 0, $length) ;
1002 substr($$out_buffer, 0, $length) = '' ;
1013 if ( ! defined $/ ) {
1015 1 while $self->read($data) > 0 ;
1016 $. = ++ *$self->{LineNo} if defined($data);
1021 if ( ! length $/ ) {
1023 while ($self->read($paragraph) > 0 ) {
1024 if ($paragraph =~ s/^(.*?\n\n+)//s) {
1025 *$self->{Pending} = $paragraph ;
1027 $. = ++ *$self->{LineNo} ;
1031 $. = ++ *$self->{LineNo} if defined($paragraph);
1038 my $endl = quotemeta($/); # quote in case $/ contains RE meta chars
1039 while ($self->read($line) > 0 ) {
1040 if ($line =~ s/^(.*?$endl)//s) {
1041 *$self->{Pending} = $line ;
1042 $. = ++ *$self->{LineNo} ;
1047 $. = ++ *$self->{LineNo} if defined($line);
1055 my $current_append = *$self->{AppendOutput} ;
1056 *$self->{AppendOutput} = 1;
1057 my $lineref = $self->_getline();
1058 *$self->{AppendOutput} = $current_append;
1065 $self->croakError(*$self->{ClassName} .
1066 "::getlines: called in scalar context\n") unless wantarray;
1068 push(@lines, $line) while defined($line = $self->getline);
1074 goto &getlines if wantarray;
1082 return $buf if $self->read($buf, 1);
1089 *$self->{Pending} = "" unless defined *$self->{Pending} ;
1090 *$self->{Pending} = $_[0] . *$self->{Pending} ;
1097 #return \"" if ! defined *$self->{Trailing} ;
1098 #return \*$self->{Trailing} ;
1100 if (defined *$self->{FH} || defined *$self->{InputEvent} ) {
1101 return *$self->{Prime} ;
1104 my $buf = *$self->{Buffer} ;
1105 my $offset = *$self->{BufferOffset} ;
1106 return substr($$buf, $offset, -1) ;
1115 return (*$self->{Closed} ||
1116 (!length *$self->{Pending}
1117 && ( $self->smartEof() || *$self->{EndStream}))) ;
1125 if (*$self->{Plain}) {
1126 $in = *$self->{PlainBytesRead} ;
1129 $in = *$self->{TotalInflatedBytesRead} ;
1132 my $pending = length *$self->{Pending} ;
1134 return 0 if $pending > $in ;
1135 return $in - $pending ;
1140 # todo - what to do if close is called before the end of the gzip file
1141 # do we remember any trailing data?
1144 return 1 if *$self->{Closed} ;
1151 if (defined *$self->{FH}) {
1152 if ((! *$self->{Handle} || *$self->{AutoClose}) && ! *$self->{StdIO}) {
1153 #if ( *$self->{AutoClose}) {
1156 $status = *$self->{FH}->close();
1157 return $self->saveErrorString(0, $!, $!)
1158 if !*$self->{InNew} && $self->saveStatus($!) != 0 ;
1160 delete *$self->{FH} ;
1163 *$self->{Closed} = 1 ;
1177 my $position = shift;
1178 my $whence = shift ;
1180 my $here = $self->tell() ;
1184 if ($whence == SEEK_SET) {
1185 $target = $position ;
1187 elsif ($whence == SEEK_CUR) {
1188 $target = $here + $position ;
1190 elsif ($whence == SEEK_END) {
1191 $target = $position ;
1192 $self->croakError(*$self->{ClassName} . "::seek: SEEK_END not allowed") ;
1195 $self->croakError(*$self->{ClassName} ."::seek: unknown value, $whence, for whence parameter");
1198 # short circuit if seeking to current offset
1199 return 1 if $target == $here ;
1201 # Outlaw any attempt to seek backwards
1202 $self->croakError( *$self->{ClassName} ."::seek: cannot seek backwards")
1203 if $target < $here ;
1205 # Walk the file to the new offset
1206 my $offset = $target - $here ;
1209 $self->read($buffer, $offset) == $offset
1218 return defined *$self->{FH}
1219 ? fileno *$self->{FH}
1226 # my $self = shift ;
1227 # return defined *$self->{FH}
1228 # ? binmode *$self->{FH}
1235 return ! *$self->{Closed} ;
1241 return defined *$self->{FH}
1242 ? *$self->{FH}->autoflush(@_)
1246 sub input_line_number
1249 my $last = *$self->{LineNo};
1250 $. = *$self->{LineNo} = $_[1] if @_ ;
1255 *BINMODE = \&binmode;
1268 #return sub { croak "$name Not Available" ; } ;
1269 return sub { croak "$name Not Available: File opened only for intput" ; } ;
1273 *print = _notAvailable('print');
1274 *PRINT = _notAvailable('print');
1275 *printf = _notAvailable('printf');
1276 *PRINTF = _notAvailable('printf');
1277 *write = _notAvailable('write');
1278 *WRITE = _notAvailable('write');
1281 #*syswrite = \&_notAvailable;
1285 package IO::Uncompress::Base ;
1294 IO::Uncompress::Base - Base Class for IO::Uncompress modules
1299 use IO::Uncompress::Base ;
1304 This module is not intended for direct use in application code. Its sole
1305 purpose if to to be sub-classed by IO::Unompress modules.
1312 L<Compress::Zlib>, L<IO::Compress::Gzip>, L<IO::Uncompress::Gunzip>, L<IO::Compress::Deflate>, L<IO::Uncompress::Inflate>, L<IO::Compress::RawDeflate>, L<IO::Uncompress::RawInflate>, L<IO::Compress::Bzip2>, L<IO::Uncompress::Bunzip2>, L<IO::Compress::Lzop>, L<IO::Uncompress::UnLzop>, L<IO::Uncompress::AnyInflate>, L<IO::Uncompress::AnyUncompress>
1314 L<Compress::Zlib::FAQ|Compress::Zlib::FAQ>
1316 L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>,
1317 L<Archive::Tar|Archive::Tar>,
1318 L<IO::Zlib|IO::Zlib>
1326 This module was written by Paul Marquess, F<pmqs@cpan.org>.
1330 =head1 MODIFICATION HISTORY
1332 See the Changes file.
1334 =head1 COPYRIGHT AND LICENSE
1336 Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
1338 This program is free software; you can redistribute it and/or
1339 modify it under the same terms as Perl itself.