2009-04-15 12:55:41 +09:00
|
|
|
=head1 NAME
|
|
|
|
|
|
|
|
Data::MessagePack::Unpacker - messagepack streaming deserializer
|
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
|
|
|
use Data::Dumper;
|
|
|
|
my $up = Data::MessagePack::Unpacker->new;
|
|
|
|
my $ret = $up->execute($v, 0);
|
|
|
|
if ($ret != length($v)) {
|
|
|
|
fail "extra bytes";
|
|
|
|
}
|
|
|
|
return Dumper($up->data);
|
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
|
|
|
|
2010-09-12 05:38:15 +09:00
|
|
|
This is a streaming deserializer for messagepack.
|
2009-04-15 12:55:41 +09:00
|
|
|
|
|
|
|
=head1 METHODS
|
|
|
|
|
|
|
|
=over 4
|
|
|
|
|
|
|
|
=item my $up = Data::MessagePack::Unpacker->new()
|
|
|
|
|
2010-09-12 05:38:15 +09:00
|
|
|
creates a new instance of stream deserializer.
|
2009-04-15 12:55:41 +09:00
|
|
|
|
2010-05-03 01:09:21 +09:00
|
|
|
=item my $ret = $up->execute($data, $offset);
|
2009-04-15 12:55:41 +09:00
|
|
|
|
2010-05-03 01:09:21 +09:00
|
|
|
=item my $ret = $up->execute_limit($data, $offset, $limit)
|
2009-04-15 12:55:41 +09:00
|
|
|
|
2010-05-03 01:09:21 +09:00
|
|
|
$up->execute(substr($data, 0, 3), 0);
|
|
|
|
$up->execute($data, 3);
|
|
|
|
|
|
|
|
$offset is the offset of $data.
|
|
|
|
|
|
|
|
=item my $bool = $up->is_finished();
|
2009-04-15 12:55:41 +09:00
|
|
|
|
|
|
|
is this deserializer finished?
|
|
|
|
|
2010-05-03 01:09:21 +09:00
|
|
|
=item my $data = $up->data();
|
2009-04-15 12:55:41 +09:00
|
|
|
|
2010-09-12 05:38:15 +09:00
|
|
|
returns the deserialized object.
|
2009-04-15 12:55:41 +09:00
|
|
|
|
2010-05-03 01:09:21 +09:00
|
|
|
=item $up->reset();
|
2009-04-15 12:55:41 +09:00
|
|
|
|
2010-09-12 05:38:15 +09:00
|
|
|
resets the stream deserializer, without memory zone.
|
2009-04-15 12:55:41 +09:00
|
|
|
|
|
|
|
=back
|
|
|
|
|
|
|
|
=head1 AUTHORS
|
|
|
|
|
|
|
|
Tokuhiro Matsuno
|
|
|
|
|
|
|
|
=head1 SEE ALSO
|
|
|
|
|
|
|
|
L<Data::MessagePack>
|
|
|
|
|