diff --git a/Makefile.am b/Makefile.am
index 0c7476d129..b873446611 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -90,8 +90,8 @@ csharp_EXTRA_DIST= \
csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs \
csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj \
csharp/src/Google.Protobuf.Benchmarks/GoogleMessageBenchmark.cs \
- csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs \
csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs \
+ csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs \
csharp/src/Google.Protobuf.Benchmarks/Program.cs \
csharp/src/Google.Protobuf.Benchmarks/wrapper_benchmark_messages.proto \
csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs \
@@ -122,7 +122,10 @@ csharp_EXTRA_DIST= \
csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs \
csharp/src/Google.Protobuf.Test/JsonParserTest.cs \
csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs \
+ csharp/src/Google.Protobuf.Test/LegacyGeneratedCodeTest.cs \
+ csharp/src/Google.Protobuf.Test/MessageParsingHelpers.cs \
csharp/src/Google.Protobuf.Test/Proto3OptionalTest.cs \
+ csharp/src/Google.Protobuf.Test/ReadOnlySequenceFactory.cs \
csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs \
csharp/src/Google.Protobuf.Test/Reflection/DescriptorDeclarationTest.cs \
csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs \
@@ -182,6 +185,7 @@ csharp_EXTRA_DIST= \
csharp/src/Google.Protobuf/FieldMaskTree.cs \
csharp/src/Google.Protobuf/FrameworkPortability.cs \
csharp/src/Google.Protobuf/Google.Protobuf.csproj \
+ csharp/src/Google.Protobuf/IBufferMessage.cs \
csharp/src/Google.Protobuf/ICustomDiagnosticMessage.cs \
csharp/src/Google.Protobuf/IDeepCloneable.cs \
csharp/src/Google.Protobuf/IExtendableMessage.cs \
@@ -196,7 +200,13 @@ csharp_EXTRA_DIST= \
csharp/src/Google.Protobuf/MessageExtensions.cs \
csharp/src/Google.Protobuf/MessageParser.cs \
csharp/src/Google.Protobuf/ObjectIntPair.cs \
+ csharp/src/Google.Protobuf/ParseContext.cs \
+ csharp/src/Google.Protobuf/ParserInternalState.cs \
+ csharp/src/Google.Protobuf/ParsingPrimitives.cs \
+ csharp/src/Google.Protobuf/ParsingPrimitivesMessages.cs \
+ csharp/src/Google.Protobuf/ParsingPrimitivesWrappers.cs \
csharp/src/Google.Protobuf/ProtoPreconditions.cs \
+ csharp/src/Google.Protobuf/SegmentedBufferHelper.cs \
csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs \
csharp/src/Google.Protobuf/Reflection/CustomOptions.cs \
csharp/src/Google.Protobuf/Reflection/Descriptor.cs \
diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamTest.cs
index 73a578d2b5..11d06f1d7b 100644
--- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamTest.cs
+++ b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamTest.cs
@@ -201,29 +201,29 @@ namespace Google.Protobuf
[Test]
public void DecodeZigZag32()
{
- Assert.AreEqual(0, CodedInputStream.DecodeZigZag32(0));
- Assert.AreEqual(-1, CodedInputStream.DecodeZigZag32(1));
- Assert.AreEqual(1, CodedInputStream.DecodeZigZag32(2));
- Assert.AreEqual(-2, CodedInputStream.DecodeZigZag32(3));
- Assert.AreEqual(0x3FFFFFFF, CodedInputStream.DecodeZigZag32(0x7FFFFFFE));
- Assert.AreEqual(unchecked((int) 0xC0000000), CodedInputStream.DecodeZigZag32(0x7FFFFFFF));
- Assert.AreEqual(0x7FFFFFFF, CodedInputStream.DecodeZigZag32(0xFFFFFFFE));
- Assert.AreEqual(unchecked((int) 0x80000000), CodedInputStream.DecodeZigZag32(0xFFFFFFFF));
+ Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag32(0));
+ Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag32(1));
+ Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag32(2));
+ Assert.AreEqual(-2, ParsingPrimitives.DecodeZigZag32(3));
+ Assert.AreEqual(0x3FFFFFFF, ParsingPrimitives.DecodeZigZag32(0x7FFFFFFE));
+ Assert.AreEqual(unchecked((int) 0xC0000000), ParsingPrimitives.DecodeZigZag32(0x7FFFFFFF));
+ Assert.AreEqual(0x7FFFFFFF, ParsingPrimitives.DecodeZigZag32(0xFFFFFFFE));
+ Assert.AreEqual(unchecked((int) 0x80000000), ParsingPrimitives.DecodeZigZag32(0xFFFFFFFF));
}
[Test]
public void DecodeZigZag64()
{
- Assert.AreEqual(0, CodedInputStream.DecodeZigZag64(0));
- Assert.AreEqual(-1, CodedInputStream.DecodeZigZag64(1));
- Assert.AreEqual(1, CodedInputStream.DecodeZigZag64(2));
- Assert.AreEqual(-2, CodedInputStream.DecodeZigZag64(3));
- Assert.AreEqual(0x000000003FFFFFFFL, CodedInputStream.DecodeZigZag64(0x000000007FFFFFFEL));
- Assert.AreEqual(unchecked((long) 0xFFFFFFFFC0000000L), CodedInputStream.DecodeZigZag64(0x000000007FFFFFFFL));
- Assert.AreEqual(0x000000007FFFFFFFL, CodedInputStream.DecodeZigZag64(0x00000000FFFFFFFEL));
- Assert.AreEqual(unchecked((long) 0xFFFFFFFF80000000L), CodedInputStream.DecodeZigZag64(0x00000000FFFFFFFFL));
- Assert.AreEqual(0x7FFFFFFFFFFFFFFFL, CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFEL));
- Assert.AreEqual(unchecked((long) 0x8000000000000000L), CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFFL));
+ Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag64(0));
+ Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag64(1));
+ Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag64(2));
+ Assert.AreEqual(-2, ParsingPrimitives.DecodeZigZag64(3));
+ Assert.AreEqual(0x000000003FFFFFFFL, ParsingPrimitives.DecodeZigZag64(0x000000007FFFFFFEL));
+ Assert.AreEqual(unchecked((long) 0xFFFFFFFFC0000000L), ParsingPrimitives.DecodeZigZag64(0x000000007FFFFFFFL));
+ Assert.AreEqual(0x000000007FFFFFFFL, ParsingPrimitives.DecodeZigZag64(0x00000000FFFFFFFEL));
+ Assert.AreEqual(unchecked((long) 0xFFFFFFFF80000000L), ParsingPrimitives.DecodeZigZag64(0x00000000FFFFFFFFL));
+ Assert.AreEqual(0x7FFFFFFFFFFFFFFFL, ParsingPrimitives.DecodeZigZag64(0xFFFFFFFFFFFFFFFEL));
+ Assert.AreEqual(unchecked((long) 0x8000000000000000L), ParsingPrimitives.DecodeZigZag64(0xFFFFFFFFFFFFFFFFL));
}
[Test]
diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedOutputStreamTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedOutputStreamTest.cs
index 01bd3218f3..f25e14e968 100644
--- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedOutputStreamTest.cs
+++ b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedOutputStreamTest.cs
@@ -247,26 +247,26 @@ namespace Google.Protobuf
{
// Some easier-to-verify round-trip tests. The inputs (other than 0, 1, -1)
// were chosen semi-randomly via keyboard bashing.
- Assert.AreEqual(0, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(0)));
- Assert.AreEqual(1, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(1)));
- Assert.AreEqual(-1, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(-1)));
- Assert.AreEqual(14927, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(14927)));
- Assert.AreEqual(-3612, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(-3612)));
+ Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(0)));
+ Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(1)));
+ Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(-1)));
+ Assert.AreEqual(14927, ParsingPrimitives.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(14927)));
+ Assert.AreEqual(-3612, ParsingPrimitives.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(-3612)));
}
[Test]
public void RoundTripZigZag64()
{
- Assert.AreEqual(0, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(0)));
- Assert.AreEqual(1, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(1)));
- Assert.AreEqual(-1, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-1)));
- Assert.AreEqual(14927, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(14927)));
- Assert.AreEqual(-3612, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-3612)));
+ Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(0)));
+ Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(1)));
+ Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-1)));
+ Assert.AreEqual(14927, ParsingPrimitives.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(14927)));
+ Assert.AreEqual(-3612, ParsingPrimitives.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-3612)));
Assert.AreEqual(856912304801416L,
- CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(856912304801416L)));
+ ParsingPrimitives.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(856912304801416L)));
Assert.AreEqual(-75123905439571256L,
- CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-75123905439571256L)));
+ ParsingPrimitives.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-75123905439571256L)));
}
[Test]
diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/FieldCodecTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/FieldCodecTest.cs
index 3907666827..a5825a0708 100644
--- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/FieldCodecTest.cs
+++ b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/FieldCodecTest.cs
@@ -128,7 +128,7 @@ namespace Google.Protobuf
codedOutput.Flush();
stream.Position = 0;
var codedInput = new CodedInputStream(stream);
- Assert.AreEqual(sampleValue, codec.ValueReader(codedInput));
+ Assert.AreEqual(sampleValue, codec.Read(codedInput));
Assert.IsTrue(codedInput.IsAtEnd);
}
@@ -178,7 +178,7 @@ namespace Google.Protobuf
Assert.AreEqual(stream.Position, codec.ValueSizeCalculator(codec.DefaultValue));
stream.Position = 0;
var codedInput = new CodedInputStream(stream);
- Assert.AreEqual(codec.DefaultValue, codec.ValueReader(codedInput));
+ Assert.AreEqual(codec.DefaultValue, codec.Read(codedInput));
}
}
diff --git a/csharp/src/AddressBook/Addressbook.cs b/csharp/src/AddressBook/Addressbook.cs
index cbd9772696..3b1da4d613 100644
--- a/csharp/src/AddressBook/Addressbook.cs
+++ b/csharp/src/AddressBook/Addressbook.cs
@@ -49,7 +49,7 @@ namespace Google.Protobuf.Examples.AddressBook {
///
/// [START messages]
///
- public sealed partial class Person : pb::IMessage {
+ public sealed partial class Person : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Person());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -256,11 +256,16 @@ namespace Google.Protobuf.Examples.AddressBook {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
Name = input.ReadString();
@@ -275,7 +280,7 @@ namespace Google.Protobuf.Examples.AddressBook {
break;
}
case 34: {
- phones_.AddEntriesFrom(input, _repeated_phones_codec);
+ phones_.AddEntriesFrom(ref input, _repeated_phones_codec);
break;
}
case 42: {
@@ -299,7 +304,7 @@ namespace Google.Protobuf.Examples.AddressBook {
[pbr::OriginalName("WORK")] Work = 2,
}
- public sealed partial class PhoneNumber : pb::IMessage {
+ public sealed partial class PhoneNumber : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PhoneNumber());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -436,11 +441,16 @@ namespace Google.Protobuf.Examples.AddressBook {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
Number = input.ReadString();
@@ -464,7 +474,7 @@ namespace Google.Protobuf.Examples.AddressBook {
///
/// Our address book file is just one of these.
///
- public sealed partial class AddressBook : pb::IMessage {
+ public sealed partial class AddressBook : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AddressBook());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -569,14 +579,19 @@ namespace Google.Protobuf.Examples.AddressBook {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
- people_.AddEntriesFrom(input, _repeated_people_codec);
+ people_.AddEntriesFrom(ref input, _repeated_people_codec);
break;
}
}
diff --git a/csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs b/csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs
index 9e8c330a2b..291a585ca8 100644
--- a/csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs
+++ b/csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs
@@ -64,7 +64,7 @@ namespace Benchmarks.Proto3 {
}
#region Messages
- public sealed partial class GoogleMessage1 : pb::IMessage {
+ public sealed partial class GoogleMessage1 : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GoogleMessage1());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1132,11 +1132,16 @@ namespace Benchmarks.Proto3 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
Field1 = input.ReadString();
@@ -1156,7 +1161,7 @@ namespace Benchmarks.Proto3 {
}
case 42:
case 41: {
- field5_.AddEntriesFrom(input, _repeated_field5_codec);
+ field5_.AddEntriesFrom(ref input, _repeated_field5_codec);
break;
}
case 48: {
@@ -1312,7 +1317,7 @@ namespace Benchmarks.Proto3 {
}
- public sealed partial class GoogleMessage1SubMessage : pb::IMessage {
+ public sealed partial class GoogleMessage1SubMessage : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GoogleMessage1SubMessage());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1881,11 +1886,16 @@ namespace Benchmarks.Proto3 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
Field1 = input.ReadInt32();
diff --git a/csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs b/csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs
index 01dfcd72dc..456edbf41c 100644
--- a/csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs
+++ b/csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs
@@ -38,7 +38,7 @@ namespace Benchmarks {
}
#region Messages
- public sealed partial class BenchmarkDataset : pb::IMessage {
+ public sealed partial class BenchmarkDataset : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BenchmarkDataset());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -219,11 +219,16 @@ namespace Benchmarks {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
Name = input.ReadString();
@@ -234,7 +239,7 @@ namespace Benchmarks {
break;
}
case 26: {
- payload_.AddEntriesFrom(input, _repeated_payload_codec);
+ payload_.AddEntriesFrom(ref input, _repeated_payload_codec);
break;
}
}
diff --git a/csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj b/csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj
index ecc064ea7d..7432168210 100644
--- a/csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj
+++ b/csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj
@@ -3,6 +3,9 @@
Exe
netcoreapp2.1
+ ../../keys/Google.Protobuf.snk
+ true
+ true
False
diff --git a/csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs b/csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs
index cbc47328fa..30f3e9ef37 100644
--- a/csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs
+++ b/csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs
@@ -65,18 +65,36 @@ namespace Google.Protobuf.Benchmarks
return manyWrapperFieldsTest.ParseFromByteArray();
}
+ [Benchmark]
+ public IMessage ManyWrapperFieldsMessage_ParseFromReadOnlySequence()
+ {
+ return manyWrapperFieldsTest.ParseFromReadOnlySequence();
+ }
+
[Benchmark]
public IMessage ManyPrimitiveFieldsMessage_ParseFromByteArray()
{
return manyPrimitiveFieldsTest.ParseFromByteArray();
}
+ [Benchmark]
+ public IMessage ManyPrimitiveFieldsMessage_ParseFromReadOnlySequence()
+ {
+ return manyPrimitiveFieldsTest.ParseFromReadOnlySequence();
+ }
+
[Benchmark]
public IMessage EmptyMessage_ParseFromByteArray()
{
return emptyMessageTest.ParseFromByteArray();
}
+ [Benchmark]
+ public IMessage EmptyMessage_ParseFromReadOnlySequence()
+ {
+ return emptyMessageTest.ParseFromReadOnlySequence();
+ }
+
[Benchmark]
[ArgumentsSource(nameof(MessageCountValues))]
public void ManyWrapperFieldsMessage_ParseDelimitedMessagesFromByteArray(int messageCount)
@@ -84,6 +102,13 @@ namespace Google.Protobuf.Benchmarks
manyWrapperFieldsTest.ParseDelimitedMessagesFromByteArray(messageCount);
}
+ [Benchmark]
+ [ArgumentsSource(nameof(MessageCountValues))]
+ public void ManyWrapperFieldsMessage_ParseDelimitedMessagesFromReadOnlySequence(int messageCount)
+ {
+ manyWrapperFieldsTest.ParseDelimitedMessagesFromReadOnlySequence(messageCount);
+ }
+
[Benchmark]
[ArgumentsSource(nameof(MessageCountValues))]
public void ManyPrimitiveFieldsMessage_ParseDelimitedMessagesFromByteArray(int messageCount)
@@ -91,6 +116,13 @@ namespace Google.Protobuf.Benchmarks
manyPrimitiveFieldsTest.ParseDelimitedMessagesFromByteArray(messageCount);
}
+ [Benchmark]
+ [ArgumentsSource(nameof(MessageCountValues))]
+ public void ManyPrimitiveFieldsMessage_ParseDelimitedMessagesFromReadOnlySequence(int messageCount)
+ {
+ manyPrimitiveFieldsTest.ParseDelimitedMessagesFromReadOnlySequence(messageCount);
+ }
+
private static ManyWrapperFieldsMessage CreateManyWrapperFieldsMessage()
{
// Example data match data of an internal benchmarks
@@ -133,6 +165,9 @@ namespace Google.Protobuf.Benchmarks
private readonly byte[] data;
private readonly byte[] multipleMessagesData;
+ private ReadOnlySequence dataSequence;
+ private ReadOnlySequence multipleMessagesDataSequence;
+
public SubTest(IMessage message, MessageParser parser, Func factory, int maxMessageCount)
{
this.message = message;
@@ -140,10 +175,14 @@ namespace Google.Protobuf.Benchmarks
this.factory = factory;
this.data = message.ToByteArray();
this.multipleMessagesData = CreateBufferWithMultipleMessages(message, maxMessageCount);
+ this.dataSequence = new ReadOnlySequence(this.data);
+ this.multipleMessagesDataSequence = new ReadOnlySequence(this.multipleMessagesData);
}
public IMessage ParseFromByteArray() => parser.ParseFrom(data);
+ public IMessage ParseFromReadOnlySequence() => parser.ParseFrom(dataSequence);
+
public void ParseDelimitedMessagesFromByteArray(int messageCount)
{
var input = new CodedInputStream(multipleMessagesData);
@@ -154,6 +193,16 @@ namespace Google.Protobuf.Benchmarks
}
}
+ public void ParseDelimitedMessagesFromReadOnlySequence(int messageCount)
+ {
+ ParseContext.Initialize(multipleMessagesDataSequence, out ParseContext ctx);
+ for (int i = 0; i < messageCount; i++)
+ {
+ var msg = factory();
+ ctx.ReadMessage(msg);
+ }
+ }
+
private static byte[] CreateBufferWithMultipleMessages(IMessage msg, int msgCount)
{
var ms = new MemoryStream();
diff --git a/csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs b/csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs
index 44dde2ff8c..863e74dc49 100644
--- a/csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs
+++ b/csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs
@@ -35,6 +35,7 @@ using System;
using System.Buffers.Binary;
using System.Collections.Generic;
using System.IO;
+using System.Buffers;
namespace Google.Protobuf.Benchmarks
{
@@ -51,8 +52,13 @@ namespace Google.Protobuf.Benchmarks
byte[] floatInputBuffer;
byte[] fixedIntInputBuffer;
+ // key is the encodedSize of string values
+ Dictionary stringInputBuffers;
+
Random random = new Random(417384220); // random but deterministic seed
+ public IEnumerable StringEncodedSizes => new[] { 1, 4, 10, 105, 10080 };
+
[GlobalSetup]
public void GlobalSetup()
{
@@ -70,6 +76,13 @@ namespace Google.Protobuf.Benchmarks
doubleInputBuffer = CreateBufferWithRandomDoubles(random, BytesToParse / sizeof(double), paddingValueCount);
floatInputBuffer = CreateBufferWithRandomFloats(random, BytesToParse / sizeof(float), paddingValueCount);
fixedIntInputBuffer = CreateBufferWithRandomData(random, BytesToParse / sizeof(long), sizeof(long), paddingValueCount);
+
+ stringInputBuffers = new Dictionary();
+ foreach(var encodedSize in StringEncodedSizes)
+ {
+ byte[] buffer = CreateBufferWithStrings(BytesToParse / encodedSize, encodedSize, encodedSize < 10 ? 10 : 1 );
+ stringInputBuffers.Add(encodedSize, buffer);
+ }
}
// Total number of bytes that each benchmark will parse.
@@ -85,7 +98,7 @@ namespace Google.Protobuf.Benchmarks
[Arguments(3)]
[Arguments(4)]
[Arguments(5)]
- public int ParseRawVarint32(int encodedSize)
+ public int ParseRawVarint32_CodedInputStream(int encodedSize)
{
CodedInputStream cis = new CodedInputStream(varintInputBuffers[encodedSize]);
int sum = 0;
@@ -96,6 +109,23 @@ namespace Google.Protobuf.Benchmarks
return sum;
}
+ [Benchmark]
+ [Arguments(1)]
+ [Arguments(2)]
+ [Arguments(3)]
+ [Arguments(4)]
+ [Arguments(5)]
+ public int ParseRawVarint32_ParseContext(int encodedSize)
+ {
+ InitializeParseContext(varintInputBuffers[encodedSize], out ParseContext ctx);
+ int sum = 0;
+ for (int i = 0; i < BytesToParse / encodedSize; i++)
+ {
+ sum += ctx.ReadInt32();
+ }
+ return sum;
+ }
+
[Benchmark]
[Arguments(1)]
[Arguments(2)]
@@ -107,7 +137,7 @@ namespace Google.Protobuf.Benchmarks
[Arguments(8)]
[Arguments(9)]
[Arguments(10)]
- public long ParseRawVarint64(int encodedSize)
+ public long ParseRawVarint64_CodedInputStream(int encodedSize)
{
CodedInputStream cis = new CodedInputStream(varintInputBuffers[encodedSize]);
long sum = 0;
@@ -119,7 +149,29 @@ namespace Google.Protobuf.Benchmarks
}
[Benchmark]
- public uint ParseFixed32()
+ [Arguments(1)]
+ [Arguments(2)]
+ [Arguments(3)]
+ [Arguments(4)]
+ [Arguments(5)]
+ [Arguments(6)]
+ [Arguments(7)]
+ [Arguments(8)]
+ [Arguments(9)]
+ [Arguments(10)]
+ public long ParseRawVarint64_ParseContext(int encodedSize)
+ {
+ InitializeParseContext(varintInputBuffers[encodedSize], out ParseContext ctx);
+ long sum = 0;
+ for (int i = 0; i < BytesToParse / encodedSize; i++)
+ {
+ sum += ctx.ReadInt64();
+ }
+ return sum;
+ }
+
+ [Benchmark]
+ public uint ParseFixed32_CodedInputStream()
{
const int encodedSize = sizeof(uint);
CodedInputStream cis = new CodedInputStream(fixedIntInputBuffer);
@@ -132,7 +184,20 @@ namespace Google.Protobuf.Benchmarks
}
[Benchmark]
- public ulong ParseFixed64()
+ public uint ParseFixed32_ParseContext()
+ {
+ const int encodedSize = sizeof(uint);
+ InitializeParseContext(fixedIntInputBuffer, out ParseContext ctx);
+ uint sum = 0;
+ for (uint i = 0; i < BytesToParse / encodedSize; i++)
+ {
+ sum += ctx.ReadFixed32();
+ }
+ return sum;
+ }
+
+ [Benchmark]
+ public ulong ParseFixed64_CodedInputStream()
{
const int encodedSize = sizeof(ulong);
CodedInputStream cis = new CodedInputStream(fixedIntInputBuffer);
@@ -145,7 +210,20 @@ namespace Google.Protobuf.Benchmarks
}
[Benchmark]
- public float ParseRawFloat()
+ public ulong ParseFixed64_ParseContext()
+ {
+ const int encodedSize = sizeof(ulong);
+ InitializeParseContext(fixedIntInputBuffer, out ParseContext ctx);
+ ulong sum = 0;
+ for (int i = 0; i < BytesToParse / encodedSize; i++)
+ {
+ sum += ctx.ReadFixed64();
+ }
+ return sum;
+ }
+
+ [Benchmark]
+ public float ParseRawFloat_CodedInputStream()
{
const int encodedSize = sizeof(float);
CodedInputStream cis = new CodedInputStream(floatInputBuffer);
@@ -158,7 +236,20 @@ namespace Google.Protobuf.Benchmarks
}
[Benchmark]
- public double ParseRawDouble()
+ public float ParseRawFloat_ParseContext()
+ {
+ const int encodedSize = sizeof(float);
+ InitializeParseContext(floatInputBuffer, out ParseContext ctx);
+ float sum = 0;
+ for (int i = 0; i < BytesToParse / encodedSize; i++)
+ {
+ sum += ctx.ReadFloat();
+ }
+ return sum;
+ }
+
+ [Benchmark]
+ public double ParseRawDouble_CodedInputStream()
{
const int encodedSize = sizeof(double);
CodedInputStream cis = new CodedInputStream(doubleInputBuffer);
@@ -170,6 +261,76 @@ namespace Google.Protobuf.Benchmarks
return sum;
}
+ [Benchmark]
+ public double ParseRawDouble_ParseContext()
+ {
+ const int encodedSize = sizeof(double);
+ InitializeParseContext(doubleInputBuffer, out ParseContext ctx);
+ double sum = 0;
+ for (int i = 0; i < BytesToParse / encodedSize; i++)
+ {
+ sum += ctx.ReadDouble();
+ }
+ return sum;
+ }
+
+ [Benchmark]
+ [ArgumentsSource(nameof(StringEncodedSizes))]
+ public int ParseString_CodedInputStream(int encodedSize)
+ {
+ CodedInputStream cis = new CodedInputStream(stringInputBuffers[encodedSize]);
+ int sum = 0;
+ for (int i = 0; i < BytesToParse / encodedSize; i++)
+ {
+ sum += cis.ReadString().Length;
+ }
+ return sum;
+ }
+
+ [Benchmark]
+ [ArgumentsSource(nameof(StringEncodedSizes))]
+ public int ParseString_ParseContext(int encodedSize)
+ {
+ InitializeParseContext(stringInputBuffers[encodedSize], out ParseContext ctx);
+ int sum = 0;
+ for (int i = 0; i < BytesToParse / encodedSize; i++)
+ {
+ sum += ctx.ReadString().Length;
+ }
+ return sum;
+ }
+
+ [Benchmark]
+ [ArgumentsSource(nameof(StringEncodedSizes))]
+ public int ParseBytes_CodedInputStream(int encodedSize)
+ {
+ CodedInputStream cis = new CodedInputStream(stringInputBuffers[encodedSize]);
+ int sum = 0;
+ for (int i = 0; i < BytesToParse / encodedSize; i++)
+ {
+ sum += cis.ReadBytes().Length;
+ }
+ return sum;
+ }
+
+ [Benchmark]
+ [ArgumentsSource(nameof(StringEncodedSizes))]
+ public int ParseBytes_ParseContext(int encodedSize)
+ {
+ InitializeParseContext(stringInputBuffers[encodedSize], out ParseContext ctx);
+ int sum = 0;
+ for (int i = 0; i < BytesToParse / encodedSize; i++)
+ {
+ sum += ctx.ReadBytes().Length;
+ }
+ return sum;
+ }
+
+ private static void InitializeParseContext(byte[] buffer, out ParseContext ctx)
+ {
+ ParseContext.Initialize(new ReadOnlySequence(buffer), out ctx);
+ }
+
private static byte[] CreateBufferWithRandomVarints(Random random, int valueCount, int encodedSize, int paddingValueCount)
{
MemoryStream ms = new MemoryStream();
@@ -261,5 +422,40 @@ namespace Google.Protobuf.Benchmarks
}
return result;
}
+
+ private static byte[] CreateBufferWithStrings(int valueCount, int encodedSize, int paddingValueCount)
+ {
+ var str = CreateStringWithEncodedSize(encodedSize);
+
+ MemoryStream ms = new MemoryStream();
+ CodedOutputStream cos = new CodedOutputStream(ms);
+ for (int i = 0; i < valueCount + paddingValueCount; i++)
+ {
+ cos.WriteString(str);
+ }
+ cos.Flush();
+ var buffer = ms.ToArray();
+
+ if (buffer.Length != encodedSize * (valueCount + paddingValueCount))
+ {
+ throw new InvalidOperationException($"Unexpected output buffer length {buffer.Length}");
+ }
+ return buffer;
+ }
+
+ private static string CreateStringWithEncodedSize(int encodedSize)
+ {
+ var str = new string('a', encodedSize);
+ while (CodedOutputStream.ComputeStringSize(str) > encodedSize)
+ {
+ str = str.Substring(1);
+ }
+
+ if (CodedOutputStream.ComputeStringSize(str) != encodedSize)
+ {
+ throw new InvalidOperationException($"Generated string with wrong encodedSize");
+ }
+ return str;
+ }
}
}
diff --git a/csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs b/csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs
index 0cc86e2ad4..76e95d6edf 100644
--- a/csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs
+++ b/csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs
@@ -237,7 +237,7 @@ namespace Google.Protobuf.Benchmarks {
/// a message that has a large number of wrapper fields
/// obfuscated version of an internal message
///
- public sealed partial class ManyWrapperFieldsMessage : pb::IMessage {
+ public sealed partial class ManyWrapperFieldsMessage : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManyWrapperFieldsMessage());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3303,434 +3303,439 @@ namespace Google.Protobuf.Benchmarks {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
- double? value = _single_doubleField1_codec.Read(input);
+ double? value = _single_doubleField1_codec.Read(ref input);
if (doubleField1_ == null || value != 0D) {
DoubleField1 = value;
}
break;
}
case 18: {
- long? value = _single_int64Field2_codec.Read(input);
+ long? value = _single_int64Field2_codec.Read(ref input);
if (int64Field2_ == null || value != 0L) {
Int64Field2 = value;
}
break;
}
case 26: {
- long? value = _single_int64Field3_codec.Read(input);
+ long? value = _single_int64Field3_codec.Read(ref input);
if (int64Field3_ == null || value != 0L) {
Int64Field3 = value;
}
break;
}
case 34: {
- long? value = _single_int64Field4_codec.Read(input);
+ long? value = _single_int64Field4_codec.Read(ref input);
if (int64Field4_ == null || value != 0L) {
Int64Field4 = value;
}
break;
}
case 58: {
- double? value = _single_doubleField7_codec.Read(input);
+ double? value = _single_doubleField7_codec.Read(ref input);
if (doubleField7_ == null || value != 0D) {
DoubleField7 = value;
}
break;
}
case 66: {
- double? value = _single_doubleField8_codec.Read(input);
+ double? value = _single_doubleField8_codec.Read(ref input);
if (doubleField8_ == null || value != 0D) {
DoubleField8 = value;
}
break;
}
case 74: {
- double? value = _single_doubleField9_codec.Read(input);
+ double? value = _single_doubleField9_codec.Read(ref input);
if (doubleField9_ == null || value != 0D) {
DoubleField9 = value;
}
break;
}
case 82: {
- double? value = _single_doubleField10_codec.Read(input);
+ double? value = _single_doubleField10_codec.Read(ref input);
if (doubleField10_ == null || value != 0D) {
DoubleField10 = value;
}
break;
}
case 90: {
- double? value = _single_doubleField11_codec.Read(input);
+ double? value = _single_doubleField11_codec.Read(ref input);
if (doubleField11_ == null || value != 0D) {
DoubleField11 = value;
}
break;
}
case 114: {
- double? value = _single_doubleField14_codec.Read(input);
+ double? value = _single_doubleField14_codec.Read(ref input);
if (doubleField14_ == null || value != 0D) {
DoubleField14 = value;
}
break;
}
case 122: {
- double? value = _single_doubleField15_codec.Read(input);
+ double? value = _single_doubleField15_codec.Read(ref input);
if (doubleField15_ == null || value != 0D) {
DoubleField15 = value;
}
break;
}
case 154: {
- long? value = _single_int64Field19_codec.Read(input);
+ long? value = _single_int64Field19_codec.Read(ref input);
if (int64Field19_ == null || value != 0L) {
Int64Field19 = value;
}
break;
}
case 162: {
- double? value = _single_doubleField20_codec.Read(input);
+ double? value = _single_doubleField20_codec.Read(ref input);
if (doubleField20_ == null || value != 0D) {
DoubleField20 = value;
}
break;
}
case 170: {
- double? value = _single_doubleField21_codec.Read(input);
+ double? value = _single_doubleField21_codec.Read(ref input);
if (doubleField21_ == null || value != 0D) {
DoubleField21 = value;
}
break;
}
case 178: {
- double? value = _single_doubleField22_codec.Read(input);
+ double? value = _single_doubleField22_codec.Read(ref input);
if (doubleField22_ == null || value != 0D) {
DoubleField22 = value;
}
break;
}
case 202: {
- double? value = _single_doubleField25_codec.Read(input);
+ double? value = _single_doubleField25_codec.Read(ref input);
if (doubleField25_ == null || value != 0D) {
DoubleField25 = value;
}
break;
}
case 210: {
- long? value = _single_int64Field26_codec.Read(input);
+ long? value = _single_int64Field26_codec.Read(ref input);
if (int64Field26_ == null || value != 0L) {
Int64Field26 = value;
}
break;
}
case 226: {
- double? value = _single_doubleField28_codec.Read(input);
+ double? value = _single_doubleField28_codec.Read(ref input);
if (doubleField28_ == null || value != 0D) {
DoubleField28 = value;
}
break;
}
case 234: {
- double? value = _single_doubleField29_codec.Read(input);
+ double? value = _single_doubleField29_codec.Read(ref input);
if (doubleField29_ == null || value != 0D) {
DoubleField29 = value;
}
break;
}
case 242: {
- double? value = _single_doubleField30_codec.Read(input);
+ double? value = _single_doubleField30_codec.Read(ref input);
if (doubleField30_ == null || value != 0D) {
DoubleField30 = value;
}
break;
}
case 250: {
- double? value = _single_doubleField31_codec.Read(input);
+ double? value = _single_doubleField31_codec.Read(ref input);
if (doubleField31_ == null || value != 0D) {
DoubleField31 = value;
}
break;
}
case 258: {
- long? value = _single_int64Field32_codec.Read(input);
+ long? value = _single_int64Field32_codec.Read(ref input);
if (int64Field32_ == null || value != 0L) {
Int64Field32 = value;
}
break;
}
case 298: {
- long? value = _single_int64Field37_codec.Read(input);
+ long? value = _single_int64Field37_codec.Read(ref input);
if (int64Field37_ == null || value != 0L) {
Int64Field37 = value;
}
break;
}
case 306: {
- double? value = _single_doubleField38_codec.Read(input);
+ double? value = _single_doubleField38_codec.Read(ref input);
if (doubleField38_ == null || value != 0D) {
DoubleField38 = value;
}
break;
}
case 314: {
- long? value = _single_interactions_codec.Read(input);
+ long? value = _single_interactions_codec.Read(ref input);
if (interactions_ == null || value != 0L) {
Interactions = value;
}
break;
}
case 322: {
- double? value = _single_doubleField40_codec.Read(input);
+ double? value = _single_doubleField40_codec.Read(ref input);
if (doubleField40_ == null || value != 0D) {
DoubleField40 = value;
}
break;
}
case 330: {
- long? value = _single_int64Field41_codec.Read(input);
+ long? value = _single_int64Field41_codec.Read(ref input);
if (int64Field41_ == null || value != 0L) {
Int64Field41 = value;
}
break;
}
case 338: {
- double? value = _single_doubleField42_codec.Read(input);
+ double? value = _single_doubleField42_codec.Read(ref input);
if (doubleField42_ == null || value != 0D) {
DoubleField42 = value;
}
break;
}
case 346: {
- long? value = _single_int64Field43_codec.Read(input);
+ long? value = _single_int64Field43_codec.Read(ref input);
if (int64Field43_ == null || value != 0L) {
Int64Field43 = value;
}
break;
}
case 354: {
- long? value = _single_int64Field44_codec.Read(input);
+ long? value = _single_int64Field44_codec.Read(ref input);
if (int64Field44_ == null || value != 0L) {
Int64Field44 = value;
}
break;
}
case 362: {
- double? value = _single_doubleField45_codec.Read(input);
+ double? value = _single_doubleField45_codec.Read(ref input);
if (doubleField45_ == null || value != 0D) {
DoubleField45 = value;
}
break;
}
case 370: {
- double? value = _single_doubleField46_codec.Read(input);
+ double? value = _single_doubleField46_codec.Read(ref input);
if (doubleField46_ == null || value != 0D) {
DoubleField46 = value;
}
break;
}
case 378: {
- double? value = _single_doubleField47_codec.Read(input);
+ double? value = _single_doubleField47_codec.Read(ref input);
if (doubleField47_ == null || value != 0D) {
DoubleField47 = value;
}
break;
}
case 386: {
- double? value = _single_doubleField48_codec.Read(input);
+ double? value = _single_doubleField48_codec.Read(ref input);
if (doubleField48_ == null || value != 0D) {
DoubleField48 = value;
}
break;
}
case 394: {
- double? value = _single_doubleField49_codec.Read(input);
+ double? value = _single_doubleField49_codec.Read(ref input);
if (doubleField49_ == null || value != 0D) {
DoubleField49 = value;
}
break;
}
case 402: {
- double? value = _single_doubleField50_codec.Read(input);
+ double? value = _single_doubleField50_codec.Read(ref input);
if (doubleField50_ == null || value != 0D) {
DoubleField50 = value;
}
break;
}
case 410: {
- double? value = _single_doubleField51_codec.Read(input);
+ double? value = _single_doubleField51_codec.Read(ref input);
if (doubleField51_ == null || value != 0D) {
DoubleField51 = value;
}
break;
}
case 418: {
- double? value = _single_doubleField52_codec.Read(input);
+ double? value = _single_doubleField52_codec.Read(ref input);
if (doubleField52_ == null || value != 0D) {
DoubleField52 = value;
}
break;
}
case 426: {
- double? value = _single_doubleField53_codec.Read(input);
+ double? value = _single_doubleField53_codec.Read(ref input);
if (doubleField53_ == null || value != 0D) {
DoubleField53 = value;
}
break;
}
case 434: {
- double? value = _single_doubleField54_codec.Read(input);
+ double? value = _single_doubleField54_codec.Read(ref input);
if (doubleField54_ == null || value != 0D) {
DoubleField54 = value;
}
break;
}
case 442: {
- double? value = _single_doubleField55_codec.Read(input);
+ double? value = _single_doubleField55_codec.Read(ref input);
if (doubleField55_ == null || value != 0D) {
DoubleField55 = value;
}
break;
}
case 450: {
- double? value = _single_doubleField56_codec.Read(input);
+ double? value = _single_doubleField56_codec.Read(ref input);
if (doubleField56_ == null || value != 0D) {
DoubleField56 = value;
}
break;
}
case 458: {
- double? value = _single_doubleField57_codec.Read(input);
+ double? value = _single_doubleField57_codec.Read(ref input);
if (doubleField57_ == null || value != 0D) {
DoubleField57 = value;
}
break;
}
case 466: {
- double? value = _single_doubleField58_codec.Read(input);
+ double? value = _single_doubleField58_codec.Read(ref input);
if (doubleField58_ == null || value != 0D) {
DoubleField58 = value;
}
break;
}
case 474: {
- long? value = _single_int64Field59_codec.Read(input);
+ long? value = _single_int64Field59_codec.Read(ref input);
if (int64Field59_ == null || value != 0L) {
Int64Field59 = value;
}
break;
}
case 482: {
- long? value = _single_int64Field60_codec.Read(input);
+ long? value = _single_int64Field60_codec.Read(ref input);
if (int64Field60_ == null || value != 0L) {
Int64Field60 = value;
}
break;
}
case 498: {
- double? value = _single_doubleField62_codec.Read(input);
+ double? value = _single_doubleField62_codec.Read(ref input);
if (doubleField62_ == null || value != 0D) {
DoubleField62 = value;
}
break;
}
case 522: {
- double? value = _single_doubleField65_codec.Read(input);
+ double? value = _single_doubleField65_codec.Read(ref input);
if (doubleField65_ == null || value != 0D) {
DoubleField65 = value;
}
break;
}
case 530: {
- double? value = _single_doubleField66_codec.Read(input);
+ double? value = _single_doubleField66_codec.Read(ref input);
if (doubleField66_ == null || value != 0D) {
DoubleField66 = value;
}
break;
}
case 538: {
- double? value = _single_doubleField67_codec.Read(input);
+ double? value = _single_doubleField67_codec.Read(ref input);
if (doubleField67_ == null || value != 0D) {
DoubleField67 = value;
}
break;
}
case 546: {
- double? value = _single_doubleField68_codec.Read(input);
+ double? value = _single_doubleField68_codec.Read(ref input);
if (doubleField68_ == null || value != 0D) {
DoubleField68 = value;
}
break;
}
case 554: {
- double? value = _single_doubleField69_codec.Read(input);
+ double? value = _single_doubleField69_codec.Read(ref input);
if (doubleField69_ == null || value != 0D) {
DoubleField69 = value;
}
break;
}
case 562: {
- double? value = _single_doubleField70_codec.Read(input);
+ double? value = _single_doubleField70_codec.Read(ref input);
if (doubleField70_ == null || value != 0D) {
DoubleField70 = value;
}
break;
}
case 570: {
- double? value = _single_doubleField71_codec.Read(input);
+ double? value = _single_doubleField71_codec.Read(ref input);
if (doubleField71_ == null || value != 0D) {
DoubleField71 = value;
}
break;
}
case 578: {
- double? value = _single_doubleField72_codec.Read(input);
+ double? value = _single_doubleField72_codec.Read(ref input);
if (doubleField72_ == null || value != 0D) {
DoubleField72 = value;
}
break;
}
case 586: {
- string value = _single_stringField73_codec.Read(input);
+ string value = _single_stringField73_codec.Read(ref input);
if (stringField73_ == null || value != "") {
StringField73 = value;
}
break;
}
case 594: {
- string value = _single_stringField74_codec.Read(input);
+ string value = _single_stringField74_codec.Read(ref input);
if (stringField74_ == null || value != "") {
StringField74 = value;
}
break;
}
case 602: {
- double? value = _single_doubleField75_codec.Read(input);
+ double? value = _single_doubleField75_codec.Read(ref input);
if (doubleField75_ == null || value != 0D) {
DoubleField75 = value;
}
break;
}
case 618: {
- double? value = _single_doubleField77_codec.Read(input);
+ double? value = _single_doubleField77_codec.Read(ref input);
if (doubleField77_ == null || value != 0D) {
DoubleField77 = value;
}
break;
}
case 626: {
- double? value = _single_doubleField78_codec.Read(input);
+ double? value = _single_doubleField78_codec.Read(ref input);
if (doubleField78_ == null || value != 0D) {
DoubleField78 = value;
}
break;
}
case 634: {
- double? value = _single_doubleField79_codec.Read(input);
+ double? value = _single_doubleField79_codec.Read(ref input);
if (doubleField79_ == null || value != 0D) {
DoubleField79 = value;
}
@@ -3745,7 +3750,7 @@ namespace Google.Protobuf.Benchmarks {
break;
}
case 658: {
- long? value = _single_int64Field82_codec.Read(input);
+ long? value = _single_int64Field82_codec.Read(ref input);
if (int64Field82_ == null || value != 0L) {
Int64Field82 = value;
}
@@ -3756,112 +3761,112 @@ namespace Google.Protobuf.Benchmarks {
break;
}
case 674: {
- double? value = _single_doubleField84_codec.Read(input);
+ double? value = _single_doubleField84_codec.Read(ref input);
if (doubleField84_ == null || value != 0D) {
DoubleField84 = value;
}
break;
}
case 682: {
- long? value = _single_int64Field85_codec.Read(input);
+ long? value = _single_int64Field85_codec.Read(ref input);
if (int64Field85_ == null || value != 0L) {
Int64Field85 = value;
}
break;
}
case 690: {
- long? value = _single_int64Field86_codec.Read(input);
+ long? value = _single_int64Field86_codec.Read(ref input);
if (int64Field86_ == null || value != 0L) {
Int64Field86 = value;
}
break;
}
case 698: {
- long? value = _single_int64Field87_codec.Read(input);
+ long? value = _single_int64Field87_codec.Read(ref input);
if (int64Field87_ == null || value != 0L) {
Int64Field87 = value;
}
break;
}
case 706: {
- double? value = _single_doubleField88_codec.Read(input);
+ double? value = _single_doubleField88_codec.Read(ref input);
if (doubleField88_ == null || value != 0D) {
DoubleField88 = value;
}
break;
}
case 714: {
- double? value = _single_doubleField89_codec.Read(input);
+ double? value = _single_doubleField89_codec.Read(ref input);
if (doubleField89_ == null || value != 0D) {
DoubleField89 = value;
}
break;
}
case 722: {
- double? value = _single_doubleField90_codec.Read(input);
+ double? value = _single_doubleField90_codec.Read(ref input);
if (doubleField90_ == null || value != 0D) {
DoubleField90 = value;
}
break;
}
case 730: {
- double? value = _single_doubleField91_codec.Read(input);
+ double? value = _single_doubleField91_codec.Read(ref input);
if (doubleField91_ == null || value != 0D) {
DoubleField91 = value;
}
break;
}
case 738: {
- double? value = _single_doubleField92_codec.Read(input);
+ double? value = _single_doubleField92_codec.Read(ref input);
if (doubleField92_ == null || value != 0D) {
DoubleField92 = value;
}
break;
}
case 746: {
- double? value = _single_doubleField93_codec.Read(input);
+ double? value = _single_doubleField93_codec.Read(ref input);
if (doubleField93_ == null || value != 0D) {
DoubleField93 = value;
}
break;
}
case 754: {
- double? value = _single_doubleField94_codec.Read(input);
+ double? value = _single_doubleField94_codec.Read(ref input);
if (doubleField94_ == null || value != 0D) {
DoubleField94 = value;
}
break;
}
case 762: {
- double? value = _single_doubleField95_codec.Read(input);
+ double? value = _single_doubleField95_codec.Read(ref input);
if (doubleField95_ == null || value != 0D) {
DoubleField95 = value;
}
break;
}
case 770: {
- double? value = _single_doubleField96_codec.Read(input);
+ double? value = _single_doubleField96_codec.Read(ref input);
if (doubleField96_ == null || value != 0D) {
DoubleField96 = value;
}
break;
}
case 778: {
- double? value = _single_doubleField97_codec.Read(input);
+ double? value = _single_doubleField97_codec.Read(ref input);
if (doubleField97_ == null || value != 0D) {
DoubleField97 = value;
}
break;
}
case 786: {
- double? value = _single_doubleField98_codec.Read(input);
+ double? value = _single_doubleField98_codec.Read(ref input);
if (doubleField98_ == null || value != 0D) {
DoubleField98 = value;
}
break;
}
case 794: {
- double? value = _single_doubleField99_codec.Read(input);
+ double? value = _single_doubleField99_codec.Read(ref input);
if (doubleField99_ == null || value != 0D) {
DoubleField99 = value;
}
@@ -3869,207 +3874,207 @@ namespace Google.Protobuf.Benchmarks {
}
case 802:
case 800: {
- repeatedIntField100_.AddEntriesFrom(input, _repeated_repeatedIntField100_codec);
+ repeatedIntField100_.AddEntriesFrom(ref input, _repeated_repeatedIntField100_codec);
break;
}
case 810: {
- double? value = _single_doubleField101_codec.Read(input);
+ double? value = _single_doubleField101_codec.Read(ref input);
if (doubleField101_ == null || value != 0D) {
DoubleField101 = value;
}
break;
}
case 818: {
- double? value = _single_doubleField102_codec.Read(input);
+ double? value = _single_doubleField102_codec.Read(ref input);
if (doubleField102_ == null || value != 0D) {
DoubleField102 = value;
}
break;
}
case 826: {
- double? value = _single_doubleField103_codec.Read(input);
+ double? value = _single_doubleField103_codec.Read(ref input);
if (doubleField103_ == null || value != 0D) {
DoubleField103 = value;
}
break;
}
case 834: {
- double? value = _single_doubleField104_codec.Read(input);
+ double? value = _single_doubleField104_codec.Read(ref input);
if (doubleField104_ == null || value != 0D) {
DoubleField104 = value;
}
break;
}
case 842: {
- double? value = _single_doubleField105_codec.Read(input);
+ double? value = _single_doubleField105_codec.Read(ref input);
if (doubleField105_ == null || value != 0D) {
DoubleField105 = value;
}
break;
}
case 850: {
- double? value = _single_doubleField106_codec.Read(input);
+ double? value = _single_doubleField106_codec.Read(ref input);
if (doubleField106_ == null || value != 0D) {
DoubleField106 = value;
}
break;
}
case 858: {
- long? value = _single_int64Field107_codec.Read(input);
+ long? value = _single_int64Field107_codec.Read(ref input);
if (int64Field107_ == null || value != 0L) {
Int64Field107 = value;
}
break;
}
case 866: {
- double? value = _single_doubleField108_codec.Read(input);
+ double? value = _single_doubleField108_codec.Read(ref input);
if (doubleField108_ == null || value != 0D) {
DoubleField108 = value;
}
break;
}
case 874: {
- double? value = _single_doubleField109_codec.Read(input);
+ double? value = _single_doubleField109_codec.Read(ref input);
if (doubleField109_ == null || value != 0D) {
DoubleField109 = value;
}
break;
}
case 882: {
- long? value = _single_int64Field110_codec.Read(input);
+ long? value = _single_int64Field110_codec.Read(ref input);
if (int64Field110_ == null || value != 0L) {
Int64Field110 = value;
}
break;
}
case 890: {
- double? value = _single_doubleField111_codec.Read(input);
+ double? value = _single_doubleField111_codec.Read(ref input);
if (doubleField111_ == null || value != 0D) {
DoubleField111 = value;
}
break;
}
case 898: {
- long? value = _single_int64Field112_codec.Read(input);
+ long? value = _single_int64Field112_codec.Read(ref input);
if (int64Field112_ == null || value != 0L) {
Int64Field112 = value;
}
break;
}
case 906: {
- double? value = _single_doubleField113_codec.Read(input);
+ double? value = _single_doubleField113_codec.Read(ref input);
if (doubleField113_ == null || value != 0D) {
DoubleField113 = value;
}
break;
}
case 914: {
- long? value = _single_int64Field114_codec.Read(input);
+ long? value = _single_int64Field114_codec.Read(ref input);
if (int64Field114_ == null || value != 0L) {
Int64Field114 = value;
}
break;
}
case 922: {
- long? value = _single_int64Field115_codec.Read(input);
+ long? value = _single_int64Field115_codec.Read(ref input);
if (int64Field115_ == null || value != 0L) {
Int64Field115 = value;
}
break;
}
case 930: {
- double? value = _single_doubleField116_codec.Read(input);
+ double? value = _single_doubleField116_codec.Read(ref input);
if (doubleField116_ == null || value != 0D) {
DoubleField116 = value;
}
break;
}
case 938: {
- long? value = _single_int64Field117_codec.Read(input);
+ long? value = _single_int64Field117_codec.Read(ref input);
if (int64Field117_ == null || value != 0L) {
Int64Field117 = value;
}
break;
}
case 946: {
- double? value = _single_doubleField118_codec.Read(input);
+ double? value = _single_doubleField118_codec.Read(ref input);
if (doubleField118_ == null || value != 0D) {
DoubleField118 = value;
}
break;
}
case 954: {
- double? value = _single_doubleField119_codec.Read(input);
+ double? value = _single_doubleField119_codec.Read(ref input);
if (doubleField119_ == null || value != 0D) {
DoubleField119 = value;
}
break;
}
case 962: {
- double? value = _single_doubleField120_codec.Read(input);
+ double? value = _single_doubleField120_codec.Read(ref input);
if (doubleField120_ == null || value != 0D) {
DoubleField120 = value;
}
break;
}
case 970: {
- double? value = _single_doubleField121_codec.Read(input);
+ double? value = _single_doubleField121_codec.Read(ref input);
if (doubleField121_ == null || value != 0D) {
DoubleField121 = value;
}
break;
}
case 978: {
- double? value = _single_doubleField122_codec.Read(input);
+ double? value = _single_doubleField122_codec.Read(ref input);
if (doubleField122_ == null || value != 0D) {
DoubleField122 = value;
}
break;
}
case 986: {
- double? value = _single_doubleField123_codec.Read(input);
+ double? value = _single_doubleField123_codec.Read(ref input);
if (doubleField123_ == null || value != 0D) {
DoubleField123 = value;
}
break;
}
case 994: {
- double? value = _single_doubleField124_codec.Read(input);
+ double? value = _single_doubleField124_codec.Read(ref input);
if (doubleField124_ == null || value != 0D) {
DoubleField124 = value;
}
break;
}
case 1002: {
- long? value = _single_int64Field125_codec.Read(input);
+ long? value = _single_int64Field125_codec.Read(ref input);
if (int64Field125_ == null || value != 0L) {
Int64Field125 = value;
}
break;
}
case 1010: {
- long? value = _single_int64Field126_codec.Read(input);
+ long? value = _single_int64Field126_codec.Read(ref input);
if (int64Field126_ == null || value != 0L) {
Int64Field126 = value;
}
break;
}
case 1018: {
- long? value = _single_int64Field127_codec.Read(input);
+ long? value = _single_int64Field127_codec.Read(ref input);
if (int64Field127_ == null || value != 0L) {
Int64Field127 = value;
}
break;
}
case 1026: {
- double? value = _single_doubleField128_codec.Read(input);
+ double? value = _single_doubleField128_codec.Read(ref input);
if (doubleField128_ == null || value != 0D) {
DoubleField128 = value;
}
break;
}
case 1034: {
- double? value = _single_doubleField129_codec.Read(input);
+ double? value = _single_doubleField129_codec.Read(ref input);
if (doubleField129_ == null || value != 0D) {
DoubleField129 = value;
}
@@ -4085,7 +4090,7 @@ namespace Google.Protobuf.Benchmarks {
/// same as ManyWrapperFieldsMessages, but with primitive fields
/// for comparison.
///
- public sealed partial class ManyPrimitiveFieldsMessage : pb::IMessage {
+ public sealed partial class ManyPrimitiveFieldsMessage : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManyPrimitiveFieldsMessage());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6830,11 +6835,16 @@ namespace Google.Protobuf.Benchmarks {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 9: {
DoubleField1 = input.ReadDouble();
@@ -7162,7 +7172,7 @@ namespace Google.Protobuf.Benchmarks {
}
case 802:
case 800: {
- repeatedIntField100_.AddEntriesFrom(input, _repeated_repeatedIntField100_codec);
+ repeatedIntField100_.AddEntriesFrom(ref input, _repeated_repeatedIntField100_codec);
break;
}
case 809: {
diff --git a/csharp/src/Google.Protobuf.Conformance/Conformance.cs b/csharp/src/Google.Protobuf.Conformance/Conformance.cs
index 23894ad3ba..f9bda13c60 100644
--- a/csharp/src/Google.Protobuf.Conformance/Conformance.cs
+++ b/csharp/src/Google.Protobuf.Conformance/Conformance.cs
@@ -107,7 +107,7 @@ namespace Conformance {
/// This will be known by message_type == "conformance.FailureSet", a conformance
/// test should return a serialized FailureSet in protobuf_payload.
///
- public sealed partial class FailureSet : pb::IMessage {
+ public sealed partial class FailureSet : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FailureSet());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -212,14 +212,19 @@ namespace Conformance {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
- failure_.AddEntriesFrom(input, _repeated_failure_codec);
+ failure_.AddEntriesFrom(ref input, _repeated_failure_codec);
break;
}
}
@@ -235,7 +240,7 @@ namespace Conformance {
/// 2. parse the protobuf or JSON payload in "payload" (which may fail)
/// 3. if the parse succeeded, serialize the message in the requested format.
///
- public sealed partial class ConformanceRequest : pb::IMessage {
+ public sealed partial class ConformanceRequest : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConformanceRequest());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -603,11 +608,16 @@ namespace Conformance {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
ProtobufPayload = input.ReadBytes();
@@ -657,7 +667,7 @@ namespace Conformance {
///
/// Represents a single test case's output.
///
- public sealed partial class ConformanceResponse : pb::IMessage {
+ public sealed partial class ConformanceResponse : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConformanceResponse());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1025,11 +1035,16 @@ namespace Conformance {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
ParseError = input.ReadString();
@@ -1072,7 +1087,7 @@ namespace Conformance {
///
/// Encoding options for jspb format.
///
- public sealed partial class JspbEncodingConfig : pb::IMessage {
+ public sealed partial class JspbEncodingConfig : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JspbEncodingConfig());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1188,11 +1203,16 @@ namespace Conformance {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
UseJspbArrayAnyFormat = input.ReadBool();
diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/Google.Protobuf.Test.TestProtos.csproj b/csharp/src/Google.Protobuf.Test.TestProtos/Google.Protobuf.Test.TestProtos.csproj
index 5b705804aa..1af85e0a54 100644
--- a/csharp/src/Google.Protobuf.Test.TestProtos/Google.Protobuf.Test.TestProtos.csproj
+++ b/csharp/src/Google.Protobuf.Test.TestProtos/Google.Protobuf.Test.TestProtos.csproj
@@ -6,7 +6,7 @@
and without the internal visibility from the test project (all of which have caused issues in the past).
-->
- net45;netstandard1.0;netstandard2.0
+ net45;netstandard1.1;netstandard2.0
3.0
../../keys/Google.Protobuf.snk
true
diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.cs b/csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.cs
index 197b197d0e..8d2060593d 100644
--- a/csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.cs
+++ b/csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.cs
@@ -176,7 +176,7 @@ namespace Google.Protobuf.TestProtos {
///
/// Tests maps.
///
- public sealed partial class TestMap : pb::IMessage {
+ public sealed partial class TestMap : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMap());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -537,78 +537,83 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
- mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec);
+ mapInt32Int32_.AddEntriesFrom(ref input, _map_mapInt32Int32_codec);
break;
}
case 18: {
- mapInt64Int64_.AddEntriesFrom(input, _map_mapInt64Int64_codec);
+ mapInt64Int64_.AddEntriesFrom(ref input, _map_mapInt64Int64_codec);
break;
}
case 26: {
- mapUint32Uint32_.AddEntriesFrom(input, _map_mapUint32Uint32_codec);
+ mapUint32Uint32_.AddEntriesFrom(ref input, _map_mapUint32Uint32_codec);
break;
}
case 34: {
- mapUint64Uint64_.AddEntriesFrom(input, _map_mapUint64Uint64_codec);
+ mapUint64Uint64_.AddEntriesFrom(ref input, _map_mapUint64Uint64_codec);
break;
}
case 42: {
- mapSint32Sint32_.AddEntriesFrom(input, _map_mapSint32Sint32_codec);
+ mapSint32Sint32_.AddEntriesFrom(ref input, _map_mapSint32Sint32_codec);
break;
}
case 50: {
- mapSint64Sint64_.AddEntriesFrom(input, _map_mapSint64Sint64_codec);
+ mapSint64Sint64_.AddEntriesFrom(ref input, _map_mapSint64Sint64_codec);
break;
}
case 58: {
- mapFixed32Fixed32_.AddEntriesFrom(input, _map_mapFixed32Fixed32_codec);
+ mapFixed32Fixed32_.AddEntriesFrom(ref input, _map_mapFixed32Fixed32_codec);
break;
}
case 66: {
- mapFixed64Fixed64_.AddEntriesFrom(input, _map_mapFixed64Fixed64_codec);
+ mapFixed64Fixed64_.AddEntriesFrom(ref input, _map_mapFixed64Fixed64_codec);
break;
}
case 74: {
- mapSfixed32Sfixed32_.AddEntriesFrom(input, _map_mapSfixed32Sfixed32_codec);
+ mapSfixed32Sfixed32_.AddEntriesFrom(ref input, _map_mapSfixed32Sfixed32_codec);
break;
}
case 82: {
- mapSfixed64Sfixed64_.AddEntriesFrom(input, _map_mapSfixed64Sfixed64_codec);
+ mapSfixed64Sfixed64_.AddEntriesFrom(ref input, _map_mapSfixed64Sfixed64_codec);
break;
}
case 90: {
- mapInt32Float_.AddEntriesFrom(input, _map_mapInt32Float_codec);
+ mapInt32Float_.AddEntriesFrom(ref input, _map_mapInt32Float_codec);
break;
}
case 98: {
- mapInt32Double_.AddEntriesFrom(input, _map_mapInt32Double_codec);
+ mapInt32Double_.AddEntriesFrom(ref input, _map_mapInt32Double_codec);
break;
}
case 106: {
- mapBoolBool_.AddEntriesFrom(input, _map_mapBoolBool_codec);
+ mapBoolBool_.AddEntriesFrom(ref input, _map_mapBoolBool_codec);
break;
}
case 114: {
- mapStringString_.AddEntriesFrom(input, _map_mapStringString_codec);
+ mapStringString_.AddEntriesFrom(ref input, _map_mapStringString_codec);
break;
}
case 122: {
- mapInt32Bytes_.AddEntriesFrom(input, _map_mapInt32Bytes_codec);
+ mapInt32Bytes_.AddEntriesFrom(ref input, _map_mapInt32Bytes_codec);
break;
}
case 130: {
- mapInt32Enum_.AddEntriesFrom(input, _map_mapInt32Enum_codec);
+ mapInt32Enum_.AddEntriesFrom(ref input, _map_mapInt32Enum_codec);
break;
}
case 138: {
- mapInt32ForeignMessage_.AddEntriesFrom(input, _map_mapInt32ForeignMessage_codec);
+ mapInt32ForeignMessage_.AddEntriesFrom(ref input, _map_mapInt32ForeignMessage_codec);
break;
}
}
@@ -617,7 +622,7 @@ namespace Google.Protobuf.TestProtos {
}
- public sealed partial class TestMapSubmessage : pb::IMessage {
+ public sealed partial class TestMapSubmessage : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMapSubmessage());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -733,11 +738,16 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
if (testMap_ == null) {
@@ -752,7 +762,7 @@ namespace Google.Protobuf.TestProtos {
}
- public sealed partial class TestMessageMap : pb::IMessage {
+ public sealed partial class TestMessageMap : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMessageMap());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -857,14 +867,19 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
- mapInt32Message_.AddEntriesFrom(input, _map_mapInt32Message_codec);
+ mapInt32Message_.AddEntriesFrom(ref input, _map_mapInt32Message_codec);
break;
}
}
@@ -876,7 +891,7 @@ namespace Google.Protobuf.TestProtos {
///
/// Two map fields share the same entry default instance.
///
- public sealed partial class TestSameTypeMap : pb::IMessage {
+ public sealed partial class TestSameTypeMap : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestSameTypeMap());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -997,18 +1012,23 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
- map1_.AddEntriesFrom(input, _map_map1_codec);
+ map1_.AddEntriesFrom(ref input, _map_map1_codec);
break;
}
case 18: {
- map2_.AddEntriesFrom(input, _map_map2_codec);
+ map2_.AddEntriesFrom(ref input, _map_map2_codec);
break;
}
}
@@ -1017,7 +1037,7 @@ namespace Google.Protobuf.TestProtos {
}
- public sealed partial class TestArenaMap : pb::IMessage {
+ public sealed partial class TestArenaMap : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestArenaMap());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1346,70 +1366,75 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
- mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec);
+ mapInt32Int32_.AddEntriesFrom(ref input, _map_mapInt32Int32_codec);
break;
}
case 18: {
- mapInt64Int64_.AddEntriesFrom(input, _map_mapInt64Int64_codec);
+ mapInt64Int64_.AddEntriesFrom(ref input, _map_mapInt64Int64_codec);
break;
}
case 26: {
- mapUint32Uint32_.AddEntriesFrom(input, _map_mapUint32Uint32_codec);
+ mapUint32Uint32_.AddEntriesFrom(ref input, _map_mapUint32Uint32_codec);
break;
}
case 34: {
- mapUint64Uint64_.AddEntriesFrom(input, _map_mapUint64Uint64_codec);
+ mapUint64Uint64_.AddEntriesFrom(ref input, _map_mapUint64Uint64_codec);
break;
}
case 42: {
- mapSint32Sint32_.AddEntriesFrom(input, _map_mapSint32Sint32_codec);
+ mapSint32Sint32_.AddEntriesFrom(ref input, _map_mapSint32Sint32_codec);
break;
}
case 50: {
- mapSint64Sint64_.AddEntriesFrom(input, _map_mapSint64Sint64_codec);
+ mapSint64Sint64_.AddEntriesFrom(ref input, _map_mapSint64Sint64_codec);
break;
}
case 58: {
- mapFixed32Fixed32_.AddEntriesFrom(input, _map_mapFixed32Fixed32_codec);
+ mapFixed32Fixed32_.AddEntriesFrom(ref input, _map_mapFixed32Fixed32_codec);
break;
}
case 66: {
- mapFixed64Fixed64_.AddEntriesFrom(input, _map_mapFixed64Fixed64_codec);
+ mapFixed64Fixed64_.AddEntriesFrom(ref input, _map_mapFixed64Fixed64_codec);
break;
}
case 74: {
- mapSfixed32Sfixed32_.AddEntriesFrom(input, _map_mapSfixed32Sfixed32_codec);
+ mapSfixed32Sfixed32_.AddEntriesFrom(ref input, _map_mapSfixed32Sfixed32_codec);
break;
}
case 82: {
- mapSfixed64Sfixed64_.AddEntriesFrom(input, _map_mapSfixed64Sfixed64_codec);
+ mapSfixed64Sfixed64_.AddEntriesFrom(ref input, _map_mapSfixed64Sfixed64_codec);
break;
}
case 90: {
- mapInt32Float_.AddEntriesFrom(input, _map_mapInt32Float_codec);
+ mapInt32Float_.AddEntriesFrom(ref input, _map_mapInt32Float_codec);
break;
}
case 98: {
- mapInt32Double_.AddEntriesFrom(input, _map_mapInt32Double_codec);
+ mapInt32Double_.AddEntriesFrom(ref input, _map_mapInt32Double_codec);
break;
}
case 106: {
- mapBoolBool_.AddEntriesFrom(input, _map_mapBoolBool_codec);
+ mapBoolBool_.AddEntriesFrom(ref input, _map_mapBoolBool_codec);
break;
}
case 114: {
- mapInt32Enum_.AddEntriesFrom(input, _map_mapInt32Enum_codec);
+ mapInt32Enum_.AddEntriesFrom(ref input, _map_mapInt32Enum_codec);
break;
}
case 122: {
- mapInt32ForeignMessage_.AddEntriesFrom(input, _map_mapInt32ForeignMessage_codec);
+ mapInt32ForeignMessage_.AddEntriesFrom(ref input, _map_mapInt32ForeignMessage_codec);
break;
}
}
@@ -1422,7 +1447,7 @@ namespace Google.Protobuf.TestProtos {
/// Previously, message containing enum called Type cannot be used as value of
/// map field.
///
- public sealed partial class MessageContainingEnumCalledType : pb::IMessage {
+ public sealed partial class MessageContainingEnumCalledType : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageContainingEnumCalledType());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1527,14 +1552,19 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
- type_.AddEntriesFrom(input, _map_type_codec);
+ type_.AddEntriesFrom(ref input, _map_type_codec);
break;
}
}
@@ -1557,7 +1587,7 @@ namespace Google.Protobuf.TestProtos {
///
/// Previously, message cannot contain map field called "entry".
///
- public sealed partial class MessageContainingMapCalledEntry : pb::IMessage {
+ public sealed partial class MessageContainingMapCalledEntry : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageContainingMapCalledEntry());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1662,14 +1692,19 @@ namespace Google.Protobuf.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
- entry_.AddEntriesFrom(input, _map_entry_codec);
+ entry_.AddEntriesFrom(ref input, _map_entry_codec);
break;
}
}
diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.cs b/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.cs
index ca2888473b..bef3645874 100644
--- a/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.cs
+++ b/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.cs
@@ -244,7 +244,7 @@ namespace ProtobufTestMessages.Proto2 {
/// could trigger bugs that occur in any message type in this file. We verify
/// this stays true in a unit test.
///
- public sealed partial class TestAllTypesProto2 : pb::IExtendableMessage {
+ public sealed partial class TestAllTypesProto2 : pb::IExtendableMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllTypesProto2());
private pb::UnknownFieldSet _unknownFields;
private pb::ExtensionSet _extensions;
@@ -3311,12 +3311,17 @@ namespace ProtobufTestMessages.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) {
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) {
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
}
break;
case 8: {
@@ -3418,317 +3423,317 @@ namespace ProtobufTestMessages.Proto2 {
}
case 250:
case 248: {
- repeatedInt32_.AddEntriesFrom(input, _repeated_repeatedInt32_codec);
+ repeatedInt32_.AddEntriesFrom(ref input, _repeated_repeatedInt32_codec);
break;
}
case 258:
case 256: {
- repeatedInt64_.AddEntriesFrom(input, _repeated_repeatedInt64_codec);
+ repeatedInt64_.AddEntriesFrom(ref input, _repeated_repeatedInt64_codec);
break;
}
case 266:
case 264: {
- repeatedUint32_.AddEntriesFrom(input, _repeated_repeatedUint32_codec);
+ repeatedUint32_.AddEntriesFrom(ref input, _repeated_repeatedUint32_codec);
break;
}
case 274:
case 272: {
- repeatedUint64_.AddEntriesFrom(input, _repeated_repeatedUint64_codec);
+ repeatedUint64_.AddEntriesFrom(ref input, _repeated_repeatedUint64_codec);
break;
}
case 282:
case 280: {
- repeatedSint32_.AddEntriesFrom(input, _repeated_repeatedSint32_codec);
+ repeatedSint32_.AddEntriesFrom(ref input, _repeated_repeatedSint32_codec);
break;
}
case 290:
case 288: {
- repeatedSint64_.AddEntriesFrom(input, _repeated_repeatedSint64_codec);
+ repeatedSint64_.AddEntriesFrom(ref input, _repeated_repeatedSint64_codec);
break;
}
case 298:
case 301: {
- repeatedFixed32_.AddEntriesFrom(input, _repeated_repeatedFixed32_codec);
+ repeatedFixed32_.AddEntriesFrom(ref input, _repeated_repeatedFixed32_codec);
break;
}
case 306:
case 305: {
- repeatedFixed64_.AddEntriesFrom(input, _repeated_repeatedFixed64_codec);
+ repeatedFixed64_.AddEntriesFrom(ref input, _repeated_repeatedFixed64_codec);
break;
}
case 314:
case 317: {
- repeatedSfixed32_.AddEntriesFrom(input, _repeated_repeatedSfixed32_codec);
+ repeatedSfixed32_.AddEntriesFrom(ref input, _repeated_repeatedSfixed32_codec);
break;
}
case 322:
case 321: {
- repeatedSfixed64_.AddEntriesFrom(input, _repeated_repeatedSfixed64_codec);
+ repeatedSfixed64_.AddEntriesFrom(ref input, _repeated_repeatedSfixed64_codec);
break;
}
case 330:
case 333: {
- repeatedFloat_.AddEntriesFrom(input, _repeated_repeatedFloat_codec);
+ repeatedFloat_.AddEntriesFrom(ref input, _repeated_repeatedFloat_codec);
break;
}
case 338:
case 337: {
- repeatedDouble_.AddEntriesFrom(input, _repeated_repeatedDouble_codec);
+ repeatedDouble_.AddEntriesFrom(ref input, _repeated_repeatedDouble_codec);
break;
}
case 346:
case 344: {
- repeatedBool_.AddEntriesFrom(input, _repeated_repeatedBool_codec);
+ repeatedBool_.AddEntriesFrom(ref input, _repeated_repeatedBool_codec);
break;
}
case 354: {
- repeatedString_.AddEntriesFrom(input, _repeated_repeatedString_codec);
+ repeatedString_.AddEntriesFrom(ref input, _repeated_repeatedString_codec);
break;
}
case 362: {
- repeatedBytes_.AddEntriesFrom(input, _repeated_repeatedBytes_codec);
+ repeatedBytes_.AddEntriesFrom(ref input, _repeated_repeatedBytes_codec);
break;
}
case 386: {
- repeatedNestedMessage_.AddEntriesFrom(input, _repeated_repeatedNestedMessage_codec);
+ repeatedNestedMessage_.AddEntriesFrom(ref input, _repeated_repeatedNestedMessage_codec);
break;
}
case 394: {
- repeatedForeignMessage_.AddEntriesFrom(input, _repeated_repeatedForeignMessage_codec);
+ repeatedForeignMessage_.AddEntriesFrom(ref input, _repeated_repeatedForeignMessage_codec);
break;
}
case 410:
case 408: {
- repeatedNestedEnum_.AddEntriesFrom(input, _repeated_repeatedNestedEnum_codec);
+ repeatedNestedEnum_.AddEntriesFrom(ref input, _repeated_repeatedNestedEnum_codec);
break;
}
case 418:
case 416: {
- repeatedForeignEnum_.AddEntriesFrom(input, _repeated_repeatedForeignEnum_codec);
+ repeatedForeignEnum_.AddEntriesFrom(ref input, _repeated_repeatedForeignEnum_codec);
break;
}
case 434: {
- repeatedStringPiece_.AddEntriesFrom(input, _repeated_repeatedStringPiece_codec);
+ repeatedStringPiece_.AddEntriesFrom(ref input, _repeated_repeatedStringPiece_codec);
break;
}
case 442: {
- repeatedCord_.AddEntriesFrom(input, _repeated_repeatedCord_codec);
+ repeatedCord_.AddEntriesFrom(ref input, _repeated_repeatedCord_codec);
break;
}
case 450: {
- mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec);
+ mapInt32Int32_.AddEntriesFrom(ref input, _map_mapInt32Int32_codec);
break;
}
case 458: {
- mapInt64Int64_.AddEntriesFrom(input, _map_mapInt64Int64_codec);
+ mapInt64Int64_.AddEntriesFrom(ref input, _map_mapInt64Int64_codec);
break;
}
case 466: {
- mapUint32Uint32_.AddEntriesFrom(input, _map_mapUint32Uint32_codec);
+ mapUint32Uint32_.AddEntriesFrom(ref input, _map_mapUint32Uint32_codec);
break;
}
case 474: {
- mapUint64Uint64_.AddEntriesFrom(input, _map_mapUint64Uint64_codec);
+ mapUint64Uint64_.AddEntriesFrom(ref input, _map_mapUint64Uint64_codec);
break;
}
case 482: {
- mapSint32Sint32_.AddEntriesFrom(input, _map_mapSint32Sint32_codec);
+ mapSint32Sint32_.AddEntriesFrom(ref input, _map_mapSint32Sint32_codec);
break;
}
case 490: {
- mapSint64Sint64_.AddEntriesFrom(input, _map_mapSint64Sint64_codec);
+ mapSint64Sint64_.AddEntriesFrom(ref input, _map_mapSint64Sint64_codec);
break;
}
case 498: {
- mapFixed32Fixed32_.AddEntriesFrom(input, _map_mapFixed32Fixed32_codec);
+ mapFixed32Fixed32_.AddEntriesFrom(ref input, _map_mapFixed32Fixed32_codec);
break;
}
case 506: {
- mapFixed64Fixed64_.AddEntriesFrom(input, _map_mapFixed64Fixed64_codec);
+ mapFixed64Fixed64_.AddEntriesFrom(ref input, _map_mapFixed64Fixed64_codec);
break;
}
case 514: {
- mapSfixed32Sfixed32_.AddEntriesFrom(input, _map_mapSfixed32Sfixed32_codec);
+ mapSfixed32Sfixed32_.AddEntriesFrom(ref input, _map_mapSfixed32Sfixed32_codec);
break;
}
case 522: {
- mapSfixed64Sfixed64_.AddEntriesFrom(input, _map_mapSfixed64Sfixed64_codec);
+ mapSfixed64Sfixed64_.AddEntriesFrom(ref input, _map_mapSfixed64Sfixed64_codec);
break;
}
case 530: {
- mapInt32Float_.AddEntriesFrom(input, _map_mapInt32Float_codec);
+ mapInt32Float_.AddEntriesFrom(ref input, _map_mapInt32Float_codec);
break;
}
case 538: {
- mapInt32Double_.AddEntriesFrom(input, _map_mapInt32Double_codec);
+ mapInt32Double_.AddEntriesFrom(ref input, _map_mapInt32Double_codec);
break;
}
case 546: {
- mapBoolBool_.AddEntriesFrom(input, _map_mapBoolBool_codec);
+ mapBoolBool_.AddEntriesFrom(ref input, _map_mapBoolBool_codec);
break;
}
case 554: {
- mapStringString_.AddEntriesFrom(input, _map_mapStringString_codec);
+ mapStringString_.AddEntriesFrom(ref input, _map_mapStringString_codec);
break;
}
case 562: {
- mapStringBytes_.AddEntriesFrom(input, _map_mapStringBytes_codec);
+ mapStringBytes_.AddEntriesFrom(ref input, _map_mapStringBytes_codec);
break;
}
case 570: {
- mapStringNestedMessage_.AddEntriesFrom(input, _map_mapStringNestedMessage_codec);
+ mapStringNestedMessage_.AddEntriesFrom(ref input, _map_mapStringNestedMessage_codec);
break;
}
case 578: {
- mapStringForeignMessage_.AddEntriesFrom(input, _map_mapStringForeignMessage_codec);
+ mapStringForeignMessage_.AddEntriesFrom(ref input, _map_mapStringForeignMessage_codec);
break;
}
case 586: {
- mapStringNestedEnum_.AddEntriesFrom(input, _map_mapStringNestedEnum_codec);
+ mapStringNestedEnum_.AddEntriesFrom(ref input, _map_mapStringNestedEnum_codec);
break;
}
case 594: {
- mapStringForeignEnum_.AddEntriesFrom(input, _map_mapStringForeignEnum_codec);
+ mapStringForeignEnum_.AddEntriesFrom(ref input, _map_mapStringForeignEnum_codec);
break;
}
case 602:
case 600: {
- packedInt32_.AddEntriesFrom(input, _repeated_packedInt32_codec);
+ packedInt32_.AddEntriesFrom(ref input, _repeated_packedInt32_codec);
break;
}
case 610:
case 608: {
- packedInt64_.AddEntriesFrom(input, _repeated_packedInt64_codec);
+ packedInt64_.AddEntriesFrom(ref input, _repeated_packedInt64_codec);
break;
}
case 618:
case 616: {
- packedUint32_.AddEntriesFrom(input, _repeated_packedUint32_codec);
+ packedUint32_.AddEntriesFrom(ref input, _repeated_packedUint32_codec);
break;
}
case 626:
case 624: {
- packedUint64_.AddEntriesFrom(input, _repeated_packedUint64_codec);
+ packedUint64_.AddEntriesFrom(ref input, _repeated_packedUint64_codec);
break;
}
case 634:
case 632: {
- packedSint32_.AddEntriesFrom(input, _repeated_packedSint32_codec);
+ packedSint32_.AddEntriesFrom(ref input, _repeated_packedSint32_codec);
break;
}
case 642:
case 640: {
- packedSint64_.AddEntriesFrom(input, _repeated_packedSint64_codec);
+ packedSint64_.AddEntriesFrom(ref input, _repeated_packedSint64_codec);
break;
}
case 650:
case 653: {
- packedFixed32_.AddEntriesFrom(input, _repeated_packedFixed32_codec);
+ packedFixed32_.AddEntriesFrom(ref input, _repeated_packedFixed32_codec);
break;
}
case 658:
case 657: {
- packedFixed64_.AddEntriesFrom(input, _repeated_packedFixed64_codec);
+ packedFixed64_.AddEntriesFrom(ref input, _repeated_packedFixed64_codec);
break;
}
case 666:
case 669: {
- packedSfixed32_.AddEntriesFrom(input, _repeated_packedSfixed32_codec);
+ packedSfixed32_.AddEntriesFrom(ref input, _repeated_packedSfixed32_codec);
break;
}
case 674:
case 673: {
- packedSfixed64_.AddEntriesFrom(input, _repeated_packedSfixed64_codec);
+ packedSfixed64_.AddEntriesFrom(ref input, _repeated_packedSfixed64_codec);
break;
}
case 682:
case 685: {
- packedFloat_.AddEntriesFrom(input, _repeated_packedFloat_codec);
+ packedFloat_.AddEntriesFrom(ref input, _repeated_packedFloat_codec);
break;
}
case 690:
case 689: {
- packedDouble_.AddEntriesFrom(input, _repeated_packedDouble_codec);
+ packedDouble_.AddEntriesFrom(ref input, _repeated_packedDouble_codec);
break;
}
case 698:
case 696: {
- packedBool_.AddEntriesFrom(input, _repeated_packedBool_codec);
+ packedBool_.AddEntriesFrom(ref input, _repeated_packedBool_codec);
break;
}
case 706:
case 704: {
- packedNestedEnum_.AddEntriesFrom(input, _repeated_packedNestedEnum_codec);
+ packedNestedEnum_.AddEntriesFrom(ref input, _repeated_packedNestedEnum_codec);
break;
}
case 714:
case 712: {
- unpackedInt32_.AddEntriesFrom(input, _repeated_unpackedInt32_codec);
+ unpackedInt32_.AddEntriesFrom(ref input, _repeated_unpackedInt32_codec);
break;
}
case 722:
case 720: {
- unpackedInt64_.AddEntriesFrom(input, _repeated_unpackedInt64_codec);
+ unpackedInt64_.AddEntriesFrom(ref input, _repeated_unpackedInt64_codec);
break;
}
case 730:
case 728: {
- unpackedUint32_.AddEntriesFrom(input, _repeated_unpackedUint32_codec);
+ unpackedUint32_.AddEntriesFrom(ref input, _repeated_unpackedUint32_codec);
break;
}
case 738:
case 736: {
- unpackedUint64_.AddEntriesFrom(input, _repeated_unpackedUint64_codec);
+ unpackedUint64_.AddEntriesFrom(ref input, _repeated_unpackedUint64_codec);
break;
}
case 746:
case 744: {
- unpackedSint32_.AddEntriesFrom(input, _repeated_unpackedSint32_codec);
+ unpackedSint32_.AddEntriesFrom(ref input, _repeated_unpackedSint32_codec);
break;
}
case 754:
case 752: {
- unpackedSint64_.AddEntriesFrom(input, _repeated_unpackedSint64_codec);
+ unpackedSint64_.AddEntriesFrom(ref input, _repeated_unpackedSint64_codec);
break;
}
case 762:
case 765: {
- unpackedFixed32_.AddEntriesFrom(input, _repeated_unpackedFixed32_codec);
+ unpackedFixed32_.AddEntriesFrom(ref input, _repeated_unpackedFixed32_codec);
break;
}
case 770:
case 769: {
- unpackedFixed64_.AddEntriesFrom(input, _repeated_unpackedFixed64_codec);
+ unpackedFixed64_.AddEntriesFrom(ref input, _repeated_unpackedFixed64_codec);
break;
}
case 778:
case 781: {
- unpackedSfixed32_.AddEntriesFrom(input, _repeated_unpackedSfixed32_codec);
+ unpackedSfixed32_.AddEntriesFrom(ref input, _repeated_unpackedSfixed32_codec);
break;
}
case 786:
case 785: {
- unpackedSfixed64_.AddEntriesFrom(input, _repeated_unpackedSfixed64_codec);
+ unpackedSfixed64_.AddEntriesFrom(ref input, _repeated_unpackedSfixed64_codec);
break;
}
case 794:
case 797: {
- unpackedFloat_.AddEntriesFrom(input, _repeated_unpackedFloat_codec);
+ unpackedFloat_.AddEntriesFrom(ref input, _repeated_unpackedFloat_codec);
break;
}
case 802:
case 801: {
- unpackedDouble_.AddEntriesFrom(input, _repeated_unpackedDouble_codec);
+ unpackedDouble_.AddEntriesFrom(ref input, _repeated_unpackedDouble_codec);
break;
}
case 810:
case 808: {
- unpackedBool_.AddEntriesFrom(input, _repeated_unpackedBool_codec);
+ unpackedBool_.AddEntriesFrom(ref input, _repeated_unpackedBool_codec);
break;
}
case 818:
case 816: {
- unpackedNestedEnum_.AddEntriesFrom(input, _repeated_unpackedNestedEnum_codec);
+ unpackedNestedEnum_.AddEntriesFrom(ref input, _repeated_unpackedNestedEnum_codec);
break;
}
case 888: {
@@ -3892,7 +3897,7 @@ namespace ProtobufTestMessages.Proto2 {
[pbr::OriginalName("NEG")] Neg = -1,
}
- public sealed partial class NestedMessage : pb::IMessage {
+ public sealed partial class NestedMessage : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -4047,11 +4052,16 @@ namespace ProtobufTestMessages.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
A = input.ReadInt32();
@@ -4073,7 +4083,7 @@ namespace ProtobufTestMessages.Proto2 {
///
/// groups
///
- public sealed partial class Data : pb::IMessage {
+ public sealed partial class Data : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Data());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -4238,13 +4248,18 @@ namespace ProtobufTestMessages.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
case 1612:
return;
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 1616: {
GroupInt32 = input.ReadInt32();
@@ -4263,7 +4278,7 @@ namespace ProtobufTestMessages.Proto2 {
///
/// message_set test case.
///
- public sealed partial class MessageSetCorrect : pb::IExtendableMessage {
+ public sealed partial class MessageSetCorrect : pb::IExtendableMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageSetCorrect());
private pb::UnknownFieldSet _unknownFields;
private pb::ExtensionSet _extensions;
@@ -4368,12 +4383,17 @@ namespace ProtobufTestMessages.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) {
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) {
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
}
break;
}
@@ -4404,7 +4424,7 @@ namespace ProtobufTestMessages.Proto2 {
}
- public sealed partial class MessageSetCorrectExtension1 : pb::IMessage {
+ public sealed partial class MessageSetCorrectExtension1 : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageSetCorrectExtension1());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4529,11 +4549,16 @@ namespace ProtobufTestMessages.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 202: {
Str = input.ReadString();
@@ -4554,7 +4579,7 @@ namespace ProtobufTestMessages.Proto2 {
}
- public sealed partial class MessageSetCorrectExtension2 : pb::IMessage {
+ public sealed partial class MessageSetCorrectExtension2 : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageSetCorrectExtension2());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -4682,11 +4707,16 @@ namespace ProtobufTestMessages.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 72: {
I = input.ReadInt32();
@@ -4712,7 +4742,7 @@ namespace ProtobufTestMessages.Proto2 {
}
- public sealed partial class ForeignMessageProto2 : pb::IMessage {
+ public sealed partial class ForeignMessageProto2 : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ForeignMessageProto2());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -4840,11 +4870,16 @@ namespace ProtobufTestMessages.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
C = input.ReadInt32();
@@ -4856,7 +4891,7 @@ namespace ProtobufTestMessages.Proto2 {
}
- public sealed partial class UnknownToTestAllTypes : pb::IMessage {
+ public sealed partial class UnknownToTestAllTypes : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UnknownToTestAllTypes());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -5138,11 +5173,16 @@ namespace ProtobufTestMessages.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8008: {
OptionalInt32 = input.ReadInt32();
@@ -5172,7 +5212,7 @@ namespace ProtobufTestMessages.Proto2 {
}
case 8090:
case 8088: {
- repeatedInt32_.AddEntriesFrom(input, _repeated_repeatedInt32_codec);
+ repeatedInt32_.AddEntriesFrom(ref input, _repeated_repeatedInt32_codec);
break;
}
}
@@ -5183,7 +5223,7 @@ namespace ProtobufTestMessages.Proto2 {
/// Container for nested types declared in the UnknownToTestAllTypes message type.
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
- public sealed partial class OptionalGroup : pb::IMessage {
+ public sealed partial class OptionalGroup : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -5311,13 +5351,18 @@ namespace ProtobufTestMessages.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
case 8036:
return;
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
A = input.ReadInt32();
diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.cs b/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.cs
index 064d0c0ace..465d5e804c 100644
--- a/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.cs
+++ b/csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.cs
@@ -259,7 +259,7 @@ namespace ProtobufTestMessages.Proto3 {
/// could trigger bugs that occur in any message type in this file. We verify
/// this stays true in a unit test.
///
- public sealed partial class TestAllTypesProto3 : pb::IMessage {
+ public sealed partial class TestAllTypesProto3 : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllTypesProto3());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -3383,11 +3383,16 @@ namespace ProtobufTestMessages.Proto3 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
OptionalInt32 = input.ReadInt32();
@@ -3492,317 +3497,317 @@ namespace ProtobufTestMessages.Proto3 {
}
case 250:
case 248: {
- repeatedInt32_.AddEntriesFrom(input, _repeated_repeatedInt32_codec);
+ repeatedInt32_.AddEntriesFrom(ref input, _repeated_repeatedInt32_codec);
break;
}
case 258:
case 256: {
- repeatedInt64_.AddEntriesFrom(input, _repeated_repeatedInt64_codec);
+ repeatedInt64_.AddEntriesFrom(ref input, _repeated_repeatedInt64_codec);
break;
}
case 266:
case 264: {
- repeatedUint32_.AddEntriesFrom(input, _repeated_repeatedUint32_codec);
+ repeatedUint32_.AddEntriesFrom(ref input, _repeated_repeatedUint32_codec);
break;
}
case 274:
case 272: {
- repeatedUint64_.AddEntriesFrom(input, _repeated_repeatedUint64_codec);
+ repeatedUint64_.AddEntriesFrom(ref input, _repeated_repeatedUint64_codec);
break;
}
case 282:
case 280: {
- repeatedSint32_.AddEntriesFrom(input, _repeated_repeatedSint32_codec);
+ repeatedSint32_.AddEntriesFrom(ref input, _repeated_repeatedSint32_codec);
break;
}
case 290:
case 288: {
- repeatedSint64_.AddEntriesFrom(input, _repeated_repeatedSint64_codec);
+ repeatedSint64_.AddEntriesFrom(ref input, _repeated_repeatedSint64_codec);
break;
}
case 298:
case 301: {
- repeatedFixed32_.AddEntriesFrom(input, _repeated_repeatedFixed32_codec);
+ repeatedFixed32_.AddEntriesFrom(ref input, _repeated_repeatedFixed32_codec);
break;
}
case 306:
case 305: {
- repeatedFixed64_.AddEntriesFrom(input, _repeated_repeatedFixed64_codec);
+ repeatedFixed64_.AddEntriesFrom(ref input, _repeated_repeatedFixed64_codec);
break;
}
case 314:
case 317: {
- repeatedSfixed32_.AddEntriesFrom(input, _repeated_repeatedSfixed32_codec);
+ repeatedSfixed32_.AddEntriesFrom(ref input, _repeated_repeatedSfixed32_codec);
break;
}
case 322:
case 321: {
- repeatedSfixed64_.AddEntriesFrom(input, _repeated_repeatedSfixed64_codec);
+ repeatedSfixed64_.AddEntriesFrom(ref input, _repeated_repeatedSfixed64_codec);
break;
}
case 330:
case 333: {
- repeatedFloat_.AddEntriesFrom(input, _repeated_repeatedFloat_codec);
+ repeatedFloat_.AddEntriesFrom(ref input, _repeated_repeatedFloat_codec);
break;
}
case 338:
case 337: {
- repeatedDouble_.AddEntriesFrom(input, _repeated_repeatedDouble_codec);
+ repeatedDouble_.AddEntriesFrom(ref input, _repeated_repeatedDouble_codec);
break;
}
case 346:
case 344: {
- repeatedBool_.AddEntriesFrom(input, _repeated_repeatedBool_codec);
+ repeatedBool_.AddEntriesFrom(ref input, _repeated_repeatedBool_codec);
break;
}
case 354: {
- repeatedString_.AddEntriesFrom(input, _repeated_repeatedString_codec);
+ repeatedString_.AddEntriesFrom(ref input, _repeated_repeatedString_codec);
break;
}
case 362: {
- repeatedBytes_.AddEntriesFrom(input, _repeated_repeatedBytes_codec);
+ repeatedBytes_.AddEntriesFrom(ref input, _repeated_repeatedBytes_codec);
break;
}
case 386: {
- repeatedNestedMessage_.AddEntriesFrom(input, _repeated_repeatedNestedMessage_codec);
+ repeatedNestedMessage_.AddEntriesFrom(ref input, _repeated_repeatedNestedMessage_codec);
break;
}
case 394: {
- repeatedForeignMessage_.AddEntriesFrom(input, _repeated_repeatedForeignMessage_codec);
+ repeatedForeignMessage_.AddEntriesFrom(ref input, _repeated_repeatedForeignMessage_codec);
break;
}
case 410:
case 408: {
- repeatedNestedEnum_.AddEntriesFrom(input, _repeated_repeatedNestedEnum_codec);
+ repeatedNestedEnum_.AddEntriesFrom(ref input, _repeated_repeatedNestedEnum_codec);
break;
}
case 418:
case 416: {
- repeatedForeignEnum_.AddEntriesFrom(input, _repeated_repeatedForeignEnum_codec);
+ repeatedForeignEnum_.AddEntriesFrom(ref input, _repeated_repeatedForeignEnum_codec);
break;
}
case 434: {
- repeatedStringPiece_.AddEntriesFrom(input, _repeated_repeatedStringPiece_codec);
+ repeatedStringPiece_.AddEntriesFrom(ref input, _repeated_repeatedStringPiece_codec);
break;
}
case 442: {
- repeatedCord_.AddEntriesFrom(input, _repeated_repeatedCord_codec);
+ repeatedCord_.AddEntriesFrom(ref input, _repeated_repeatedCord_codec);
break;
}
case 450: {
- mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec);
+ mapInt32Int32_.AddEntriesFrom(ref input, _map_mapInt32Int32_codec);
break;
}
case 458: {
- mapInt64Int64_.AddEntriesFrom(input, _map_mapInt64Int64_codec);
+ mapInt64Int64_.AddEntriesFrom(ref input, _map_mapInt64Int64_codec);
break;
}
case 466: {
- mapUint32Uint32_.AddEntriesFrom(input, _map_mapUint32Uint32_codec);
+ mapUint32Uint32_.AddEntriesFrom(ref input, _map_mapUint32Uint32_codec);
break;
}
case 474: {
- mapUint64Uint64_.AddEntriesFrom(input, _map_mapUint64Uint64_codec);
+ mapUint64Uint64_.AddEntriesFrom(ref input, _map_mapUint64Uint64_codec);
break;
}
case 482: {
- mapSint32Sint32_.AddEntriesFrom(input, _map_mapSint32Sint32_codec);
+ mapSint32Sint32_.AddEntriesFrom(ref input, _map_mapSint32Sint32_codec);
break;
}
case 490: {
- mapSint64Sint64_.AddEntriesFrom(input, _map_mapSint64Sint64_codec);
+ mapSint64Sint64_.AddEntriesFrom(ref input, _map_mapSint64Sint64_codec);
break;
}
case 498: {
- mapFixed32Fixed32_.AddEntriesFrom(input, _map_mapFixed32Fixed32_codec);
+ mapFixed32Fixed32_.AddEntriesFrom(ref input, _map_mapFixed32Fixed32_codec);
break;
}
case 506: {
- mapFixed64Fixed64_.AddEntriesFrom(input, _map_mapFixed64Fixed64_codec);
+ mapFixed64Fixed64_.AddEntriesFrom(ref input, _map_mapFixed64Fixed64_codec);
break;
}
case 514: {
- mapSfixed32Sfixed32_.AddEntriesFrom(input, _map_mapSfixed32Sfixed32_codec);
+ mapSfixed32Sfixed32_.AddEntriesFrom(ref input, _map_mapSfixed32Sfixed32_codec);
break;
}
case 522: {
- mapSfixed64Sfixed64_.AddEntriesFrom(input, _map_mapSfixed64Sfixed64_codec);
+ mapSfixed64Sfixed64_.AddEntriesFrom(ref input, _map_mapSfixed64Sfixed64_codec);
break;
}
case 530: {
- mapInt32Float_.AddEntriesFrom(input, _map_mapInt32Float_codec);
+ mapInt32Float_.AddEntriesFrom(ref input, _map_mapInt32Float_codec);
break;
}
case 538: {
- mapInt32Double_.AddEntriesFrom(input, _map_mapInt32Double_codec);
+ mapInt32Double_.AddEntriesFrom(ref input, _map_mapInt32Double_codec);
break;
}
case 546: {
- mapBoolBool_.AddEntriesFrom(input, _map_mapBoolBool_codec);
+ mapBoolBool_.AddEntriesFrom(ref input, _map_mapBoolBool_codec);
break;
}
case 554: {
- mapStringString_.AddEntriesFrom(input, _map_mapStringString_codec);
+ mapStringString_.AddEntriesFrom(ref input, _map_mapStringString_codec);
break;
}
case 562: {
- mapStringBytes_.AddEntriesFrom(input, _map_mapStringBytes_codec);
+ mapStringBytes_.AddEntriesFrom(ref input, _map_mapStringBytes_codec);
break;
}
case 570: {
- mapStringNestedMessage_.AddEntriesFrom(input, _map_mapStringNestedMessage_codec);
+ mapStringNestedMessage_.AddEntriesFrom(ref input, _map_mapStringNestedMessage_codec);
break;
}
case 578: {
- mapStringForeignMessage_.AddEntriesFrom(input, _map_mapStringForeignMessage_codec);
+ mapStringForeignMessage_.AddEntriesFrom(ref input, _map_mapStringForeignMessage_codec);
break;
}
case 586: {
- mapStringNestedEnum_.AddEntriesFrom(input, _map_mapStringNestedEnum_codec);
+ mapStringNestedEnum_.AddEntriesFrom(ref input, _map_mapStringNestedEnum_codec);
break;
}
case 594: {
- mapStringForeignEnum_.AddEntriesFrom(input, _map_mapStringForeignEnum_codec);
+ mapStringForeignEnum_.AddEntriesFrom(ref input, _map_mapStringForeignEnum_codec);
break;
}
case 602:
case 600: {
- packedInt32_.AddEntriesFrom(input, _repeated_packedInt32_codec);
+ packedInt32_.AddEntriesFrom(ref input, _repeated_packedInt32_codec);
break;
}
case 610:
case 608: {
- packedInt64_.AddEntriesFrom(input, _repeated_packedInt64_codec);
+ packedInt64_.AddEntriesFrom(ref input, _repeated_packedInt64_codec);
break;
}
case 618:
case 616: {
- packedUint32_.AddEntriesFrom(input, _repeated_packedUint32_codec);
+ packedUint32_.AddEntriesFrom(ref input, _repeated_packedUint32_codec);
break;
}
case 626:
case 624: {
- packedUint64_.AddEntriesFrom(input, _repeated_packedUint64_codec);
+ packedUint64_.AddEntriesFrom(ref input, _repeated_packedUint64_codec);
break;
}
case 634:
case 632: {
- packedSint32_.AddEntriesFrom(input, _repeated_packedSint32_codec);
+ packedSint32_.AddEntriesFrom(ref input, _repeated_packedSint32_codec);
break;
}
case 642:
case 640: {
- packedSint64_.AddEntriesFrom(input, _repeated_packedSint64_codec);
+ packedSint64_.AddEntriesFrom(ref input, _repeated_packedSint64_codec);
break;
}
case 650:
case 653: {
- packedFixed32_.AddEntriesFrom(input, _repeated_packedFixed32_codec);
+ packedFixed32_.AddEntriesFrom(ref input, _repeated_packedFixed32_codec);
break;
}
case 658:
case 657: {
- packedFixed64_.AddEntriesFrom(input, _repeated_packedFixed64_codec);
+ packedFixed64_.AddEntriesFrom(ref input, _repeated_packedFixed64_codec);
break;
}
case 666:
case 669: {
- packedSfixed32_.AddEntriesFrom(input, _repeated_packedSfixed32_codec);
+ packedSfixed32_.AddEntriesFrom(ref input, _repeated_packedSfixed32_codec);
break;
}
case 674:
case 673: {
- packedSfixed64_.AddEntriesFrom(input, _repeated_packedSfixed64_codec);
+ packedSfixed64_.AddEntriesFrom(ref input, _repeated_packedSfixed64_codec);
break;
}
case 682:
case 685: {
- packedFloat_.AddEntriesFrom(input, _repeated_packedFloat_codec);
+ packedFloat_.AddEntriesFrom(ref input, _repeated_packedFloat_codec);
break;
}
case 690:
case 689: {
- packedDouble_.AddEntriesFrom(input, _repeated_packedDouble_codec);
+ packedDouble_.AddEntriesFrom(ref input, _repeated_packedDouble_codec);
break;
}
case 698:
case 696: {
- packedBool_.AddEntriesFrom(input, _repeated_packedBool_codec);
+ packedBool_.AddEntriesFrom(ref input, _repeated_packedBool_codec);
break;
}
case 706:
case 704: {
- packedNestedEnum_.AddEntriesFrom(input, _repeated_packedNestedEnum_codec);
+ packedNestedEnum_.AddEntriesFrom(ref input, _repeated_packedNestedEnum_codec);
break;
}
case 714:
case 712: {
- unpackedInt32_.AddEntriesFrom(input, _repeated_unpackedInt32_codec);
+ unpackedInt32_.AddEntriesFrom(ref input, _repeated_unpackedInt32_codec);
break;
}
case 722:
case 720: {
- unpackedInt64_.AddEntriesFrom(input, _repeated_unpackedInt64_codec);
+ unpackedInt64_.AddEntriesFrom(ref input, _repeated_unpackedInt64_codec);
break;
}
case 730:
case 728: {
- unpackedUint32_.AddEntriesFrom(input, _repeated_unpackedUint32_codec);
+ unpackedUint32_.AddEntriesFrom(ref input, _repeated_unpackedUint32_codec);
break;
}
case 738:
case 736: {
- unpackedUint64_.AddEntriesFrom(input, _repeated_unpackedUint64_codec);
+ unpackedUint64_.AddEntriesFrom(ref input, _repeated_unpackedUint64_codec);
break;
}
case 746:
case 744: {
- unpackedSint32_.AddEntriesFrom(input, _repeated_unpackedSint32_codec);
+ unpackedSint32_.AddEntriesFrom(ref input, _repeated_unpackedSint32_codec);
break;
}
case 754:
case 752: {
- unpackedSint64_.AddEntriesFrom(input, _repeated_unpackedSint64_codec);
+ unpackedSint64_.AddEntriesFrom(ref input, _repeated_unpackedSint64_codec);
break;
}
case 762:
case 765: {
- unpackedFixed32_.AddEntriesFrom(input, _repeated_unpackedFixed32_codec);
+ unpackedFixed32_.AddEntriesFrom(ref input, _repeated_unpackedFixed32_codec);
break;
}
case 770:
case 769: {
- unpackedFixed64_.AddEntriesFrom(input, _repeated_unpackedFixed64_codec);
+ unpackedFixed64_.AddEntriesFrom(ref input, _repeated_unpackedFixed64_codec);
break;
}
case 778:
case 781: {
- unpackedSfixed32_.AddEntriesFrom(input, _repeated_unpackedSfixed32_codec);
+ unpackedSfixed32_.AddEntriesFrom(ref input, _repeated_unpackedSfixed32_codec);
break;
}
case 786:
case 785: {
- unpackedSfixed64_.AddEntriesFrom(input, _repeated_unpackedSfixed64_codec);
+ unpackedSfixed64_.AddEntriesFrom(ref input, _repeated_unpackedSfixed64_codec);
break;
}
case 794:
case 797: {
- unpackedFloat_.AddEntriesFrom(input, _repeated_unpackedFloat_codec);
+ unpackedFloat_.AddEntriesFrom(ref input, _repeated_unpackedFloat_codec);
break;
}
case 802:
case 801: {
- unpackedDouble_.AddEntriesFrom(input, _repeated_unpackedDouble_codec);
+ unpackedDouble_.AddEntriesFrom(ref input, _repeated_unpackedDouble_codec);
break;
}
case 810:
case 808: {
- unpackedBool_.AddEntriesFrom(input, _repeated_unpackedBool_codec);
+ unpackedBool_.AddEntriesFrom(ref input, _repeated_unpackedBool_codec);
break;
}
case 818:
case 816: {
- unpackedNestedEnum_.AddEntriesFrom(input, _repeated_unpackedNestedEnum_codec);
+ unpackedNestedEnum_.AddEntriesFrom(ref input, _repeated_unpackedNestedEnum_codec);
break;
}
case 888: {
@@ -3848,102 +3853,102 @@ namespace ProtobufTestMessages.Proto3 {
break;
}
case 1610: {
- bool? value = _single_optionalBoolWrapper_codec.Read(input);
+ bool? value = _single_optionalBoolWrapper_codec.Read(ref input);
if (optionalBoolWrapper_ == null || value != false) {
OptionalBoolWrapper = value;
}
break;
}
case 1618: {
- int? value = _single_optionalInt32Wrapper_codec.Read(input);
+ int? value = _single_optionalInt32Wrapper_codec.Read(ref input);
if (optionalInt32Wrapper_ == null || value != 0) {
OptionalInt32Wrapper = value;
}
break;
}
case 1626: {
- long? value = _single_optionalInt64Wrapper_codec.Read(input);
+ long? value = _single_optionalInt64Wrapper_codec.Read(ref input);
if (optionalInt64Wrapper_ == null || value != 0L) {
OptionalInt64Wrapper = value;
}
break;
}
case 1634: {
- uint? value = _single_optionalUint32Wrapper_codec.Read(input);
+ uint? value = _single_optionalUint32Wrapper_codec.Read(ref input);
if (optionalUint32Wrapper_ == null || value != 0) {
OptionalUint32Wrapper = value;
}
break;
}
case 1642: {
- ulong? value = _single_optionalUint64Wrapper_codec.Read(input);
+ ulong? value = _single_optionalUint64Wrapper_codec.Read(ref input);
if (optionalUint64Wrapper_ == null || value != 0UL) {
OptionalUint64Wrapper = value;
}
break;
}
case 1650: {
- float? value = _single_optionalFloatWrapper_codec.Read(input);
+ float? value = _single_optionalFloatWrapper_codec.Read(ref input);
if (optionalFloatWrapper_ == null || value != 0F) {
OptionalFloatWrapper = value;
}
break;
}
case 1658: {
- double? value = _single_optionalDoubleWrapper_codec.Read(input);
+ double? value = _single_optionalDoubleWrapper_codec.Read(ref input);
if (optionalDoubleWrapper_ == null || value != 0D) {
OptionalDoubleWrapper = value;
}
break;
}
case 1666: {
- string value = _single_optionalStringWrapper_codec.Read(input);
+ string value = _single_optionalStringWrapper_codec.Read(ref input);
if (optionalStringWrapper_ == null || value != "") {
OptionalStringWrapper = value;
}
break;
}
case 1674: {
- pb::ByteString value = _single_optionalBytesWrapper_codec.Read(input);
+ pb::ByteString value = _single_optionalBytesWrapper_codec.Read(ref input);
if (optionalBytesWrapper_ == null || value != pb::ByteString.Empty) {
OptionalBytesWrapper = value;
}
break;
}
case 1690: {
- repeatedBoolWrapper_.AddEntriesFrom(input, _repeated_repeatedBoolWrapper_codec);
+ repeatedBoolWrapper_.AddEntriesFrom(ref input, _repeated_repeatedBoolWrapper_codec);
break;
}
case 1698: {
- repeatedInt32Wrapper_.AddEntriesFrom(input, _repeated_repeatedInt32Wrapper_codec);
+ repeatedInt32Wrapper_.AddEntriesFrom(ref input, _repeated_repeatedInt32Wrapper_codec);
break;
}
case 1706: {
- repeatedInt64Wrapper_.AddEntriesFrom(input, _repeated_repeatedInt64Wrapper_codec);
+ repeatedInt64Wrapper_.AddEntriesFrom(ref input, _repeated_repeatedInt64Wrapper_codec);
break;
}
case 1714: {
- repeatedUint32Wrapper_.AddEntriesFrom(input, _repeated_repeatedUint32Wrapper_codec);
+ repeatedUint32Wrapper_.AddEntriesFrom(ref input, _repeated_repeatedUint32Wrapper_codec);
break;
}
case 1722: {
- repeatedUint64Wrapper_.AddEntriesFrom(input, _repeated_repeatedUint64Wrapper_codec);
+ repeatedUint64Wrapper_.AddEntriesFrom(ref input, _repeated_repeatedUint64Wrapper_codec);
break;
}
case 1730: {
- repeatedFloatWrapper_.AddEntriesFrom(input, _repeated_repeatedFloatWrapper_codec);
+ repeatedFloatWrapper_.AddEntriesFrom(ref input, _repeated_repeatedFloatWrapper_codec);
break;
}
case 1738: {
- repeatedDoubleWrapper_.AddEntriesFrom(input, _repeated_repeatedDoubleWrapper_codec);
+ repeatedDoubleWrapper_.AddEntriesFrom(ref input, _repeated_repeatedDoubleWrapper_codec);
break;
}
case 1746: {
- repeatedStringWrapper_.AddEntriesFrom(input, _repeated_repeatedStringWrapper_codec);
+ repeatedStringWrapper_.AddEntriesFrom(ref input, _repeated_repeatedStringWrapper_codec);
break;
}
case 1754: {
- repeatedBytesWrapper_.AddEntriesFrom(input, _repeated_repeatedBytesWrapper_codec);
+ repeatedBytesWrapper_.AddEntriesFrom(ref input, _repeated_repeatedBytesWrapper_codec);
break;
}
case 2410: {
@@ -3989,31 +3994,31 @@ namespace ProtobufTestMessages.Proto3 {
break;
}
case 2490: {
- repeatedDuration_.AddEntriesFrom(input, _repeated_repeatedDuration_codec);
+ repeatedDuration_.AddEntriesFrom(ref input, _repeated_repeatedDuration_codec);
break;
}
case 2498: {
- repeatedTimestamp_.AddEntriesFrom(input, _repeated_repeatedTimestamp_codec);
+ repeatedTimestamp_.AddEntriesFrom(ref input, _repeated_repeatedTimestamp_codec);
break;
}
case 2506: {
- repeatedFieldmask_.AddEntriesFrom(input, _repeated_repeatedFieldmask_codec);
+ repeatedFieldmask_.AddEntriesFrom(ref input, _repeated_repeatedFieldmask_codec);
break;
}
case 2522: {
- repeatedAny_.AddEntriesFrom(input, _repeated_repeatedAny_codec);
+ repeatedAny_.AddEntriesFrom(ref input, _repeated_repeatedAny_codec);
break;
}
case 2530: {
- repeatedValue_.AddEntriesFrom(input, _repeated_repeatedValue_codec);
+ repeatedValue_.AddEntriesFrom(ref input, _repeated_repeatedValue_codec);
break;
}
case 2538: {
- repeatedListValue_.AddEntriesFrom(input, _repeated_repeatedListValue_codec);
+ repeatedListValue_.AddEntriesFrom(ref input, _repeated_repeatedListValue_codec);
break;
}
case 2594: {
- repeatedStruct_.AddEntriesFrom(input, _repeated_repeatedStruct_codec);
+ repeatedStruct_.AddEntriesFrom(ref input, _repeated_repeatedStruct_codec);
break;
}
case 3208: {
@@ -4115,7 +4120,7 @@ namespace ProtobufTestMessages.Proto3 {
[pbr::OriginalName("bAz", PreferredAlias = false)] BAz = 2,
}
- public sealed partial class NestedMessage : pb::IMessage {
+ public sealed partial class NestedMessage : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4255,11 +4260,16 @@ namespace ProtobufTestMessages.Proto3 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
A = input.ReadInt32();
@@ -4283,7 +4293,7 @@ namespace ProtobufTestMessages.Proto3 {
}
- public sealed partial class ForeignMessage : pb::IMessage {
+ public sealed partial class ForeignMessage : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ForeignMessage());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4396,11 +4406,16 @@ namespace ProtobufTestMessages.Proto3 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
C = input.ReadInt32();
diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs b/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs
index fc69603a52..9b5825a927 100644
--- a/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs
+++ b/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs
@@ -1120,7 +1120,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
/// This proto includes every type of field in both singular and repeated
/// forms.
///
- public sealed partial class TestAllTypes : pb::IMessage {
+ public sealed partial class TestAllTypes : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllTypes());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -3442,11 +3442,16 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
OptionalInt32 = input.ReadInt32();
@@ -3572,118 +3577,118 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
case 250:
case 248: {
- repeatedInt32_.AddEntriesFrom(input, _repeated_repeatedInt32_codec);
+ repeatedInt32_.AddEntriesFrom(ref input, _repeated_repeatedInt32_codec);
break;
}
case 258:
case 256: {
- repeatedInt64_.AddEntriesFrom(input, _repeated_repeatedInt64_codec);
+ repeatedInt64_.AddEntriesFrom(ref input, _repeated_repeatedInt64_codec);
break;
}
case 266:
case 264: {
- repeatedUint32_.AddEntriesFrom(input, _repeated_repeatedUint32_codec);
+ repeatedUint32_.AddEntriesFrom(ref input, _repeated_repeatedUint32_codec);
break;
}
case 274:
case 272: {
- repeatedUint64_.AddEntriesFrom(input, _repeated_repeatedUint64_codec);
+ repeatedUint64_.AddEntriesFrom(ref input, _repeated_repeatedUint64_codec);
break;
}
case 282:
case 280: {
- repeatedSint32_.AddEntriesFrom(input, _repeated_repeatedSint32_codec);
+ repeatedSint32_.AddEntriesFrom(ref input, _repeated_repeatedSint32_codec);
break;
}
case 290:
case 288: {
- repeatedSint64_.AddEntriesFrom(input, _repeated_repeatedSint64_codec);
+ repeatedSint64_.AddEntriesFrom(ref input, _repeated_repeatedSint64_codec);
break;
}
case 298:
case 301: {
- repeatedFixed32_.AddEntriesFrom(input, _repeated_repeatedFixed32_codec);
+ repeatedFixed32_.AddEntriesFrom(ref input, _repeated_repeatedFixed32_codec);
break;
}
case 306:
case 305: {
- repeatedFixed64_.AddEntriesFrom(input, _repeated_repeatedFixed64_codec);
+ repeatedFixed64_.AddEntriesFrom(ref input, _repeated_repeatedFixed64_codec);
break;
}
case 314:
case 317: {
- repeatedSfixed32_.AddEntriesFrom(input, _repeated_repeatedSfixed32_codec);
+ repeatedSfixed32_.AddEntriesFrom(ref input, _repeated_repeatedSfixed32_codec);
break;
}
case 322:
case 321: {
- repeatedSfixed64_.AddEntriesFrom(input, _repeated_repeatedSfixed64_codec);
+ repeatedSfixed64_.AddEntriesFrom(ref input, _repeated_repeatedSfixed64_codec);
break;
}
case 330:
case 333: {
- repeatedFloat_.AddEntriesFrom(input, _repeated_repeatedFloat_codec);
+ repeatedFloat_.AddEntriesFrom(ref input, _repeated_repeatedFloat_codec);
break;
}
case 338:
case 337: {
- repeatedDouble_.AddEntriesFrom(input, _repeated_repeatedDouble_codec);
+ repeatedDouble_.AddEntriesFrom(ref input, _repeated_repeatedDouble_codec);
break;
}
case 346:
case 344: {
- repeatedBool_.AddEntriesFrom(input, _repeated_repeatedBool_codec);
+ repeatedBool_.AddEntriesFrom(ref input, _repeated_repeatedBool_codec);
break;
}
case 354: {
- repeatedString_.AddEntriesFrom(input, _repeated_repeatedString_codec);
+ repeatedString_.AddEntriesFrom(ref input, _repeated_repeatedString_codec);
break;
}
case 362: {
- repeatedBytes_.AddEntriesFrom(input, _repeated_repeatedBytes_codec);
+ repeatedBytes_.AddEntriesFrom(ref input, _repeated_repeatedBytes_codec);
break;
}
case 371: {
- repeatedGroup_.AddEntriesFrom(input, _repeated_repeatedGroup_codec);
+ repeatedGroup_.AddEntriesFrom(ref input, _repeated_repeatedGroup_codec);
break;
}
case 386: {
- repeatedNestedMessage_.AddEntriesFrom(input, _repeated_repeatedNestedMessage_codec);
+ repeatedNestedMessage_.AddEntriesFrom(ref input, _repeated_repeatedNestedMessage_codec);
break;
}
case 394: {
- repeatedForeignMessage_.AddEntriesFrom(input, _repeated_repeatedForeignMessage_codec);
+ repeatedForeignMessage_.AddEntriesFrom(ref input, _repeated_repeatedForeignMessage_codec);
break;
}
case 402: {
- repeatedImportMessage_.AddEntriesFrom(input, _repeated_repeatedImportMessage_codec);
+ repeatedImportMessage_.AddEntriesFrom(ref input, _repeated_repeatedImportMessage_codec);
break;
}
case 410:
case 408: {
- repeatedNestedEnum_.AddEntriesFrom(input, _repeated_repeatedNestedEnum_codec);
+ repeatedNestedEnum_.AddEntriesFrom(ref input, _repeated_repeatedNestedEnum_codec);
break;
}
case 418:
case 416: {
- repeatedForeignEnum_.AddEntriesFrom(input, _repeated_repeatedForeignEnum_codec);
+ repeatedForeignEnum_.AddEntriesFrom(ref input, _repeated_repeatedForeignEnum_codec);
break;
}
case 426:
case 424: {
- repeatedImportEnum_.AddEntriesFrom(input, _repeated_repeatedImportEnum_codec);
+ repeatedImportEnum_.AddEntriesFrom(ref input, _repeated_repeatedImportEnum_codec);
break;
}
case 434: {
- repeatedStringPiece_.AddEntriesFrom(input, _repeated_repeatedStringPiece_codec);
+ repeatedStringPiece_.AddEntriesFrom(ref input, _repeated_repeatedStringPiece_codec);
break;
}
case 442: {
- repeatedCord_.AddEntriesFrom(input, _repeated_repeatedCord_codec);
+ repeatedCord_.AddEntriesFrom(ref input, _repeated_repeatedCord_codec);
break;
}
case 458: {
- repeatedLazyMessage_.AddEntriesFrom(input, _repeated_repeatedLazyMessage_codec);
+ repeatedLazyMessage_.AddEntriesFrom(ref input, _repeated_repeatedLazyMessage_codec);
break;
}
case 488: {
@@ -3805,7 +3810,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[pbr::OriginalName("NEG")] Neg = -1,
}
- public sealed partial class NestedMessage : pb::IMessage {
+ public sealed partial class NestedMessage : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -3938,11 +3943,16 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
Bb = input.ReadInt32();
@@ -3954,7 +3964,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
- public sealed partial class OptionalGroup : pb::IMessage {
+ public sealed partial class OptionalGroup : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -4082,13 +4092,18 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
case 132:
return;
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 136: {
A = input.ReadInt32();
@@ -4100,7 +4115,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
- public sealed partial class RepeatedGroup : pb::IMessage {
+ public sealed partial class RepeatedGroup : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RepeatedGroup());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -4228,13 +4243,18 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
case 372:
return;
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 376: {
A = input.ReadInt32();
@@ -4254,7 +4274,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
///
/// This proto includes a recursively nested message.
///
- public sealed partial class NestedTestAllTypes : pb::IMessage {
+ public sealed partial class NestedTestAllTypes : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedTestAllTypes());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4413,11 +4433,16 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
if (child_ == null) {
@@ -4434,7 +4459,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
break;
}
case 26: {
- repeatedChild_.AddEntriesFrom(input, _repeated_repeatedChild_codec);
+ repeatedChild_.AddEntriesFrom(ref input, _repeated_repeatedChild_codec);
break;
}
}
@@ -4443,7 +4468,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
- public sealed partial class TestDeprecatedFields : pb::IMessage {
+ public sealed partial class TestDeprecatedFields : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestDeprecatedFields());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -4641,11 +4666,16 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
DeprecatedInt32 = input.ReadInt32();
@@ -4662,7 +4692,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
[global::System.ObsoleteAttribute]
- public sealed partial class TestDeprecatedMessage : pb::IMessage {
+ public sealed partial class TestDeprecatedMessage : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestDeprecatedMessage());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -4751,11 +4781,16 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
}
}
@@ -4767,7 +4802,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
/// Define these after TestAllTypes to make sure the compiler can handle
/// that.
///
- public sealed partial class ForeignMessage : pb::IMessage {
+ public sealed partial class ForeignMessage : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ForeignMessage());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -4932,11 +4967,16 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
C = input.ReadInt32();
@@ -4952,7 +4992,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
- public sealed partial class TestReservedFields : pb::IMessage {
+ public sealed partial class TestReservedFields : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestReservedFields());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -5041,11 +5081,16 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
}
}
@@ -5053,7 +5098,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
- public sealed partial class TestAllExtensions : pb::IExtendableMessage {
+ public sealed partial class TestAllExtensions : pb::IExtendableMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllExtensions());
private pb::UnknownFieldSet _unknownFields;
private pb::ExtensionSet _extensions;
@@ -5158,12 +5203,17 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) {
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) {
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
}
break;
}
@@ -5194,7 +5244,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
- public sealed partial class OptionalGroup_extension : pb::IMessage {
+ public sealed partial class OptionalGroup_extension : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup_extension());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -5322,13 +5372,18 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
case 132:
return;
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 136: {
A = input.ReadInt32();
@@ -5340,7 +5395,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
- public sealed partial class RepeatedGroup_extension : pb::IMessage {
+ public sealed partial class RepeatedGroup_extension : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RepeatedGroup_extension());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -5468,13 +5523,18 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
case 372:
return;
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 376: {
A = input.ReadInt32();
@@ -5486,7 +5546,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
- public sealed partial class TestGroup : pb::IMessage {
+ public sealed partial class TestGroup : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestGroup());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -5652,11 +5712,16 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 131: {
if (!HasOptionalGroup) {
@@ -5677,7 +5742,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
/// Container for nested types declared in the TestGroup message type.
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
- public sealed partial class OptionalGroup : pb::IMessage {
+ public sealed partial class OptionalGroup : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -5805,13 +5870,18 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
case 132:
return;
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 136: {
A = input.ReadInt32();
@@ -5828,7 +5898,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
- public sealed partial class TestGroupExtension : pb::IExtendableMessage {
+ public sealed partial class TestGroupExtension : pb::IExtendableMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestGroupExtension());
private pb::UnknownFieldSet _unknownFields;
private pb::ExtensionSet _extensions;
@@ -5933,12 +6003,17 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) {
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) {
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
}
break;
}
@@ -5969,7 +6044,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
- public sealed partial class TestNestedExtension : pb::IMessage {
+ public sealed partial class TestNestedExtension : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestNestedExtension());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -6058,11 +6133,16 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
}
}
@@ -6072,7 +6152,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
/// Container for nested types declared in the TestNestedExtension message type.
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
- public sealed partial class OptionalGroup_extension : pb::IMessage {
+ public sealed partial class OptionalGroup_extension : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptionalGroup_extension());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -6200,13 +6280,18 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
case 132:
return;
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 136: {
A = input.ReadInt32();
@@ -6253,7 +6338,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
/// required filed because the code output is basically identical to
/// optional fields for all types.
///
- public sealed partial class TestRequired : pb::IMessage {
+ public sealed partial class TestRequired : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRequired());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -7571,11 +7656,16 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
A = input.ReadInt32();
@@ -7726,7 +7816,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
- public sealed partial class TestRequiredForeign : pb::IMessage {
+ public sealed partial class TestRequiredForeign : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRequiredForeign());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -7897,11 +7987,16 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
if (optionalMessage_ == null) {
@@ -7911,7 +8006,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
break;
}
case 18: {
- repeatedMessage_.AddEntriesFrom(input, _repeated_repeatedMessage_codec);
+ repeatedMessage_.AddEntriesFrom(ref input, _repeated_repeatedMessage_codec);
break;
}
case 24: {
@@ -7924,7 +8019,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
- public sealed partial class TestRequiredMessage : pb::IMessage {
+ public sealed partial class TestRequiredMessage : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRequiredMessage());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -8083,11 +8178,16 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
if (optionalMessage_ == null) {
@@ -8097,7 +8197,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
break;
}
case 18: {
- repeatedMessage_.AddEntriesFrom(input, _repeated_repeatedMessage_codec);
+ repeatedMessage_.AddEntriesFrom(ref input, _repeated_repeatedMessage_codec);
break;
}
case 26: {
@@ -8116,7 +8216,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
///
/// Test that we can use NestedMessage from outside TestAllTypes.
///
- public sealed partial class TestForeignNested : pb::IMessage {
+ public sealed partial class TestForeignNested : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestForeignNested());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -8232,11 +8332,16 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
if (foreignNested_ == null) {
@@ -8254,7 +8359,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
///
/// TestEmptyMessage is used to test unknown field support.
///
- public sealed partial class TestEmptyMessage : pb::IMessage {
+ public sealed partial class TestEmptyMessage : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestEmptyMessage());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -8343,11 +8448,16 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
}
}
@@ -8359,7 +8469,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
/// Like above, but declare all field numbers as potential extensions. No
/// actual extensions should ever be defined for this type.
///
- public sealed partial class TestEmptyMessageWithExtensions : pb::IExtendableMessage {
+ public sealed partial class TestEmptyMessageWithExtensions : pb::IExtendableMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestEmptyMessageWithExtensions());
private pb::UnknownFieldSet _unknownFields;
private pb::ExtensionSet _extensions;
@@ -8464,12 +8574,17 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) {
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) {
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
}
break;
}
@@ -8500,7 +8615,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
- public sealed partial class TestMultipleExtensionRanges : pb::IExtendableMessage {
+ public sealed partial class TestMultipleExtensionRanges : pb::IExtendableMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMultipleExtensionRanges());
private pb::UnknownFieldSet _unknownFields;
private pb::ExtensionSet _extensions;
@@ -8605,12 +8720,17 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) {
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) {
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
}
break;
}
@@ -8644,7 +8764,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
///
/// Test that really large tag numbers don't break anything.
///
- public sealed partial class TestReallyLargeTagNumber : pb::IMessage {
+ public sealed partial class TestReallyLargeTagNumber : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestReallyLargeTagNumber());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -8813,11 +8933,16 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
A = input.ReadInt32();
@@ -8833,7 +8958,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
- public sealed partial class TestRecursiveMessage : pb::IMessage {
+ public sealed partial class TestRecursiveMessage : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRecursiveMessage());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
@@ -8988,11 +9113,16 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
if (a_ == null) {
@@ -9014,7 +9144,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
///
/// Test that mutual recursion works.
///
- public sealed partial class TestMutualRecursionA : pb::IMessage {
+ public sealed partial class TestMutualRecursionA : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMutualRecursionA());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -9168,11 +9298,16 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
if (bb_ == null) {
@@ -9196,7 +9331,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
/// Container for nested types declared in the TestMutualRecursionA message type.
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
- public sealed partial class SubMessage : pb::IMessage {
+ public sealed partial class SubMessage : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SubMessage());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -9312,11 +9447,16 @@ namespace Google.Protobuf.TestProtos.Proto2 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
+ input.ReadRawMessage(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
if (b_ == null) {
@@ -9331,7 +9471,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
- public sealed partial class SubGroup : pb::IMessage {
+ public sealed partial class SubGroup : pb::IMessage, pb::IBufferMessage {
private static readonly pb::MessageParser