File Coverage

blib/lib/Compress/Zstd/DecompressionContext.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 15 15 100.0


line stmt bran cond sub pod time code
1             package Compress::Zstd::DecompressionContext;
2 2     2   904 use 5.008001;
  2         6  
3 2     2   8 use strict;
  2         4  
  2         37  
4 2     2   9 use warnings;
  2         13  
  2         50  
5              
6 2     2   10 use Compress::Zstd ();
  2         4  
  2         55  
7              
8             1;
9             __END__
10              
11             =encoding utf-8
12              
13             =head1 NAME
14              
15             Compress::Zstd::DecompressionContext - Zstd decompression context
16              
17             =head1 SYNOPSIS
18              
19             use Compress::Zstd::DecompressionContext;
20              
21             my $dctx = Compress::Zstd::DecompressionContext->new;
22             my $dest = $dctx->compress($src, $level);
23              
24             =head1 DESCRIPTION
25              
26             (Experimental) The Compress::Zstd::DecompressionContext module provides Zstd decompression context.
27              
28             =head1 METHODS
29              
30             =head2 Compress::Zstd::DecompressionContext->new() :Compress::Zstd::DecompressionContext
31              
32             Create an instance of Compress::Zstd::DecompressionContext.
33              
34             =head2 $dctx->decompress($source)
35              
36             Decompresses the given buffer and returns the resulting bytes.
37              
38             On error (in case of corrupted data) undef is returned.
39              
40             =head2 $dctx->decompress_using_dict($source, $dict)
41              
42             Decompresses the given buffer using decompression dictionary and returns the resulting bytes.
43              
44             On error (in case of corrupted data) undef is returned.
45              
46             =head1 SEE ALSO
47              
48             L<http://www.zstd.net/>
49              
50             =head1 LICENSE
51              
52             Copyright (c) 2016, Jiro Nishiguchi
53             All rights reserved.
54              
55             Redistribution and use in source and binary forms, with or without modification,
56             are permitted provided that the following conditions are met:
57              
58             1. Redistributions of source code must retain the above copyright notice, this
59             list of conditions and the following disclaimer.
60              
61             2. Redistributions in binary form must reproduce the above copyright notice,
62             this list of conditions and the following disclaimer in the documentation
63             and/or other materials provided with the distribution.
64              
65             THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
66             ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
67             WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
68             DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
69             ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
70             (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
71             LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
72             ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
73             (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
74             SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
75              
76             =head1 AUTHOR
77              
78             Jiro Nishiguchi E<lt>jiro@cpan.orgE<gt>
79              
80             Zstandard by Facebook, Inc.
81              
82             =cut