summaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
authorJoel Nothman <joel.nothman@gmail.com>2012-12-06 23:01:12 +1100
committerJoel Nothman <joel.nothman@gmail.com>2012-12-06 23:01:12 +1100
commitcaecc0098eeb631bb0aeca1fdba397ddd96ca329 (patch)
tree34c5a997b32df774b988f2736050cc2f34cbde48 /README.rst
parent6b782232317b3e00f8896fb36567f8ad8c3c3345 (diff)
downloadmsgpack-python-caecc0098eeb631bb0aeca1fdba397ddd96ca329.tar.gz
Change Unpacker example to read from stream
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst12
1 files changed, 3 insertions, 9 deletions
diff --git a/README.rst b/README.rst
index 8cebc01..8154098 100644
--- a/README.rst
+++ b/README.rst
@@ -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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^