msgpack / msgpack-d

MessagePack for D / msgpack.org[D]
http://msgpack.org/
Boost Software License 1.0
117 stars 41 forks source link

Using StreamingUnpacker with files #95

Open rnowling-adroll opened 7 years ago

rnowling-adroll commented 7 years ago

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 commented 7 years ago

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

A file example would be great, though!

repeatedly commented 7 years ago

You mean the file version of this example?

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