]> Sergey Matveev's repositories - public-inbox.git/blob - lib/PublicInbox/CompressNoop.pm
update copyrights for 2021
[public-inbox.git] / lib / PublicInbox / CompressNoop.pm
1 # Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
3
4 # Provide the same methods as Compress::Raw::Zlib::Deflate but
5 # does no transformation of outgoing data
6 package PublicInbox::CompressNoop;
7 use strict;
8 use Compress::Raw::Zlib qw(Z_OK);
9
10 sub new { bless \(my $self), __PACKAGE__ }
11
12 sub deflate { # ($self, $input, $output)
13         $_[2] .= $_[1];
14         Z_OK;
15 }
16
17 sub flush { # ($self, $output, $flags = Z_FINISH)
18         $_[1] //= '';
19         Z_OK;
20 }
21
22 1;