Data::MessagePack::Stream - yet another messagepack streaming deserializer
use Data::Dumper; my $unpacker = Data::MessagePack::Stream->new; while (read($fh, my $buf, 1024)) { $unpacker->feed($buf); while ($unpacker->next) { print Dumper($unpacker->data); } }
Data::MessagePack::Stream is streaming deserializer for MessagePack.
This module is alternate for Data::MessagePack::Unpacker. Unlike original unpacker, this module support internal buffer and it's possible to handle streaming data correctly.
my $unpacker = Data::MessagePack::Stream->new;
Create new stream unpacker.
$unpacker->feed($data);
Push $data into unpacker's internal buffer.
$data
my $bool = $unpacker->next;
If parsable MessagePack packet is fed, return true. You can get that parsed data by data method described below.
data
my $data = $unpacker->data;
Return parsed perl object.
Daisuke Murase <typester@cpan.org>
Copyright (c) 2012 by KAYAC Inc.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
To install Data::MessagePack::Stream, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::MessagePack::Stream
CPAN shell
perl -MCPAN -e shell install Data::MessagePack::Stream
For more information on module installation, please visit the detailed CPAN module installation guide.