.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "IO::Uncompress::Brotli 3" .TH IO::Uncompress::Brotli 3 2025-01-30 "perl v5.40.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME IO::Uncompress::Brotli \- Read Brotli buffers/streams .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use IO::Uncompress::Brotli; \& \& # uncompress a buffer (yielding at most 10MB) \& my $decoded = unbro $encoded, 10_000_000; \& \& # uncompress a stream \& my $bro = IO::Uncompress::Brotli\->create; \& while(have_input()) { \& my $block = get_input_block(); \& my $decoded_block = $bro\->decompress($block); \& handle_output_block($decoded_block); \& } .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" IO::Uncompress::Brotli is a module that decompresses Brotli buffers and streams. Despite its name, it is not a subclass of IO::Uncompress::Base and does not implement its interface. This will be rectified in a future release. .SS "One-shot interface" .IX Subsection "One-shot interface" If you have the whole buffer in a Perl scalar use the \fBunbro\fR function. .ie n .IP "\fBunbro\fR(\fR\fI$input\fR\fI\fR, \fI\fR\fI$maximum_decoded_size\fR\fI\fR)" 4 .el .IP "\fBunbro\fR(\fR\f(CI$input\fR\fI\fR, \fI\fR\f(CI$maximum_decoded_size\fR\fI\fR)" 4 .IX Item "unbro($input, $maximum_decoded_size)" Takes a whole compressed buffer as input and returns the decompressed data. It allocates a buffer of size \fR\f(CI$maximum_decoded_size\fR\fI\fR to store the decompressed data, if this is not sufficient (or there is another error) this function will croak. .Sp As of version 0.004_002, the \fR\f(CI$maximum_decoded_size\fR\fI\fR argument is optional. If not provided, \fBunbro\fR uses the streaming interface described in the next section to decompress the buffer in blocks of one megabyte. The decompressed blocks are concatenated and returned. .Sp Exported by default. .SS "Streaming interface" .IX Subsection "Streaming interface" If you want to process the data in blocks use the object oriented interface. The available methods are: .IP IO::Uncompress::Brotli\->\fBcreate\fR 4 .IX Item "IO::Uncompress::Brotli->create" Returns a IO::Uncompress::Brotli instance. Please note that a single instance cannot be used to decompress multiple streams. .ie n .IP $bro\->\fBdecompress\fR(\fR\fI$block\fR\fI\fR) 4 .el .IP \f(CW$bro\fR\->\fBdecompress\fR(\fR\f(CI$block\fR\fI\fR) 4 .IX Item "$bro->decompress($block)" Takes the a block of compressed data and returns a block of uncompressed data. Dies on error. .SH "SEE ALSO" .IX Header "SEE ALSO" RFC 7392 Brotli Compressed Data Format: .PP Brotli source code: .SH AUTHOR .IX Header "AUTHOR" Marius Gavrilescu, .PP The encoder bindings, modernisation of the decoder bindings and a clean up of the overall project were contributed by: .IP "Quim Rovira, " 4 .IX Item "Quim Rovira, " .PD 0 .IP "Ævar Arnfjörð Bjarmason, " 4 .IX Item "Ævar Arnfjörð Bjarmason, " .IP "Marcell Szathmári" 4 .IX Item "Marcell Szathmári" .IP "Mattia Barbon, " 4 .IX Item "Mattia Barbon, " .PD .PP POD fix by Mark Zabaro, . .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2015\-2018 by Marius Gavrilescu .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.20.2 or, at your option, any later version of Perl 5 you may have available.