← Index
NYTProf Performance Profile   « block view • line view • sub view »
For ddd2.pl
  Run on Tue May 25 16:52:24 2010
Reported on Tue May 25 16:57:05 2010

File /project/perl/lib/IO/Uncompress/Adapter/Inflate.pm
Statements Executed 18
Statement Execution Time 2.26ms
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
0000s0sIO::Uncompress::Adapter::Inflate::::BEGINIO::Uncompress::Adapter::Inflate::BEGIN
0000s0sIO::Uncompress::Adapter::Inflate::::adler32IO::Uncompress::Adapter::Inflate::adler32
0000s0sIO::Uncompress::Adapter::Inflate::::compressedBytesIO::Uncompress::Adapter::Inflate::compressedBytes
0000s0sIO::Uncompress::Adapter::Inflate::::crc32IO::Uncompress::Adapter::Inflate::crc32
0000s0sIO::Uncompress::Adapter::Inflate::::createDeflateStreamIO::Uncompress::Adapter::Inflate::createDeflateStream
0000s0sIO::Uncompress::Adapter::Inflate::::getEndOffsetIO::Uncompress::Adapter::Inflate::getEndOffset
0000s0sIO::Uncompress::Adapter::Inflate::::getLastBlockOffsetIO::Uncompress::Adapter::Inflate::getLastBlockOffset
0000s0sIO::Uncompress::Adapter::Inflate::::mkUncompObjectIO::Uncompress::Adapter::Inflate::mkUncompObject
0000s0sIO::Uncompress::Adapter::Inflate::::resetIO::Uncompress::Adapter::Inflate::reset
0000s0sIO::Uncompress::Adapter::Inflate::::resetLastBlockByteIO::Uncompress::Adapter::Inflate::resetLastBlockByte
0000s0sIO::Uncompress::Adapter::Inflate::::syncIO::Uncompress::Adapter::Inflate::sync
0000s0sIO::Uncompress::Adapter::Inflate::::uncomprIO::Uncompress::Adapter::Inflate::uncompr
0000s0sIO::Uncompress::Adapter::Inflate::::uncompressedBytesIO::Uncompress::Adapter::Inflate::uncompressedBytes
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package IO::Uncompress::Adapter::Inflate;
2
3394µs125µsuse strict;
# spent 25µs making 1 call to strict::import
4383µs1112µsuse warnings;
# spent 112µs making 1 call to warnings::import
53118µs115µsuse bytes;
# spent 15µs making 1 call to bytes::import
6
73391µs2978µsuse IO::Compress::Base::Common 2.005 qw(:Status);
# spent 760µs making 1 call to Exporter::import # spent 218µs making 1 call to UNIVERSAL::VERSION
831.55ms2538µsuse Compress::Raw::Zlib 2.005 qw(Z_OK Z_DATA_ERROR Z_STREAM_END Z_FINISH MAX_WBITS);
# spent 320µs making 1 call to Exporter::import # spent 218µs making 1 call to UNIVERSAL::VERSION
9
1015µsour ($VERSION);
1116µs$VERSION = '2.005';
12
13
14
15sub mkUncompObject
16{
17 my $crc32 = shift || 1;
18 my $adler32 = shift || 1;
19 my $scan = shift || 0;
20
21 my $inflate ;
22 my $status ;
23
24 if ($scan)
25 {
26 ($inflate, $status) = new Compress::Raw::Zlib::InflateScan
27 CRC32 => $crc32,
28 ADLER32 => $adler32,
29 WindowBits => - MAX_WBITS ;
30 }
31 else
32 {
33 ($inflate, $status) = new Compress::Raw::Zlib::Inflate
34 AppendOutput => 1,
35 CRC32 => $crc32,
36 ADLER32 => $adler32,
37 WindowBits => - MAX_WBITS ;
38 }
39
40 return (undef, "Could not create Inflation object: $status", $status)
41 if $status != Z_OK ;
42
43 return bless {'Inf' => $inflate,
44 'CompSize' => 0,
45 'UnCompSize' => 0,
46 'Error' => '',
47 } ;
48
49}
50
51sub uncompr
52{
53 my $self = shift ;
54 my $from = shift ;
55 my $to = shift ;
56 my $eof = shift ;
57
58 my $inf = $self->{Inf};
59
60 my $status = $inf->inflate($from, $to, $eof);
61 $self->{ErrorNo} = $status;
62
63 if ($status != Z_STREAM_END && $eof)
64 {
65 $self->{Error} = "unexpected end of file";
66 return STATUS_ERROR;
67 }
68
69 if ($status != Z_OK && $status != Z_STREAM_END )
70 {
71 $self->{Error} = "Inflation Error: $status";
72 return STATUS_ERROR;
73 }
74
75
76 return STATUS_OK if $status == Z_OK ;
77 return STATUS_ENDSTREAM if $status == Z_STREAM_END ;
78 return STATUS_ERROR ;
79}
80
81sub reset
82{
83 my $self = shift ;
84 $self->{Inf}->inflateReset();
85
86 return STATUS_OK ;
87}
88
89#sub count
90#{
91# my $self = shift ;
92# $self->{Inf}->inflateCount();
93#}
94
95sub crc32
96{
97 my $self = shift ;
98 $self->{Inf}->crc32();
99}
100
101sub compressedBytes
102{
103 my $self = shift ;
104 $self->{Inf}->compressedBytes();
105}
106
107sub uncompressedBytes
108{
109 my $self = shift ;
110 $self->{Inf}->uncompressedBytes();
111}
112
113sub adler32
114{
115 my $self = shift ;
116 $self->{Inf}->adler32();
117}
118
119sub sync
120{
121 my $self = shift ;
122 ( $self->{Inf}->inflateSync(@_) == Z_OK)
123 ? STATUS_OK
124 : STATUS_ERROR ;
125}
126
127
128sub getLastBlockOffset
129{
130 my $self = shift ;
131 $self->{Inf}->getLastBlockOffset();
132}
133
134sub getEndOffset
135{
136 my $self = shift ;
137 $self->{Inf}->getEndOffset();
138}
139
140sub resetLastBlockByte
141{
142 my $self = shift ;
143 $self->{Inf}->resetLastBlockByte(@_);
144}
145
146sub createDeflateStream
147{
148 my $self = shift ;
149 my $deflate = $self->{Inf}->createDeflateStream(@_);
150 return bless {'Def' => $deflate,
151 'CompSize' => 0,
152 'UnCompSize' => 0,
153 'Error' => '',
154 }, 'IO::Compress::Adapter::Deflate';
155}
156
157113µs1;
158
159
160__END__
161