Filename | /Users/ether/perl5/perlbrew/perls/36.0/lib/5.36.0/IO/Uncompress/Adapter/Inflate.pm |
Statements | Executed 14 statements in 1.04ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 46µs | 50µs | BEGIN@3 | IO::Uncompress::Adapter::Inflate::
1 | 1 | 1 | 17µs | 118µs | BEGIN@7 | IO::Uncompress::Adapter::Inflate::
1 | 1 | 1 | 11µs | 53µs | BEGIN@8 | IO::Uncompress::Adapter::Inflate::
1 | 1 | 1 | 7µs | 33µs | BEGIN@4 | IO::Uncompress::Adapter::Inflate::
1 | 1 | 1 | 7µs | 9µs | BEGIN@5 | IO::Uncompress::Adapter::Inflate::
0 | 0 | 0 | 0s | 0s | adler32 | IO::Uncompress::Adapter::Inflate::
0 | 0 | 0 | 0s | 0s | compressedBytes | IO::Uncompress::Adapter::Inflate::
0 | 0 | 0 | 0s | 0s | crc32 | IO::Uncompress::Adapter::Inflate::
0 | 0 | 0 | 0s | 0s | createDeflateStream | IO::Uncompress::Adapter::Inflate::
0 | 0 | 0 | 0s | 0s | getEndOffset | IO::Uncompress::Adapter::Inflate::
0 | 0 | 0 | 0s | 0s | getLastBlockOffset | IO::Uncompress::Adapter::Inflate::
0 | 0 | 0 | 0s | 0s | mkUncompObject | IO::Uncompress::Adapter::Inflate::
0 | 0 | 0 | 0s | 0s | reset | IO::Uncompress::Adapter::Inflate::
0 | 0 | 0 | 0s | 0s | resetLastBlockByte | IO::Uncompress::Adapter::Inflate::
0 | 0 | 0 | 0s | 0s | sync | IO::Uncompress::Adapter::Inflate::
0 | 0 | 0 | 0s | 0s | uncompr | IO::Uncompress::Adapter::Inflate::
0 | 0 | 0 | 0s | 0s | uncompressedBytes | IO::Uncompress::Adapter::Inflate::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package IO::Uncompress::Adapter::Inflate; | ||||
2 | |||||
3 | 2 | 58µs | 2 | 54µs | # spent 50µs (46+4) within IO::Uncompress::Adapter::Inflate::BEGIN@3 which was called:
# once (46µs+4µs) by IO::Uncompress::RawInflate::BEGIN@12 at line 3 # spent 50µs making 1 call to IO::Uncompress::Adapter::Inflate::BEGIN@3
# spent 4µs making 1 call to strict::import |
4 | 2 | 21µs | 2 | 59µs | # spent 33µs (7+26) within IO::Uncompress::Adapter::Inflate::BEGIN@4 which was called:
# once (7µs+26µs) by IO::Uncompress::RawInflate::BEGIN@12 at line 4 # spent 33µs making 1 call to IO::Uncompress::Adapter::Inflate::BEGIN@4
# spent 26µs making 1 call to warnings::import |
5 | 2 | 73µs | 2 | 11µs | # spent 9µs (7+2) within IO::Uncompress::Adapter::Inflate::BEGIN@5 which was called:
# once (7µs+2µs) by IO::Uncompress::RawInflate::BEGIN@12 at line 5 # spent 9µs making 1 call to IO::Uncompress::Adapter::Inflate::BEGIN@5
# spent 2µs making 1 call to bytes::import |
6 | |||||
7 | 3 | 54µs | 3 | 219µs | # spent 118µs (17+101) within IO::Uncompress::Adapter::Inflate::BEGIN@7 which was called:
# once (17µs+101µs) by IO::Uncompress::RawInflate::BEGIN@12 at line 7 # spent 118µs making 1 call to IO::Uncompress::Adapter::Inflate::BEGIN@7
# spent 91µs making 1 call to Exporter::import
# spent 10µs making 1 call to UNIVERSAL::VERSION |
8 | 3 | 826µs | 3 | 95µs | # spent 53µs (11+42) within IO::Uncompress::Adapter::Inflate::BEGIN@8 which was called:
# once (11µs+42µs) by IO::Uncompress::RawInflate::BEGIN@12 at line 8 # spent 53µs making 1 call to IO::Uncompress::Adapter::Inflate::BEGIN@8
# spent 35µs making 1 call to Exporter::import
# spent 7µs making 1 call to UNIVERSAL::VERSION |
9 | |||||
10 | our ($VERSION); | ||||
11 | 1 | 0s | $VERSION = '2.106'; | ||
12 | |||||
- - | |||||
15 | sub 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) = Compress::Raw::Zlib::InflateScan->new( | ||||
27 | #LimitOutput => 1, | ||||
28 | CRC32 => $crc32, | ||||
29 | ADLER32 => $adler32, | ||||
30 | WindowBits => - MAX_WBITS ); | ||||
31 | } | ||||
32 | else | ||||
33 | { | ||||
34 | ($inflate, $status) = Compress::Raw::Zlib::Inflate->new( | ||||
35 | AppendOutput => 1, | ||||
36 | LimitOutput => 1, | ||||
37 | CRC32 => $crc32, | ||||
38 | ADLER32 => $adler32, | ||||
39 | WindowBits => - MAX_WBITS ); | ||||
40 | } | ||||
41 | |||||
42 | return (undef, "Could not create Inflation object: $status", $status) | ||||
43 | if $status != Z_OK ; | ||||
44 | |||||
45 | return bless {'Inf' => $inflate, | ||||
46 | 'CompSize' => 0, | ||||
47 | 'UnCompSize' => 0, | ||||
48 | 'Error' => '', | ||||
49 | 'ConsumesInput' => 1, | ||||
50 | } ; | ||||
51 | |||||
52 | } | ||||
53 | |||||
54 | sub uncompr | ||||
55 | { | ||||
56 | my $self = shift ; | ||||
57 | my $from = shift ; | ||||
58 | my $to = shift ; | ||||
59 | my $eof = shift ; | ||||
60 | |||||
61 | my $inf = $self->{Inf}; | ||||
62 | |||||
63 | my $status = $inf->inflate($from, $to, $eof); | ||||
64 | $self->{ErrorNo} = $status; | ||||
65 | if ($status != Z_OK && $status != Z_STREAM_END && $status != Z_BUF_ERROR) | ||||
66 | { | ||||
67 | $self->{Error} = "Inflation Error: $status"; | ||||
68 | return STATUS_ERROR; | ||||
69 | } | ||||
70 | |||||
71 | return STATUS_OK if $status == Z_BUF_ERROR ; # ??? | ||||
72 | return STATUS_OK if $status == Z_OK ; | ||||
73 | return STATUS_ENDSTREAM if $status == Z_STREAM_END ; | ||||
74 | return STATUS_ERROR ; | ||||
75 | } | ||||
76 | |||||
77 | sub reset | ||||
78 | { | ||||
79 | my $self = shift ; | ||||
80 | $self->{Inf}->inflateReset(); | ||||
81 | |||||
82 | return STATUS_OK ; | ||||
83 | } | ||||
84 | |||||
85 | #sub count | ||||
86 | #{ | ||||
87 | # my $self = shift ; | ||||
88 | # $self->{Inf}->inflateCount(); | ||||
89 | #} | ||||
90 | |||||
91 | sub crc32 | ||||
92 | { | ||||
93 | my $self = shift ; | ||||
94 | $self->{Inf}->crc32(); | ||||
95 | } | ||||
96 | |||||
97 | sub compressedBytes | ||||
98 | { | ||||
99 | my $self = shift ; | ||||
100 | $self->{Inf}->compressedBytes(); | ||||
101 | } | ||||
102 | |||||
103 | sub uncompressedBytes | ||||
104 | { | ||||
105 | my $self = shift ; | ||||
106 | $self->{Inf}->uncompressedBytes(); | ||||
107 | } | ||||
108 | |||||
109 | sub adler32 | ||||
110 | { | ||||
111 | my $self = shift ; | ||||
112 | $self->{Inf}->adler32(); | ||||
113 | } | ||||
114 | |||||
115 | sub sync | ||||
116 | { | ||||
117 | my $self = shift ; | ||||
118 | ( $self->{Inf}->inflateSync(@_) == Z_OK) | ||||
119 | ? STATUS_OK | ||||
120 | : STATUS_ERROR ; | ||||
121 | } | ||||
122 | |||||
123 | |||||
124 | sub getLastBlockOffset | ||||
125 | { | ||||
126 | my $self = shift ; | ||||
127 | $self->{Inf}->getLastBlockOffset(); | ||||
128 | } | ||||
129 | |||||
130 | sub getEndOffset | ||||
131 | { | ||||
132 | my $self = shift ; | ||||
133 | $self->{Inf}->getEndOffset(); | ||||
134 | } | ||||
135 | |||||
136 | sub resetLastBlockByte | ||||
137 | { | ||||
138 | my $self = shift ; | ||||
139 | $self->{Inf}->resetLastBlockByte(@_); | ||||
140 | } | ||||
141 | |||||
142 | sub createDeflateStream | ||||
143 | { | ||||
144 | my $self = shift ; | ||||
145 | my $deflate = $self->{Inf}->createDeflateStream(@_); | ||||
146 | return bless {'Def' => $deflate, | ||||
147 | 'CompSize' => 0, | ||||
148 | 'UnCompSize' => 0, | ||||
149 | 'Error' => '', | ||||
150 | }, 'IO::Compress::Adapter::Deflate'; | ||||
151 | } | ||||
152 | |||||
153 | 1 | 5µs | 1; | ||
154 | |||||
155 | |||||
156 | __END__ |