diff options
author | Joel Nothman <joel.nothman@gmail.com> | 2012-12-06 23:01:12 +1100 |
---|---|---|
committer | Joel Nothman <joel.nothman@gmail.com> | 2012-12-06 23:01:12 +1100 |
commit | caecc0098eeb631bb0aeca1fdba397ddd96ca329 (patch) | |
tree | 34c5a997b32df774b988f2736050cc2f34cbde48 /README.rst | |
parent | 6b782232317b3e00f8896fb36567f8ad8c3c3345 (diff) | |
download | msgpack-python-caecc0098eeb631bb0aeca1fdba397ddd96ca329.tar.gz |
Change Unpacker example to read from stream
Diffstat (limited to 'README.rst')
-rw-r--r-- | README.rst | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -55,15 +55,9 @@ stream. buf.seek(0) - unpacker = msgpack.Unpacker() - while True: - data = buf.read(16) - if not data: - break - unpacker.feed(data) - - for unpacked in unpacker: - print unpacked + unpacker = msgpack.Unpacker(buf) + for unpacked in unpacker: + print unpacked packing/unpacking of custom data type ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |