msgpack-d icon indicating copy to clipboard operation
msgpack-d copied to clipboard

Using StreamingUnpacker with files

Open rnowling-adroll opened this issue 8 years ago • 2 comments

Thanks for this great library!

I'm trying to use the StreamingUnpacker with a file for input. The docs for StreamingUnpacker indicate a feed() method can be used to append to the buffer passed to the constructor. However, I don't see this implemented anywhere.

What is the appropriate way to iteratively deserialize multiple msgpack objects stored in file? (I.e., I don't want to read the entire file into memory at once.)

Thanks!

rnowling-adroll avatar Jan 24 '17 19:01 rnowling-adroll

I missed the usage of the mixin for StreamingUnpacker -- feed() is defined there.

A file example would be great, though!

rnowling-adroll avatar Jan 24 '17 19:01 rnowling-adroll

You mean the file version of this example?

https://github.com/msgpack/msgpack-d/blob/master/example/unpacker_foreach.d

repeatedly avatar Jan 27 '17 01:01 repeatedly