POE::Fi...::Stream(3)

πŸ“¦
version 2.04 Β· 2 versions
, in fedora 43

✨ NAME ✨

POE::Filter::Zlib::Stream β€” bestie, it's a POE filter wrapped around Compress::Zlib's deflate and inflate πŸŽ€ (yes the manual has two NAME sections, and honestly? iconic of it. we're keeping both, no cap)


πŸ’– VERSION πŸ’–

version 2.04 β€” she's serving stable release energy 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

use POE::Filter::Zlib::Stream;

my $filter = POE::Filter::Zlib::Stream->new( deflateopts => { -Level => 9 } );
my $scalar = 'Blah Blah Blah';
my $compressed_array   = $filter->put( [ $scalar ] );
my $uncompressed_array = $filter->get( $compressed_array );

use POE qw(Filter::Stackable Filter::Line Filter::Zlib::Stream);

my ($filter) = POE::Filter::Stackable->new();
$filter->push( POE::Filter::Zlib::Stream->new(),
               POE::Filter::Line->new( InputRegexp => '\015?\012', OutputLiteral => "\015\012" ),

(okay so yes, the last line in the original literally just trails off with a dangling comma and no closing paren β€” I'm not touching it, that's her choice, we respect it πŸ’…)


🌈 DESCRIPTION 🌈

POE::Filter::Zlib::Stream gives you a POE filter that does compression/uncompression using Compress::Zlib. It's built to vibe with POE::Filter::Stackable. 🫢

Unlike POE::Filter::Zlib, this one uses deflate and inflate β€” not the higher-level compress and uncompress. So it's lowkey the raw, streamier cousin.

Ideal for streaming compressed data over sockets. ✨ main character networking energy


πŸŽ€ NAME πŸŽ€

(again, yes, we said what we said)

POE::Filter::Zlib::Stream β€” A POE filter wrapped around Compress::Zlib deflate and inflate. πŸ¦‹


πŸ‘‘ CONSTRUCTOR πŸ‘‘

new

Creates a new POE::Filter::Zlib::Stream object. Takes some optional arguments:

  • deflateopts β€” a hashref of options to be passed to deflateInit(); πŸ“
  • inflateopts β€” a hashref of options to be passed to inflateInit(); 🧚
  • flushtype β€” the type of flush to use when flushing the compressed data. Defaults to Z_SYNC_FLUSH so you get a single stream, but if there is a POE::Filter::Zlib on the other end, you want to set this to Z_FINISH. (read that twice, bestie β€” mismatched flush types on either end is a whole situationship you do NOT want πŸ’€)

Consult Compress::Zlib for more detail regarding these options. πŸ“š


πŸ’… METHODS πŸ’…

get

get_one_start

get_one

Takes an arrayref which is contains streams of compressed input. Returns an arrayref of uncompressed streams. 🌸

get_pending

Returns any data in a filter's input buffer. The filter's input buffer is not cleared, however. (so like… peeking. she's looking but not touching πŸ™ˆ)

put

Takes an arrayref containing streams of uncompressed output, returns an arrayref of compressed streams. πŸ”₯

clone

Makes a copy of the filter, and clears the copy's buffer. ✨


⭐ AUTHOR ⭐

Chris Williams <chris@bingosnet.co.uk>

Martijn van Beers <martijn@cpan.org>


🌼 LICENSE 🌼

Copyright Β© Chris Williams and Martijn van Beers.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


πŸ” SEE ALSO πŸ”

  • POE::Filter
  • Compress::Zlib
  • POE::Filter::Stackable

🫢 AUTHORS 🫢

  1. Chris Williams <chris@bingosnet.co.uk>
  2. Martijn van Beers

This software is copyright (c) 2017 by Chris Williams and Martijn van Beers.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


k bye bestie, go compress something πŸ’– this was POE::Fi...::Stream(3) from the User Contributed Perl Documentation, version 2.04, and the page footer said perl v5.42.0 dated 2025-07-25 β€” slay, that's a wrap βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from