-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Buffer slices & copyless methods in RepeatedBytes #72
Comments
The What is the problem with the first pattern you posted? To me that seems cleaner than the proposed helpers. Should |
@ennerf Personally, I don't dislike the pattern. I just stumbled upon this during a profiling session. My team was used to the builder-style of protobuf-java and during migration to quickbuffers they ended up mapping Still, there are some scenarios where we have a template instance and we used to modify it via a shallow clone As for |
With the current API, it is 'tricky' to append byte[]s to an instance of RepeatedBytes without a copy.
The pattern is more or less like
It would by nice to have something like
When working with direct buffers, we must manifest a byte[] copy to transfer contents to a Message instance. Even though it is possible to avoid a second copy in RepeatedByte via setInternalArray, the same cannot be done in RepeatedBytes. Perhaps some helpers such as
could be useful too.
The text was updated successfully, but these errors were encountered: