There's no need for a VectorInputStream because you can use ArrayInputStream with vec.asPtr() (returns an ArrayPtr).
-Kenton On Mon, May 14, 2018 at 6:11 PM, max <[email protected]> wrote: > Hi Kenton, > thanks a lot. It‘s very helpful. > it has kj::VectorOutputStream,but no kj::VectorInputStream, i dont know > why.it confuses me. > i have to write a custom implementation > > 在 2018年5月15日星期二 UTC+8上午6:22:04,Kenton Varda写道: >> >> Hi Max, >> >> You'll need to write a custom implementation of the kj::OutputStream >> interface, then pass it to `writePackedMessage()`. Or, you could use >> kj::ArrayOutputSteam or kj::VectorOutputStream, if you just want to write >> to an in-memory byte array. >> >> -Kenton >> >> On Mon, May 7, 2018 at 5:34 AM, max <[email protected]> wrote: >> >>> I am reading the code, >>> i can write a message to the file,but how can i serialize the message to >>> stream? >>> use writePackedMessage? >>> i just want to serialize the message ,but dont write the serialized >>> message to file ? >>> can you help me ? >>> >>> -- >>> 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]. >>> Visit this group at https://groups.google.com/group/capnproto. >>> >> >> -- > 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]. > Visit this group at https://groups.google.com/group/capnproto. > -- 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]. Visit this group at https://groups.google.com/group/capnproto.
