use warnings;
use bytes;
-use Compress::Raw::Zlib 2.008 ;
-use IO::Compress::Base::Common 2.008 qw(:Status createSelfTiedObject);
+use Compress::Raw::Zlib 2.009 ;
+use IO::Compress::Base::Common 2.009 qw(:Status createSelfTiedObject);
-use IO::Uncompress::Base 2.008 ;
-use IO::Uncompress::Adapter::Inflate 2.008 ;
+use IO::Uncompress::Base 2.009 ;
+use IO::Uncompress::Adapter::Inflate 2.009 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $RawInflateError);
-$VERSION = '2.008';
+$VERSION = '2.009';
$RawInflateError = '';
@ISA = qw( Exporter IO::Uncompress::Base );
=head1 NAME
-
-
IO::Uncompress::RawInflate - Read RFC 1951 files/buffers
-
-
=head1 SYNOPSIS
use IO::Uncompress::RawInflate qw(rawinflate $RawInflateError) ;
eof($z)
close($z)
-
=head1 DESCRIPTION
-
-
This module provides a Perl interface that allows the reading of
files/buffers that conform to RFC 1951.
For writing RFC 1951 files/buffers, see the companion module IO::Compress::RawDeflate.
-
-
-
-
=head1 Functional Interface
A top-level function, C<rawinflate>, is provided to carry out
rawinflate $input => $output [,OPTS]
or die "rawinflate failed: $RawInflateError\n";
-
-
The functional interface needs Perl5.005 or better.
-
=head2 rawinflate $input => $output [, OPTS]
-
C<rawinflate> expects at least two parameters, C<$input> and C<$output>.
=head3 The C<$input> parameter
The complete array will be walked to ensure that it only
contains valid filenames before any data is uncompressed.
-
-
=item An Input FileGlob string
If C<$input> is a string that is delimited by the characters "<" and ">"
See L<File::GlobMapper|File::GlobMapper> for more details.
-
=back
If the C<$input> parameter is any other type, C<undef> will be returned.
-
-
=head3 The C<$output> parameter
The parameter C<$output> is used to control the destination of the
will be written to it.
The string '-' can be used as an alias for standard output.
-
=item A scalar reference
If C<$output> is a scalar reference, the uncompressed data will be
stored in C<$$output>.
-
-
=item An Array Reference
If C<$output> is an array reference, the uncompressed data will be
If the C<$output> parameter is any other type, C<undef> will be returned.
-
-
=head2 Notes
-
When C<$input> maps to multiple compressed files/buffers and C<$output> is
a single file/buffer, after uncompression C<$output> will contain a
concatenation of all the uncompressed data from each of the input
files/buffers.
-
-
-
-
=head2 Optional Parameters
Unless specified below, the optional parameters for C<rawinflate>,
This parameter defaults to 0.
-
=item C<< BinModeOut => 0|1 >>
When writing to a file or filehandle, set C<binmode> before writing to the
Defaults to 0.
-
-
-
-
=item C<< Append => 0|1 >>
TODO
=item C<< MultiStream => 0|1 >>
-
-
This option is a no-op.
-
-
-
-
=item C<< TrailingData => $scalar >>
Returns the data, if any, that is present immediately after the compressed
Don't bother using C<trailingData> if the input is a filename.
-
-
If you know the length of the compressed data stream before you start
uncompressing, you can avoid having to use C<trailingData> by setting the
C<InputLength> option.
-
-
=back
-
-
-
=head2 Examples
To read the contents of the file C<file1.txt.1951> and write the
rawinflate $input => $output
or die "rawinflate failed: $RawInflateError\n";
-
To read from an existing Perl filehandle, C<$input>, and write the
uncompressed data to a buffer, C<$buffer>.
The format of the constructor for IO::Uncompress::RawInflate is shown below
-
my $z = new IO::Uncompress::RawInflate $input [OPTS]
or die "IO::Uncompress::RawInflate failed: $RawInflateError\n";
read from it.
The string '-' can be used as an alias for standard input.
-
=item A scalar reference
If C<$input> is a scalar reference, the compressed data will be read from
=head2 Constructor Options
-
The option names defined below are case insensitive and can be optionally
prefixed by a '-'. So all of the following are valid
=item C<< MultiStream => 0|1 >>
-
-
Allows multiple concatenated compressed streams to be treated as a single
compressed stream. Decompression will stop once either the end of the
file/buffer is reached, an error is encountered (premature eof, corrupt
This parameter defaults to 0.
-
=item C<< Prime => $string >>
This option will uncompress the contents of C<$string> before processing the
the file pointer will be left pointing to the first byte directly after the
compressed data stream.
-
-
This option defaults to off.
=item C<< Append => 0|1 >>
=item C<< Strict => 0|1 >>
-
-
This option is a no-op.
-
-
-
-
-
-
=back
=head2 Examples
Returns the number of uncompressed bytes written to C<$buffer>, zero if eof
or a negative number on error.
-
=head2 getline
Usage is
determine what constitutes an end of line. Paragraph mode, record mode and
file slurp mode are all supported.
-
=head2 getc
Usage is
$char = $z->ungetc($string)
-
-
=head2 inflateSync
Usage is
TODO
-
=head2 getHeaderInfo
Usage is
or hash references (in array context) that contains information about each
of the header fields in the compressed data stream(s).
-
-
-
=head2 tell
Usage is
$z->eof();
eof($z);
-
-
Returns true if the end of the compressed input stream has been reached.
-
-
=head2 seek
$z->seek($position, $whence);
seek($z, $position, $whence);
-
-
-
Provides a sub-set of the C<seek> functionality, with the restriction
that it is only legal to seek forward in the input file/buffer.
It is a fatal error to attempt to seek backward.
-
-
The C<$whence> parameter takes one the usual values, namely SEEK_SET,
SEEK_CUR or SEEK_END.
$z->input_line_number()
$z->input_line_number(EXPR)
-
-
Returns the current uncompressed line number. If C<EXPR> is present it has
the effect of setting the line number. Note that setting the line number
does not change the current position within the file/buffer being read.
The contents of C<$/> are used to to determine what constitutes a line
terminator.
-
-
=head2 fileno
$z->fileno()
fileno($z)
-If the C<$z> object is associated with a file or a filehandle, this method
-will return the underlying file descriptor.
+If the C<$z> object is associated with a file or a filehandle, C<fileno>
+will return the underlying file descriptor. Once the C<close> method is
+called C<fileno> will return C<undef>.
-If the C<$z> object is is associated with a buffer, this method will
-return undef.
+If the C<$z> object is is associated with a buffer, this method will return
+C<undef>.
=head2 close
$z->close() ;
close $z ;
-
-
Closes the output file/buffer.
-
-
For most versions of Perl this method will be automatically invoked if
the IO::Uncompress::RawInflate object is destroyed (either explicitly or by the
variable with the reference to the object going out of scope). The
object was created, and the object is associated with a file, the
underlying file will also be closed.
-
-
-
=head2 nextStream
Usage is
Don't bother using C<trailingData> if the input is a filename.
-
-
If you know the length of the compressed data stream before you start
uncompressing, you can avoid having to use C<trailingData> by setting the
C<InputLength> option in the constructor.
=head1 EXAMPLES
+=head2 Working with Net::FTP
-
+See L<IO::Uncompress::RawInflate::FAQ|IO::Uncompress::RawInflate::FAQ/"Compressed files and Net::FTP">
=head1 SEE ALSO
L<Archive::Tar|Archive::Tar>,
L<IO::Zlib|IO::Zlib>
-
For RFC 1950, 1951 and 1952 see
F<http://www.faqs.org/rfcs/rfc1950.html>,
F<http://www.faqs.org/rfcs/rfc1951.html> and
The primary site for gzip is F<http://www.gzip.org>.
-
-
-
=head1 AUTHOR
This module was written by Paul Marquess, F<pmqs@cpan.org>.
-
-
=head1 MODIFICATION HISTORY
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-Copyright (c) 2005-2007 Paul Marquess. All rights reserved.
+Copyright (c) 2005-2008 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.