Make the MergeFrom method of type ReadOnlySequence<byte> public (#11124)

(Edited by jskeet) For public release notes:

Add a public `IMessage.MergeFrom(ReadOnlySequence<byte>)` extension method, exposing existing internal functionality.
(Parsing a completely new message from `ReadOnlySequence<byte>` was already publicly available, just not merging.)

----
Public the `MergeFrom` method of type `ReadOnlySequence<byte>`.

We found that the `MergeFrom` method of type `ReadOnlySequence<byte>` is internal.

**We need it !!!**

Closes #11124

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/11124 from VAllens:patch-1 0ddea03042
PiperOrigin-RevId: 504575534
pull/11659/head
Allen 2 years ago committed by Copybara-Service
parent 3774ee0acb
commit c4bac67464
  1. 9
      csharp/src/Google.Protobuf/MessageExtensions.cs

@ -88,6 +88,15 @@ namespace Google.Protobuf
public static void MergeFrom(this IMessage message, ReadOnlySpan<byte> span) =>
MergeFrom(message, span, false, null);
/// <summary>
/// Merges data from the given sequence into an existing message.
/// </summary>
/// <param name="message">The message to merge the data into.</param>
/// <param name="sequence">Sequence from the specified data to merge, which must be protobuf-encoded binary data.</param>
[SecuritySafeCritical]
public static void MergeFrom(this IMessage message, ReadOnlySequence<byte> sequence) =>
MergeFrom(message, sequence, false, null);
/// <summary>
/// Merges length-delimited data from the given stream into an existing message.
/// </summary>

Loading…
Cancel
Save