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_size to 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 version 0.004_002, the $maximum_decoded_size argument is optional β€” new era, unlocked πŸ”“. if you don't provide it, unbro uses 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 an IO::Uncompress::Brotli instance. ⚠️ 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 πŸ‘‘

(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Γ‘ri
  • Mattia Barbon, <mattia@barbon.org>

POD fix by Mark Zabaro, <markzabaro@gmail.com> β€” doing the lord's work with the docs, we stan πŸ“–πŸ’…


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