Filename | /usr/local/perls/perl-5.26.1/lib/5.26.1/IO/Compress/Adapter/Deflate.pm |
Statements | Executed 20 statements in 1.04ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 25µs | 28µs | BEGIN@3 | IO::Compress::Adapter::Deflate::
1 | 1 | 1 | 16µs | 158µs | BEGIN@7 | IO::Compress::Adapter::Deflate::
1 | 1 | 1 | 16µs | 439µs | BEGIN@8 | IO::Compress::Adapter::Deflate::
1 | 1 | 1 | 11µs | 24µs | BEGIN@4 | IO::Compress::Adapter::Deflate::
1 | 1 | 1 | 10µs | 13µs | BEGIN@5 | IO::Compress::Adapter::Deflate::
0 | 0 | 0 | 0s | 0s | adler32 | IO::Compress::Adapter::Deflate::
0 | 0 | 0 | 0s | 0s | close | IO::Compress::Adapter::Deflate::
0 | 0 | 0 | 0s | 0s | compr | IO::Compress::Adapter::Deflate::
0 | 0 | 0 | 0s | 0s | compressedBytes | IO::Compress::Adapter::Deflate::
0 | 0 | 0 | 0s | 0s | crc32 | IO::Compress::Adapter::Deflate::
0 | 0 | 0 | 0s | 0s | deflateParams | IO::Compress::Adapter::Deflate::
0 | 0 | 0 | 0s | 0s | flush | IO::Compress::Adapter::Deflate::
0 | 0 | 0 | 0s | 0s | mkCompObject | IO::Compress::Adapter::Deflate::
0 | 0 | 0 | 0s | 0s | reset | IO::Compress::Adapter::Deflate::
0 | 0 | 0 | 0s | 0s | uncompressedBytes | IO::Compress::Adapter::Deflate::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package IO::Compress::Adapter::Deflate ; | ||||
2 | |||||
3 | 2 | 34µs | 2 | 31µs | # spent 28µs (25+3) within IO::Compress::Adapter::Deflate::BEGIN@3 which was called:
# once (25µs+3µs) by IO::Compress::RawDeflate::BEGIN@11 at line 3 # spent 28µs making 1 call to IO::Compress::Adapter::Deflate::BEGIN@3
# spent 3µs making 1 call to strict::import |
4 | 2 | 31µs | 2 | 37µs | # spent 24µs (11+13) within IO::Compress::Adapter::Deflate::BEGIN@4 which was called:
# once (11µs+13µs) by IO::Compress::RawDeflate::BEGIN@11 at line 4 # spent 24µs making 1 call to IO::Compress::Adapter::Deflate::BEGIN@4
# spent 13µs making 1 call to warnings::import |
5 | 2 | 39µs | 2 | 16µs | # spent 13µs (10+3) within IO::Compress::Adapter::Deflate::BEGIN@5 which was called:
# once (10µs+3µs) by IO::Compress::RawDeflate::BEGIN@11 at line 5 # spent 13µs making 1 call to IO::Compress::Adapter::Deflate::BEGIN@5
# spent 3µs making 1 call to bytes::import |
6 | |||||
7 | 3 | 58µs | 3 | 300µs | # spent 158µs (16+142) within IO::Compress::Adapter::Deflate::BEGIN@7 which was called:
# once (16µs+142µs) by IO::Compress::RawDeflate::BEGIN@11 at line 7 # spent 158µs making 1 call to IO::Compress::Adapter::Deflate::BEGIN@7
# spent 132µs making 1 call to Exporter::import
# spent 10µs making 1 call to version::_VERSION |
8 | 3 | 841µs | 3 | 862µs | # spent 439µs (16+423) within IO::Compress::Adapter::Deflate::BEGIN@8 which was called:
# once (16µs+423µs) by IO::Compress::RawDeflate::BEGIN@11 at line 8 # spent 439µs making 1 call to IO::Compress::Adapter::Deflate::BEGIN@8
# spent 413µs making 1 call to Exporter::import
# spent 10µs making 1 call to version::_VERSION |
9 | |||||
10 | 1 | 1µs | require Exporter; | ||
11 | our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, @EXPORT, %DEFLATE_CONSTANTS); | ||||
12 | |||||
13 | 1 | 1µs | $VERSION = '2.074'; | ||
14 | 1 | 9µs | @ISA = qw(Exporter); | ||
15 | 1 | 7µs | @EXPORT_OK = @Compress::Raw::Zlib::DEFLATE_CONSTANTS; | ||
16 | 1 | 5µs | %EXPORT_TAGS = %Compress::Raw::Zlib::DEFLATE_CONSTANTS; | ||
17 | 1 | 4µs | @EXPORT = @EXPORT_OK; | ||
18 | 1 | 2µs | %DEFLATE_CONSTANTS = %EXPORT_TAGS ; | ||
19 | |||||
20 | sub mkCompObject | ||||
21 | { | ||||
22 | my $crc32 = shift ; | ||||
23 | my $adler32 = shift ; | ||||
24 | my $level = shift ; | ||||
25 | my $strategy = shift ; | ||||
26 | |||||
27 | my ($def, $status) = new Compress::Raw::Zlib::Deflate | ||||
28 | -AppendOutput => 1, | ||||
29 | -CRC32 => $crc32, | ||||
30 | -ADLER32 => $adler32, | ||||
31 | -Level => $level, | ||||
32 | -Strategy => $strategy, | ||||
33 | -WindowBits => - MAX_WBITS; | ||||
34 | |||||
35 | return (undef, "Cannot create Deflate object: $status", $status) | ||||
36 | if $status != Z_OK; | ||||
37 | |||||
38 | return bless {'Def' => $def, | ||||
39 | 'Error' => '', | ||||
40 | } ; | ||||
41 | } | ||||
42 | |||||
43 | sub compr | ||||
44 | { | ||||
45 | my $self = shift ; | ||||
46 | |||||
47 | my $def = $self->{Def}; | ||||
48 | |||||
49 | my $status = $def->deflate($_[0], $_[1]) ; | ||||
50 | $self->{ErrorNo} = $status; | ||||
51 | |||||
52 | if ($status != Z_OK) | ||||
53 | { | ||||
54 | $self->{Error} = "Deflate Error: $status"; | ||||
55 | return STATUS_ERROR; | ||||
56 | } | ||||
57 | |||||
58 | return STATUS_OK; | ||||
59 | } | ||||
60 | |||||
61 | sub flush | ||||
62 | { | ||||
63 | my $self = shift ; | ||||
64 | |||||
65 | my $def = $self->{Def}; | ||||
66 | |||||
67 | my $opt = $_[1] || Z_FINISH; | ||||
68 | my $status = $def->flush($_[0], $opt); | ||||
69 | $self->{ErrorNo} = $status; | ||||
70 | |||||
71 | if ($status != Z_OK) | ||||
72 | { | ||||
73 | $self->{Error} = "Deflate Error: $status"; | ||||
74 | return STATUS_ERROR; | ||||
75 | } | ||||
76 | |||||
77 | return STATUS_OK; | ||||
78 | } | ||||
79 | |||||
80 | sub close | ||||
81 | { | ||||
82 | my $self = shift ; | ||||
83 | |||||
84 | my $def = $self->{Def}; | ||||
85 | |||||
86 | $def->flush($_[0], Z_FINISH) | ||||
87 | if defined $def ; | ||||
88 | } | ||||
89 | |||||
90 | sub reset | ||||
91 | { | ||||
92 | my $self = shift ; | ||||
93 | |||||
94 | my $def = $self->{Def}; | ||||
95 | |||||
96 | my $status = $def->deflateReset() ; | ||||
97 | $self->{ErrorNo} = $status; | ||||
98 | if ($status != Z_OK) | ||||
99 | { | ||||
100 | $self->{Error} = "Deflate Error: $status"; | ||||
101 | return STATUS_ERROR; | ||||
102 | } | ||||
103 | |||||
104 | return STATUS_OK; | ||||
105 | } | ||||
106 | |||||
107 | sub deflateParams | ||||
108 | { | ||||
109 | my $self = shift ; | ||||
110 | |||||
111 | my $def = $self->{Def}; | ||||
112 | |||||
113 | my $status = $def->deflateParams(@_); | ||||
114 | $self->{ErrorNo} = $status; | ||||
115 | if ($status != Z_OK) | ||||
116 | { | ||||
117 | $self->{Error} = "deflateParams Error: $status"; | ||||
118 | return STATUS_ERROR; | ||||
119 | } | ||||
120 | |||||
121 | return STATUS_OK; | ||||
122 | } | ||||
123 | |||||
- - | |||||
126 | #sub total_out | ||||
127 | #{ | ||||
128 | # my $self = shift ; | ||||
129 | # $self->{Def}->total_out(); | ||||
130 | #} | ||||
131 | # | ||||
132 | #sub total_in | ||||
133 | #{ | ||||
134 | # my $self = shift ; | ||||
135 | # $self->{Def}->total_in(); | ||||
136 | #} | ||||
137 | |||||
138 | sub compressedBytes | ||||
139 | { | ||||
140 | my $self = shift ; | ||||
141 | |||||
142 | $self->{Def}->compressedBytes(); | ||||
143 | } | ||||
144 | |||||
145 | sub uncompressedBytes | ||||
146 | { | ||||
147 | my $self = shift ; | ||||
148 | $self->{Def}->uncompressedBytes(); | ||||
149 | } | ||||
150 | |||||
- - | |||||
154 | sub crc32 | ||||
155 | { | ||||
156 | my $self = shift ; | ||||
157 | $self->{Def}->crc32(); | ||||
158 | } | ||||
159 | |||||
160 | sub adler32 | ||||
161 | { | ||||
162 | my $self = shift ; | ||||
163 | $self->{Def}->adler32(); | ||||
164 | } | ||||
165 | |||||
166 | |||||
167 | 1 | 10µs | 1; | ||
168 | |||||
169 | __END__ |