You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the most efficient way to edit an existing message? Basically I want to set a few fields on an already built message, but it seems that I need the builder for that (as there are no set methods on the Reader).
Is there a basic concept what is best to use this? Thanks!
The text was updated successfully, but these errors were encountered:
You can call MessageBuilder.setRoot(), which requires a copy. We could also implement a way to construct a MessageBuilder from some existing buffers without needing to copy. Such a constructor might cause weird behavior on maliciously constructed input, but on trusted input it would be fine.
Note also that using Cap'n Proto as a mutable format requires some care. Whenever you set a pointer field to a new value you'll leave behind dead space in the message where the old value was. If you're just modifying primitive fields, this isn't a problem. Also, you can effectively "garbage collect" such dead space away by copying a message into a new MessageBuilder with setRoot().
What is the most efficient way to edit an existing message? Basically I want to set a few fields on an already built message, but it seems that I need the builder for that (as there are no set methods on the Reader).
Is there a basic concept what is best to use this? Thanks!
The text was updated successfully, but these errors were encountered: