| Filename | /usr/local/perls/perl-5.26.1/lib/5.26.1/IO/Compress/Adapter/Bzip2.pm |
| Statements | Executed 14 statements in 871µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 30µs | 33µs | IO::Compress::Adapter::Bzip2::BEGIN@3 |
| 1 | 1 | 1 | 18µs | 134µs | IO::Compress::Adapter::Bzip2::BEGIN@9 |
| 1 | 1 | 1 | 17µs | 184µs | IO::Compress::Adapter::Bzip2::BEGIN@7 |
| 1 | 1 | 1 | 14µs | 22µs | IO::Compress::Adapter::Bzip2::BEGIN@4 |
| 1 | 1 | 1 | 9µs | 11µs | IO::Compress::Adapter::Bzip2::BEGIN@5 |
| 0 | 0 | 0 | 0s | 0s | IO::Compress::Adapter::Bzip2::close |
| 0 | 0 | 0 | 0s | 0s | IO::Compress::Adapter::Bzip2::compr |
| 0 | 0 | 0 | 0s | 0s | IO::Compress::Adapter::Bzip2::compressedBytes |
| 0 | 0 | 0 | 0s | 0s | IO::Compress::Adapter::Bzip2::flush |
| 0 | 0 | 0 | 0s | 0s | IO::Compress::Adapter::Bzip2::mkCompObject |
| 0 | 0 | 0 | 0s | 0s | IO::Compress::Adapter::Bzip2::reset |
| 0 | 0 | 0 | 0s | 0s | IO::Compress::Adapter::Bzip2::uncompressedBytes |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package IO::Compress::Adapter::Bzip2 ; | ||||
| 2 | |||||
| 3 | 2 | 38µs | 2 | 36µs | # spent 33µs (30+3) within IO::Compress::Adapter::Bzip2::BEGIN@3 which was called:
# once (30µs+3µs) by IO::Compress::Bzip2::BEGIN@11 at line 3 # spent 33µs making 1 call to IO::Compress::Adapter::Bzip2::BEGIN@3
# spent 3µs making 1 call to strict::import |
| 4 | 2 | 30µs | 2 | 30µs | # spent 22µs (14+8) within IO::Compress::Adapter::Bzip2::BEGIN@4 which was called:
# once (14µs+8µs) by IO::Compress::Bzip2::BEGIN@11 at line 4 # spent 22µs making 1 call to IO::Compress::Adapter::Bzip2::BEGIN@4
# spent 8µs making 1 call to warnings::import |
| 5 | 2 | 48µs | 2 | 13µs | # spent 11µs (9+2) within IO::Compress::Adapter::Bzip2::BEGIN@5 which was called:
# once (9µs+2µs) by IO::Compress::Bzip2::BEGIN@11 at line 5 # spent 11µs making 1 call to IO::Compress::Adapter::Bzip2::BEGIN@5
# spent 2µs making 1 call to bytes::import |
| 6 | |||||
| 7 | 3 | 56µs | 3 | 351µs | # spent 184µs (17+167) within IO::Compress::Adapter::Bzip2::BEGIN@7 which was called:
# once (17µs+167µs) by IO::Compress::Bzip2::BEGIN@11 at line 7 # spent 184µs making 1 call to IO::Compress::Adapter::Bzip2::BEGIN@7
# spent 155µs making 1 call to Exporter::import
# spent 12µs making 1 call to version::_VERSION |
| 8 | |||||
| 9 | 3 | 693µs | 3 | 250µs | # spent 134µs (18+116) within IO::Compress::Adapter::Bzip2::BEGIN@9 which was called:
# once (18µs+116µs) by IO::Compress::Bzip2::BEGIN@11 at line 9 # spent 134µs making 1 call to IO::Compress::Adapter::Bzip2::BEGIN@9
# spent 107µs making 1 call to Exporter::import
# spent 9µs making 1 call to version::_VERSION |
| 10 | |||||
| 11 | our ($VERSION); | ||||
| 12 | 1 | 1µs | $VERSION = '2.074'; | ||
| 13 | |||||
| 14 | sub mkCompObject | ||||
| 15 | { | ||||
| 16 | my $BlockSize100K = shift ; | ||||
| 17 | my $WorkFactor = shift ; | ||||
| 18 | my $Verbosity = shift ; | ||||
| 19 | |||||
| 20 | $BlockSize100K = 1 if ! defined $BlockSize100K ; | ||||
| 21 | $WorkFactor = 0 if ! defined $WorkFactor ; | ||||
| 22 | $Verbosity = 0 if ! defined $Verbosity ; | ||||
| 23 | |||||
| 24 | my ($def, $status) = new Compress::Raw::Bzip2(1, $BlockSize100K, | ||||
| 25 | $WorkFactor, $Verbosity); | ||||
| 26 | |||||
| 27 | return (undef, "Could not create Deflate object: $status", $status) | ||||
| 28 | if $status != BZ_OK ; | ||||
| 29 | |||||
| 30 | return bless {'Def' => $def, | ||||
| 31 | 'Error' => '', | ||||
| 32 | 'ErrorNo' => 0, | ||||
| 33 | } ; | ||||
| 34 | } | ||||
| 35 | |||||
| 36 | sub compr | ||||
| 37 | { | ||||
| 38 | my $self = shift ; | ||||
| 39 | |||||
| 40 | my $def = $self->{Def}; | ||||
| 41 | |||||
| 42 | my $status = $def->bzdeflate($_[0], $_[1]) ; | ||||
| 43 | $self->{ErrorNo} = $status; | ||||
| 44 | |||||
| 45 | if ($status != BZ_RUN_OK) | ||||
| 46 | { | ||||
| 47 | $self->{Error} = "Deflate Error: $status"; | ||||
| 48 | return STATUS_ERROR; | ||||
| 49 | } | ||||
| 50 | |||||
| 51 | return STATUS_OK; | ||||
| 52 | } | ||||
| 53 | |||||
| 54 | sub flush | ||||
| 55 | { | ||||
| 56 | my $self = shift ; | ||||
| 57 | |||||
| 58 | my $def = $self->{Def}; | ||||
| 59 | |||||
| 60 | my $status = $def->bzflush($_[0]); | ||||
| 61 | $self->{ErrorNo} = $status; | ||||
| 62 | |||||
| 63 | if ($status != BZ_RUN_OK) | ||||
| 64 | { | ||||
| 65 | $self->{Error} = "Deflate Error: $status"; | ||||
| 66 | return STATUS_ERROR; | ||||
| 67 | } | ||||
| 68 | |||||
| 69 | return STATUS_OK; | ||||
| 70 | |||||
| 71 | } | ||||
| 72 | |||||
| 73 | sub close | ||||
| 74 | { | ||||
| 75 | my $self = shift ; | ||||
| 76 | |||||
| 77 | my $def = $self->{Def}; | ||||
| 78 | |||||
| 79 | my $status = $def->bzclose($_[0]); | ||||
| 80 | $self->{ErrorNo} = $status; | ||||
| 81 | |||||
| 82 | if ($status != BZ_STREAM_END) | ||||
| 83 | { | ||||
| 84 | $self->{Error} = "Deflate Error: $status"; | ||||
| 85 | return STATUS_ERROR; | ||||
| 86 | } | ||||
| 87 | |||||
| 88 | return STATUS_OK; | ||||
| 89 | |||||
| 90 | } | ||||
| 91 | |||||
| 92 | |||||
| 93 | sub reset | ||||
| 94 | { | ||||
| 95 | my $self = shift ; | ||||
| 96 | |||||
| 97 | my $outer = $self->{Outer}; | ||||
| 98 | |||||
| 99 | my ($def, $status) = new Compress::Raw::Bzip2(); | ||||
| 100 | $self->{ErrorNo} = ($status == BZ_OK) ? 0 : $status ; | ||||
| 101 | |||||
| 102 | if ($status != BZ_OK) | ||||
| 103 | { | ||||
| 104 | $self->{Error} = "Cannot create Deflate object: $status"; | ||||
| 105 | return STATUS_ERROR; | ||||
| 106 | } | ||||
| 107 | |||||
| 108 | $self->{Def} = $def; | ||||
| 109 | |||||
| 110 | return STATUS_OK; | ||||
| 111 | } | ||||
| 112 | |||||
| 113 | sub compressedBytes | ||||
| 114 | { | ||||
| 115 | my $self = shift ; | ||||
| 116 | $self->{Def}->compressedBytes(); | ||||
| 117 | } | ||||
| 118 | |||||
| 119 | sub uncompressedBytes | ||||
| 120 | { | ||||
| 121 | my $self = shift ; | ||||
| 122 | $self->{Def}->uncompressedBytes(); | ||||
| 123 | } | ||||
| 124 | |||||
| 125 | #sub total_out | ||||
| 126 | #{ | ||||
| 127 | # my $self = shift ; | ||||
| 128 | # 0; | ||||
| 129 | #} | ||||
| 130 | # | ||||
| 131 | |||||
| 132 | #sub total_in | ||||
| 133 | #{ | ||||
| 134 | # my $self = shift ; | ||||
| 135 | # $self->{Def}->total_in(); | ||||
| 136 | #} | ||||
| 137 | # | ||||
| 138 | #sub crc32 | ||||
| 139 | #{ | ||||
| 140 | # my $self = shift ; | ||||
| 141 | # $self->{Def}->crc32(); | ||||
| 142 | #} | ||||
| 143 | # | ||||
| 144 | #sub adler32 | ||||
| 145 | #{ | ||||
| 146 | # my $self = shift ; | ||||
| 147 | # $self->{Def}->adler32(); | ||||
| 148 | #} | ||||
| 149 | |||||
| 150 | |||||
| 151 | 1 | 5µs | 1; | ||
| 152 | |||||
| 153 | __END__ |