File Coverage

blib/lib/Compress/Zstd/CompressionContext.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::CompressionContext;
2 2     2   1057 use 5.008001;
  2         8  
3 2     2   10 use strict;
  2         4  
  2         36  
4 2     2   32 use warnings;
  2         23  
  2         113  
5              
6 2     2   16 use Compress::Zstd ();
  2         3  
  2         68  
7              
8             1;
9             __END__
10              
11             =encoding utf-8
12              
13             =head1 NAME
14              
15             Compress::Zstd::CompressionContext - Zstd compression context
16              
17             =head1 SYNOPSIS
18              
19             use Compress::Zstd::CompressionContext;
20              
21             my $cctx = Compress::Zstd::CompressionContext->new;
22             my $dest = $cctx->compress($src, $level);
23              
24             =head1 DESCRIPTION
25              
26             (Experimental) The Compress::Zstd::CompressionContext module provides Zstd compression context.
27              
28             =head1 METHODS
29              
30             =head2 Compress::Zstd::CompressionContext->new() :Compress::Zstd::CompressionContext
31              
32             Create an instance of Compress::Zstd::CompressionContext.
33              
34             =head2 $cctx->compress($source [, $level])
35              
36             Compresses the given buffer and returns the resulting bytes.
37              
38             On error undef is returned.
39              
40             =head2 $cctx->compress_using_dict($source, $dict)
41              
42             Compresses the given buffer using compression dictionary and returns the resulting bytes.
43              
44             On error 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