IO::Compress::* 2.000_13
[p5sagit/p5-mst-13.2.git] / ext / Compress / IO / Zlib / lib / IO / Uncompress / Gunzip.pm
index d665103..5eab533 100644 (file)
@@ -28,7 +28,7 @@ Exporter::export_ok_tags('all');
 
 $GunzipError = '';
 
-$VERSION = '2.000_12';
+$VERSION = '2.000_13';
 
 sub new
 {
@@ -105,7 +105,7 @@ sub chkTrailer
         return $self->TrailerError("CRC mismatch")
             if $CRC32 != *$self->{Uncomp}->crc32() ;
 
-        my $exp_isize = *$self->{Uncomp}->uncompressedBytes();
+        my $exp_isize = *$self->{UnCompSize}->get32bit();
         return $self->TrailerError("ISIZE mismatch. Got $ISIZE"
                                   . ", expected $exp_isize")
             if $ISIZE != $exp_isize ;
@@ -304,7 +304,8 @@ IO::Uncompress::Gunzip - Read RFC 1952 files/buffers
 
     $status = $z->inflateSync()
 
-    $z->trailingData()
+    $data = $z->trailingData()
+    $status = $z->nextStream()
     $data = $z->getHeaderInfo()
     $z->tell()
     $z->seek($position, $whence)
@@ -505,7 +506,7 @@ L</"Constructor Options"> section below.
 
 =over 5
 
-=item AutoClose =E<gt> 0|1
+=item C<< AutoClose => 0|1 >>
 
 This option applies to any input or output data streams to 
 C<gunzip> that are filehandles.
@@ -517,8 +518,7 @@ completed.
 This parameter defaults to 0.
 
 
-
-=item BinModeOut =E<gt> 0|1
+=item C<< BinModeOut => 0|1 >>
 
 When writing to a file or filehandle, set C<binmode> before writing to the
 file.
@@ -529,15 +529,16 @@ Defaults to 0.
 
 
 
-=item -Append =E<gt> 0|1
+=item C<< Append => 0|1 >>
 
 TODO
 
-=item -MultiStream =E<gt> 0|1
+=item C<< MultiStream => 0|1 >>
 
-Creates a new stream after each file.
+If the input file/buffer contains multiple compressed data streams, this
+option will uncompress the whole lot as a single data stream.
 
-Defaults to 1.
+Defaults to 0.
 
 
 
@@ -659,7 +660,7 @@ OPTS is a combination of the following options:
 
 =over 5
 
-=item -AutoClose =E<gt> 0|1
+=item C<< AutoClose => 0|1 >>
 
 This option is only valid when the C<$input> parameter is a filehandle. If
 specified, and the value is true, it will result in the file being closed once
@@ -668,7 +669,7 @@ destroyed.
 
 This parameter defaults to 0.
 
-=item -MultiStream =E<gt> 0|1
+=item C<< MultiStream => 0|1 >>
 
 
 
@@ -681,8 +682,7 @@ start of another stream.
 This parameter defaults to 0.
 
 
-
-=item -Prime =E<gt> $string
+=item C<< Prime => $string >>
 
 This option will uncompress the contents of C<$string> before processing the
 input file/buffer.
@@ -693,21 +693,21 @@ data begins without having to read the first few bytes. If this is the
 case, the uncompression can be I<primed> with these bytes using this
 option.
 
-=item -Transparent =E<gt> 0|1
+=item C<< Transparent => 0|1 >>
 
 If this option is set and the input file or buffer is not compressed data,
 the module will allow reading of it anyway.
 
 This option defaults to 1.
 
-=item -BlockSize =E<gt> $num
+=item C<< BlockSize => $num >>
 
 When reading the compressed input data, IO::Uncompress::Gunzip will read it in
 blocks of C<$num> bytes.
 
 This option defaults to 4096.
 
-=item -InputLength =E<gt> $size
+=item C<< InputLength => $size >>
 
 When present this option will limit the number of compressed bytes read
 from the input file/buffer to C<$size>. This option can be used in the
@@ -723,7 +723,7 @@ compressed data stream.
 
 This option defaults to off.
 
-=item -Append =E<gt> 0|1
+=item C<< Append => 0|1 >>
 
 This option controls what the C<read> method does with uncompressed data.
 
@@ -735,7 +735,7 @@ will be overwritten by the uncompressed data.
 
 Defaults to 0.
 
-=item -Strict =E<gt> 0|1
+=item C<< Strict => 0|1 >>
 
 
 
@@ -796,7 +796,7 @@ uncompressed data actually read from the file.
 
 
 
-=item -ParseExtra =E<gt> 0|1
+=item C<< ParseExtra => 0|1 >>
 
 If the gzip FEXTRA header field is present and this option is set, it will
 force the module to check that it conforms to the sub-field structure as
@@ -1057,6 +1057,27 @@ underlying file will also be closed.
 
 
 
+=head2 nextStream
+
+Usage is
+
+    my $status = $z->nextStream();
+
+Skips to the next compressed data stream in the input file/buffer. If a new
+compressed data stream is found, the eof marker will be cleared, C<$.> will
+be reset to 0.
+
+Returns 1 if a new stream was found, 0 if none was found, and -1 if an
+error was encountered.
+
+=head2 trailingData
+
+Usage is
+
+    my $data = $z->trailingData();
+
+Returns any data that 
+
 =head1 Importing 
 
 No symbolic constants are required by this IO::Uncompress::Gunzip at present.