1POE::Filter::Zlib::StreUasme(r3)Contributed Perl DocumenPtOaEt:i:oFnilter::Zlib::Stream(3)
2
3
4

NAME

6       POE::Filter::Zlib::Stream - A POE filter wrapped around Compress::Zlib
7       deflate and inflate.
8

SYNOPSIS

10           use POE::Filter::Zlib::Stream;
11
12           my $filter = POE::Filter::Zlib::Stream->new( deflateopts => { -Level => 9 } );
13           my $scalar = 'Blah Blah Blah';
14           my $compressed_array   = $filter->put( [ $scalar ] );
15           my $uncompressed_array = $filter->get( $compressed_array );
16
17           use POE qw(Filter::Stackable Filter::Line Filter::Zlib::Stream);
18
19           my ($filter) = POE::Filter::Stackable->new();
20           $filter->push( POE::Filter::Zlib::Stream->new(),
21                          POE::Filter::Line->new( InputRegexp => '\015?\012', OutputLiteral => "\015\012" ),
22

DESCRIPTION

24       POE::Filter::Zlib::Stream provides a POE filter for performing
25       compression/uncompression using Compress::Zlib. It is suitable for use
26       with POE::Filter::Stackable.
27
28       Unlike POE::Filter::Zlib this filter uses deflate and inflate, not the
29       higher level compress and uncompress.
30
31       Ideal for streaming compressed data over sockets.
32

CONSTRUCTOR

34       "new"
35           Creates a new POE::Filter::Zlib::Stream object. Takes some optional
36           arguments:
37
38           "deflateopts"
39               a hashref of options to be passed to deflateInit();
40
41           "inflateopts"
42               a hashref of options to be passed to inflateInit();
43
44           "flushtype"
45               The type of flush to use when flushing the compressed data.
46               Defaults to Z_SYNC_FLUSH so you get a single stream, but if
47               there is a POE::Filter::Zlib on the other end, you want to set
48               this to Z_FINISH.
49
50           Consult Compress::Zlib for more detail regarding these options.
51

METHODS

53       "get"
54       "get_one_start"
55       "get_one"
56           Takes an arrayref which is contains streams of compressed input.
57           Returns an arrayref of uncompressed streams.
58
59       "get_pending"
60           Returns any data in a filter's input buffer. The filter's input
61           buffer is not cleared, however.
62
63       "put"
64           Takes an arrayref containing streams of uncompressed output,
65           returns an arrayref of compressed streams.
66
67       "clone"
68           Makes a copy of the filter, and clears the copy's buffer.
69

AUTHOR

71       Chris Williams <chris@bingosnet.co.uk>
72
73       Martijn van Beers <martijn@cpan.org>
74

LICENSE

76       Copyright X Chris Williams and Martijn van Beers.
77
78       This program is free software; you can redistribute it and/or modify it
79       under the same terms as Perl itself.
80

SEE ALSO

82       POE::Filter
83
84       Compress::Zlib
85
86       POE::Filter::Stackable
87
88
89
90perl v5.12.0                      2009-05-29      POE::Filter::Zlib::Stream(3)
Impressum