1Compress::Stream::Zstd:U:sCeormpCroenstsroirb(u3t)ed PerClomDporceusmse:n:tSattrieoanm::Zstd::Compressor(3)
2
3
4
6 Compress::Stream::Zstd::Compressor - Zstd streaming compression
7
9 use Compress::Stream::Zstd::Compressor qw(ZSTD_CSTREAM_IN_SIZE);
10
11 my $compressor = Compress::Stream::Zstd::Compressor->new($level);
12 while (read($fh, my $buffer, ZSTD_CSTREAM_IN_SIZE)) {
13 print $compressor->compress($buffer);
14 }
15 print $compressor->end;
16
18 The Compress::Stream::Zstd::Compressor module provides a streaming
19 interface to the Zstd compressor.
20
22 Compress::Stream::Zstd::Compressor->new([$level])
23 :Compress::Stream::Zstd::Compressor
24 Create an instance of Compress::Stream::Zstd::Compressor.
25
26 $compressor->init([$level]) :Undef
27 (re)init the compressor.
28
29 $compressor->compress($input) :Str
30 Consume input stream.
31
32 $compressor->flush() :Str
33 Flush whatever data remains within internal buffer.
34
35 $compressor->end() :Str
36 Instructs to finish a frame.
37
39 ZSTD_CSTREAM_IN_SIZE
40 Recommended size for input buffer.
41
43 <http://www.zstd.net/>
44
46 Copyright (c) 2016, Jiro Nishiguchi
47 All rights reserved.
48
49 Redistribution and use in source and binary forms, with or without modification,
50 are permitted provided that the following conditions are met:
51
52 1. Redistributions of source code must retain the above copyright notice, this
53 list of conditions and the following disclaimer.
54
55 2. Redistributions in binary form must reproduce the above copyright notice,
56 this list of conditions and the following disclaimer in the documentation
57 and/or other materials provided with the distribution.
58
59 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
60 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
61 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
62 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
63 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
64 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
65 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
66 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
67 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
68 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
69
71 Jiro Nishiguchi <jiro@cpan.org>
72
73 Zstandard by Facebook, Inc.
74
75
76
77perl v5.34.0 2021-10-C2o1mpress::Stream::Zstd::Compressor(3)