8000 Change Unpacker example to read from stream · xunzhang/msgpack-python@caecc00 · GitHub
[go: up one dir, main page]

Skip to content

Commit caecc00

Browse files
committed
Change Unpacker example to read from stream
1 parent 6b78223 commit caecc00

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

README.rst

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,9 @@ stream.
5555

5656
buf.seek(0)
5757

58-
unpacker = msgpack.Unpacker()
59-
while True:
60-
data = buf.read(16)
61-
if not data:
62-
break
63-
unpacker.feed(data)
64-
65-
for unpacked in unpacker:
66-
print unpacked
58+
unpacker = msgpack.Unpacker(buf)
59+
for unpacked in unpacker:
60+
print unpacked
6761

6862
packing/unpacking of custom data type
6963
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)
0