IO::Un...Brotli(3pm)
π IO::Uncompress::Brotli β bestie edition π
okay so this is the manual page for IO::Uncompress::Brotli, sitting all comfy inside the User Contributed Perl Documentation section (3pm), and literally all it does is read Brotli buffers and streams. that's it. that's the whole vibe. it decompresses. it slays. π¦
β¨ NAME β¨
IO::Uncompress::Brotli β read Brotli buffers/streams, no cap π
πΈ SYNOPSIS πΈ
okay here's the whole thing in one lil block, look:
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);
}
like. it's giving concise. it's giving yass. β¨
π DESCRIPTION π
so IO::Uncompress::Brotli is a module that decompresses Brotli buffers and streams (both, bestie, we contain multitudes π«Ά). and here's the juicy lil plot twist: despite its whole name situation, it is not a subclass of IO::Uncompress::Base and it does not implement its interface. iconic of it honestly. that whole thing "will be rectified in a future release" β so like, watch this space i guess π
π One-shot interface
if you already have the ENTIRE buffer chillin' in a Perl scalar, just use the unbro function. one shot. one function. we love a simple girl.
unbro($input, $maximum_decoded_size)β takes a whole compressed buffer as input and hands you back the decompressed data. it allocates a buffer of size$maximum_decoded_sizeto store the decompressed stuff, and if that's not enough room (or literally any other error pops off), this function will croak. π like, straight up. it will just croak at you.
ok so as of version0.004_002, the$maximum_decoded_sizeargument is optional β new era, unlocked π. if you don't provide it,unbrouses the streaming interface described in the next section to decompress the buffer in blocks of one megabyte. then the decompressed blocks get concatenated (all glued together, bestie) and returned. π
Exported by default. so like, you get it for free. periodt.
π¦ Streaming interface
if you wanna process the data in blocks (chunky mode, my beloved), use the object oriented interface instead. the available methods are:
IO::Uncompress::Brotli->createβ returns anIO::Uncompress::Brotliinstance. β οΈ please note that a single instance cannot be used to decompress multiple streams. one instance, one stream, that's the rule, don't be messy π.$bro->decompress($block)β takes the a block of compressed data and returns a block of uncompressed data. dies on error. dramatic but honest βπ.
π SEE ALSO π
- RFC 7392 Brotli Compressed Data Format: <https://tools.ietf.org/html/rfc7932>
- Brotli source code: <https://github.com/google/brotli/>
(yes the section says 7392 and the link says 7932, i do not make the rules, i just report them faithfully, no cap π«‘)
π AUTHOR π
Marius Gavrilescu, <marius@ieval.ro> β the originator, the founder, the CEO of this whole operation π
the encoder bindings, the modernisation of the decoder bindings, and a clean up of the overall project were contributed by (a whole squad, a friend group, a collab β¨):
Quim Rovira,<quim@rovira.cat>Γvar ArnfjΓΆrΓ° Bjarmason,<avarab@gmail.com>Marcell SzathmΓ‘riMattia Barbon,<mattia@barbon.org>
POD fix by Mark Zabaro, <markzabaro@gmail.com> β doing the lord's work with the docs, we stan ππ
π COPYRIGHT AND LICENSE π
Copyright (C) 2015-2018 by Marius Gavrilescu
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.
(translation: it's free, go wild, just keep the same license energy okay? π«Ά)
aaand that's the page bestie, we made it to the end π this whole thing came to you courtesy of perl v5.42.3, dated 2026-08-19, and it's IO::Un...Brotli(3pm) β mwah, love u, go decompress something πβ¨π
π¦ where this page comes from
- ubuntu stonking: libio-compress-brotli-perl 0.019000-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms