Commit | Line | Data |
25f0751f |
1 | package IO::Compress::Adapter::Identity ; |
2 | |
3 | use strict; |
4 | use warnings; |
5 | use bytes; |
6 | |
b0cda13f |
7 | use IO::Compress::Base::Common 2.003 qw(:Status); |
25f0751f |
8 | our ($VERSION); |
9 | |
b0cda13f |
10 | $VERSION = '2.003'; |
25f0751f |
11 | |
12 | sub mkCompObject |
13 | { |
25f0751f |
14 | my $level = shift ; |
15 | my $strategy = shift ; |
16 | |
17 | return bless { |
18 | 'CompSize' => 0, |
19 | 'UnCompSize' => 0, |
20 | 'Error' => '', |
21 | 'ErrorNo' => 0, |
25f0751f |
22 | } ; |
23 | } |
24 | |
25 | sub compr |
26 | { |
27 | my $self = shift ; |
28 | |
29 | if (defined ${ $_[0] } && length ${ $_[0] }) { |
30 | $self->{CompSize} += length ${ $_[0] } ; |
31 | $self->{UnCompSize} = $self->{CompSize} ; |
32 | |
e7d45986 |
33 | if ( ref $_[1] ) |
34 | { ${ $_[1] } .= ${ $_[0] } } |
35 | else |
36 | { $_[1] .= ${ $_[0] } } |
25f0751f |
37 | } |
38 | |
39 | return STATUS_OK ; |
40 | } |
41 | |
42 | sub flush |
43 | { |
44 | my $self = shift ; |
45 | |
46 | return STATUS_OK; |
47 | } |
48 | |
49 | sub close |
50 | { |
51 | my $self = shift ; |
52 | |
53 | return STATUS_OK; |
54 | } |
55 | |
56 | sub reset |
57 | { |
58 | my $self = shift ; |
59 | |
60 | $self->{CompSize} = 0; |
61 | $self->{UnCompSize} = 0; |
25f0751f |
62 | |
63 | return STATUS_OK; |
64 | } |
65 | |
66 | sub deflateParams |
67 | { |
68 | my $self = shift ; |
69 | |
70 | return STATUS_OK; |
71 | } |
72 | |
73 | #sub total_out |
74 | #{ |
75 | # my $self = shift ; |
76 | # return $self->{UnCompSize} ; |
77 | #} |
78 | # |
79 | #sub total_in |
80 | #{ |
81 | # my $self = shift ; |
82 | # return $self->{UnCompSize} ; |
83 | #} |
84 | |
85 | sub compressedBytes |
86 | { |
87 | my $self = shift ; |
88 | return $self->{UnCompSize} ; |
89 | } |
90 | |
91 | sub uncompressedBytes |
92 | { |
93 | my $self = shift ; |
94 | return $self->{UnCompSize} ; |
95 | } |
96 | |
25f0751f |
97 | 1; |
98 | |
99 | |
100 | __END__ |
101 | |