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
Currently the only way to access the binary serialization of a protocol buffer is using the toBinary() method which returns its own newly-allocated Uint8Array. If the protobuf needs to be written to a specific existing buffer, for example to include it adjacent to other data, it has to be recopied from the returned value which may be inefficient for large amounts of data or frequent transfers.
It would be great to have something like a writeToArray(array: Uint8Array, position: int = 0) method to write directly to an existing data buffer (along with a binaryLength getter so we can know how much space to allocate).
The text was updated successfully, but these errors were encountered:
Currently the only way to access the binary serialization of a protocol buffer is using the
toBinary()
method which returns its own newly-allocatedUint8Array
. If the protobuf needs to be written to a specific existing buffer, for example to include it adjacent to other data, it has to be recopied from the returned value which may be inefficient for large amounts of data or frequent transfers.It would be great to have something like a
writeToArray(array: Uint8Array, position: int = 0)
method to write directly to an existing data buffer (along with abinaryLength
getter so we can know how much space to allocate).The text was updated successfully, but these errors were encountered: