1 package IO::Uncompress::Adapter::Bunzip2;
7 use IO::Compress::Base::Common 2.096 qw(:Status);
9 use Compress::Raw::Bzip2 2.096 ;
16 my $small = shift || 0;
17 my $verbosity = shift || 0;
19 my ($inflate, $status) = new Compress::Raw::Bunzip2(1, 1, $small, $verbosity, 1);
21 return (undef, "Could not create Inflation object: $status", $status)
24 return bless {'Inf' => $inflate,
40 my $inf = $self->{Inf};
42 my $status = $inf->bzinflate($from, $to);
43 $self->{ErrorNo} = $status;
45 if ($status != BZ_OK && $status != BZ_STREAM_END )
47 $self->{Error} = "Inflation Error: $status";
52 return STATUS_OK if $status == BZ_OK ;
53 return STATUS_ENDSTREAM if $status == BZ_STREAM_END ;
62 my ($inf, $status) = new Compress::Raw::Bunzip2();
63 $self->{ErrorNo} = ($status == BZ_OK) ? 0 : $status ;
67 $self->{Error} = "Cannot create Inflate object: $status";
79 $self->{Inf}->compressedBytes();
85 $self->{Inf}->uncompressedBytes();
91 #$self->{Inf}->crc32();
97 #$self->{Inf}->adler32();
103 #( $self->{Inf}->inflateSync(@_) == BZ_OK)