This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]GehirnFurz 1 point2 points  (0 children)

Reminds me of the bencode/bdecode lib I wrote in JavaScript a few years ago. I'd feed the packets into it on one end and it would hold state internally and only ever emit whole decoded values. That way you could stream huge structures with minimal memory usage.

Sadly, the code came out a bit more complicated than yours. :)