>>Reader objects are reusable
Is there some special API need to invoke or just use the Reader object as 
directly?

I noticed that when a reader object has been used once, the subsequent read 
will failed.

Is there some rewind operation need to be done just as the fread similar 
operation(i guess there may be some pointer internal)?


my code example:


kj::ArrayPtr<const kj::byte> byteArray((const kj::byte *) buf, (size_t) 
bufSize);
kj::ArrayInputStream arrayInputStream(byteArray);
kj::BufferedInputStreamWrapper input(arrayInputStream);
capnp::PackedMessageReader message(input);


maybe i need to rewind the inputstream to the begin so as to reuse the Reader 
object to retrive the target object?


On Thursday, November 7, 2019 at 2:25:08 AM UTC+8, Kenton Varda wrote:
>
> Hi Fay,
>
> I'm not sure I understand your question. Reader objects are reusable. Is 
> there some problem you're running into when trying to reuse a reader object?
>
> -Kenton
>
> On Tue, Nov 5, 2019 at 2:16 AM Fay Wong <[email protected] <javascript:>> 
> wrote:
>
>> Just as the mail title.
>>
>> How could i reuse a reader object after i have consumed it once?
>>
>> I am implement a runtime mvvm ui engine, for example, <ul v-for="item in 
>> data.goodList" ...
>>
>> when data.goodList changes, i need to re-generate the structure of ul 
>> template, so i need to access the definition of the ul node at any time 
>> when user interact with my engine.
>>
>> BR,
>> sid
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Cap'n Proto" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/capnproto/dd7887fb-a1ac-498c-8589-4910d6d6d9cf%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/capnproto/dd7887fb-a1ac-498c-8589-4910d6d6d9cf%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/6fe4c17c-a04c-4811-ad0b-aa3f39929e8f%40googlegroups.com.

Reply via email to