File Coverage

blib/lib/Compress/Zstd/Decompressor.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 19 19 100.0


line stmt bran cond sub pod time code
1             package Compress::Zstd::Decompressor;
2 1     1   473 use 5.008001;
  1         3  
3 1     1   5 use strict;
  1         2  
  1         19  
4 1     1   4 use warnings;
  1         1  
  1         37  
5 1     1   6 use Exporter 'import';
  1         2  
  1         28  
6              
7 1     1   5 use Compress::Zstd ();
  1         2  
  1         71  
8              
9             our @EXPORT = qw(
10             ZSTD_DSTREAM_IN_SIZE
11             );
12              
13             1;
14             __END__
15              
16             =encoding utf-8
17              
18             =head1 NAME
19              
20             Compress::Zstd::Decompressor - Zstd streaming decompression
21              
22             =head1 SYNOPSIS
23              
24             use Compress::Zstd::Decompressor qw(ZSTD_DSTREAM_IN_SIZE);
25              
26             my $decompressor = Compress::Zstd::Decompressor->new;
27             while (read($fh, my $buffer, ZSTD_DSTREAM_IN_SIZE)) {
28             print $decompressor->decompress($buffer);
29             }
30              
31             =head1 DESCRIPTION
32              
33             The Compress::Zstd::Decompressor module provides a streaming interface to the Zstd decompressor.
34              
35             =head1 METHODS
36              
37             =head2 Compress::Zstd::Decompressor->new() :Compress::Zstd::Decompressor
38              
39             Create an instance of Compress::Zstd::Decompressor.
40              
41             =head2 $decompressor->init() :Undef
42              
43             (re)init the decompressor.
44              
45             =head2 $decompressor->decompress($input) :Str
46              
47             Consume input stream.
48              
49             =head1 CONSTANTS
50              
51             =head2 ZSTD_DSTREAM_IN_SIZE
52              
53             Recommended size for input buffer.
54              
55             =head1 SEE ALSO
56              
57             L<Compress::Zstd>
58              
59             =head1 LICENSE
60              
61             Copyright (c) 2016, Jiro Nishiguchi
62             All rights reserved.
63              
64             Redistribution and use in source and binary forms, with or without modification,
65             are permitted provided that the following conditions are met:
66              
67             1. Redistributions of source code must retain the above copyright notice, this
68             list of conditions and the following disclaimer.
69              
70             2. Redistributions in binary form must reproduce the above copyright notice,
71             this list of conditions and the following disclaimer in the documentation
72             and/or other materials provided with the distribution.
73              
74             THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
75             ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
76             WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
77             DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
78             ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
79             (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
80             LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
81             ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
82             (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
83             SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
84              
85             =head1 AUTHOR
86              
87             Jiro Nishiguchi E<lt>jiro@cpan.orgE<gt>
88              
89             Zstandard by Facebook, Inc.
90              
91             =cut