I am creating a CAP'N PROTO builder object like this:
::capnp::MallocMessageBuilder message;
InjectorRequestMsg::Builder injectorRequestMsg = message.initRoot<InjectorRequestMsg>();
/Then setting all data members of injectorRequestMsg/
After that I am trying to write the object to a file like this:
writePackedMessageToFd(fd, message);
This works perfectly. But, I am not able to figure out how to write this object to an output stream object using the method:
void writePackedMessage(kj::BufferedOutputStream& output, MessageBuilder& builder);
Actually, I am having issues with creating a kj::BufferedOutputStream object.
Any idea or a simple example on this regard will be greatly helpful for me.
Thanks!