Commit 2e6dc12f authored by Jon Skeet's avatar Jon Skeet

Write/Read delimited messages

parent 43da7ae3
......@@ -174,6 +174,12 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
public static PhoneNumber ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static PhoneNumber ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static PhoneNumber ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static PhoneNumber ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -217,6 +223,9 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
}
public override PhoneNumber BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
PhoneNumber returnMe = result;
result = null;
return returnMe;
......@@ -446,6 +455,12 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
public static Person ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static Person ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static Person ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static Person ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -489,6 +504,9 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
}
public override Person BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.phone_.MakeReadOnly();
Person returnMe = result;
result = null;
......@@ -753,6 +771,12 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
public static AddressBook ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static AddressBook ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static AddressBook ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static AddressBook ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -796,6 +820,9 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
}
public override AddressBook BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.person_.MakeReadOnly();
AddressBook returnMe = result;
result = null;
......
......@@ -218,6 +218,12 @@ namespace Google.ProtocolBuffers.ProtoGen {
writer.WriteLine("public static {0} ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {{", ClassName);
writer.WriteLine(" return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();");
writer.WriteLine("}");
writer.WriteLine("public static {0} ParseDelimitedFrom(global::System.IO.Stream input) {{", ClassName);
writer.WriteLine(" return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();");
writer.WriteLine("}");
writer.WriteLine("public static {0} ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {{", ClassName);
writer.WriteLine(" return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();");
writer.WriteLine("}");
writer.WriteLine("public static {0} ParseFrom(pb::CodedInputStream input) {{", ClassName);
writer.WriteLine(" return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();");
writer.WriteLine("}");
......@@ -325,6 +331,9 @@ namespace Google.ProtocolBuffers.ProtoGen {
writer.WriteLine("public override {0} BuildPartial() {{", ClassName);
writer.Indent();
writer.WriteLine("if (result == null) {");
writer.WriteLine(" throw new global::System.InvalidOperationException(\"build() has already been called on this Builder\");");
writer.WriteLine("}");
foreach (FieldDescriptor field in Descriptor.Fields) {
SourceGenerators.CreateFieldGenerator(field).GenerateBuildingCode(writer);
}
......
......@@ -370,6 +370,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestMessageWithCustomOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestMessageWithCustomOptions ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestMessageWithCustomOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestMessageWithCustomOptions ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -413,6 +419,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestMessageWithCustomOptions BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestMessageWithCustomOptions returnMe = result;
result = null;
return returnMe;
......@@ -480,6 +489,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static CustomOptionFooRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static CustomOptionFooRequest ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static CustomOptionFooRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static CustomOptionFooRequest ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -523,6 +538,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override CustomOptionFooRequest BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
CustomOptionFooRequest returnMe = result;
result = null;
return returnMe;
......@@ -571,6 +589,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static CustomOptionFooResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static CustomOptionFooResponse ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static CustomOptionFooResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static CustomOptionFooResponse ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -614,6 +638,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override CustomOptionFooResponse BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
CustomOptionFooResponse returnMe = result;
result = null;
return returnMe;
......@@ -672,6 +699,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static DummyMessageContainingEnum ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static DummyMessageContainingEnum ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static DummyMessageContainingEnum ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static DummyMessageContainingEnum ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -715,6 +748,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override DummyMessageContainingEnum BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
DummyMessageContainingEnum returnMe = result;
result = null;
return returnMe;
......@@ -763,6 +799,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static DummyMessageInvalidAsOptionType ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static DummyMessageInvalidAsOptionType ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static DummyMessageInvalidAsOptionType ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static DummyMessageInvalidAsOptionType ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -806,6 +848,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override DummyMessageInvalidAsOptionType BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
DummyMessageInvalidAsOptionType returnMe = result;
result = null;
return returnMe;
......@@ -854,6 +899,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static CustomOptionMinIntegerValues ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static CustomOptionMinIntegerValues ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static CustomOptionMinIntegerValues ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static CustomOptionMinIntegerValues ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -897,6 +948,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override CustomOptionMinIntegerValues BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
CustomOptionMinIntegerValues returnMe = result;
result = null;
return returnMe;
......@@ -945,6 +999,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static CustomOptionMaxIntegerValues ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static CustomOptionMaxIntegerValues ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static CustomOptionMaxIntegerValues ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static CustomOptionMaxIntegerValues ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -988,6 +1048,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override CustomOptionMaxIntegerValues BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
CustomOptionMaxIntegerValues returnMe = result;
result = null;
return returnMe;
......@@ -1036,6 +1099,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static CustomOptionOtherValues ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static CustomOptionOtherValues ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static CustomOptionOtherValues ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static CustomOptionOtherValues ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -1079,6 +1148,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override CustomOptionOtherValues BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
CustomOptionOtherValues returnMe = result;
result = null;
return returnMe;
......@@ -1127,6 +1199,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static SettingRealsFromPositiveInts ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static SettingRealsFromPositiveInts ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static SettingRealsFromPositiveInts ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static SettingRealsFromPositiveInts ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -1170,6 +1248,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override SettingRealsFromPositiveInts BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
SettingRealsFromPositiveInts returnMe = result;
result = null;
return returnMe;
......@@ -1218,6 +1299,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static SettingRealsFromNegativeInts ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static SettingRealsFromNegativeInts ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static SettingRealsFromNegativeInts ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static SettingRealsFromNegativeInts ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -1261,6 +1348,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override SettingRealsFromNegativeInts BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
SettingRealsFromNegativeInts returnMe = result;
result = null;
return returnMe;
......@@ -1319,6 +1409,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static ComplexOptionType1 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static ComplexOptionType1 ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static ComplexOptionType1 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static ComplexOptionType1 ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -1362,6 +1458,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override ComplexOptionType1 BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
ComplexOptionType1 returnMe = result;
result = null;
return returnMe;
......@@ -1465,6 +1564,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static ComplexOptionType4 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static ComplexOptionType4 ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static ComplexOptionType4 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static ComplexOptionType4 ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -1508,6 +1613,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override ComplexOptionType4 BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
ComplexOptionType4 returnMe = result;
result = null;
return returnMe;
......@@ -1585,6 +1693,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static ComplexOptionType2 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static ComplexOptionType2 ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static ComplexOptionType2 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static ComplexOptionType2 ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -1628,6 +1742,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override ComplexOptionType2 BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
ComplexOptionType2 returnMe = result;
result = null;
return returnMe;
......@@ -1800,6 +1917,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static ComplexOptionType5 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static ComplexOptionType5 ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static ComplexOptionType5 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static ComplexOptionType5 ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -1843,6 +1966,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override ComplexOptionType5 BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
ComplexOptionType5 returnMe = result;
result = null;
return returnMe;
......@@ -1910,6 +2036,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static ComplexOptionType3 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static ComplexOptionType3 ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static ComplexOptionType3 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static ComplexOptionType3 ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -1953,6 +2085,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override ComplexOptionType3 BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
ComplexOptionType3 returnMe = result;
result = null;
return returnMe;
......@@ -2065,6 +2200,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static ComplexOpt6 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static ComplexOpt6 ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static ComplexOpt6 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static ComplexOpt6 ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -2108,6 +2249,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override ComplexOpt6 BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
ComplexOpt6 returnMe = result;
result = null;
return returnMe;
......@@ -2174,6 +2318,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static VariousComplexOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static VariousComplexOptions ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static VariousComplexOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static VariousComplexOptions ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -2217,6 +2367,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override VariousComplexOptions BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
VariousComplexOptions returnMe = result;
result = null;
return returnMe;
......
......@@ -141,6 +141,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestEmbedOptimizedForSize ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestEmbedOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestEmbedOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestEmbedOptimizedForSize ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -184,6 +190,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestEmbedOptimizedForSize BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.repeatedMessage_.MakeReadOnly();
TestEmbedOptimizedForSize returnMe = result;
result = null;
......
......@@ -123,6 +123,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static ImportMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static ImportMessage ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static ImportMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static ImportMessage ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -166,6 +172,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override ImportMessage BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
ImportMessage returnMe = result;
result = null;
return returnMe;
......
......@@ -136,6 +136,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestMessageSet ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestMessageSet ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestMessageSet ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestMessageSet ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -179,6 +185,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestMessageSet BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestMessageSet returnMe = result;
result = null;
return returnMe;
......@@ -314,6 +323,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestMessageSetContainer ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestMessageSetContainer ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestMessageSetContainer ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestMessageSetContainer ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -357,6 +372,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestMessageSetContainer BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestMessageSetContainer returnMe = result;
result = null;
return returnMe;
......@@ -542,6 +560,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestMessageSetExtension1 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestMessageSetExtension1 ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestMessageSetExtension1 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestMessageSetExtension1 ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -585,6 +609,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestMessageSetExtension1 BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestMessageSetExtension1 returnMe = result;
result = null;
return returnMe;
......@@ -747,6 +774,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestMessageSetExtension2 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestMessageSetExtension2 ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestMessageSetExtension2 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestMessageSetExtension2 ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -790,6 +823,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestMessageSetExtension2 BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestMessageSetExtension2 returnMe = result;
result = null;
return returnMe;
......@@ -992,6 +1028,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static Item ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static Item ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static Item ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static Item ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -1035,6 +1077,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Item BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
Item returnMe = result;
result = null;
return returnMe;
......@@ -1203,6 +1248,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static RawMessageSet ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static RawMessageSet ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static RawMessageSet ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static RawMessageSet ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -1246,6 +1297,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override RawMessageSet BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.item_.MakeReadOnly();
RawMessageSet returnMe = result;
result = null;
......
......@@ -119,6 +119,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestOptimizedForSize ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestOptimizedForSize ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -162,6 +168,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestOptimizedForSize BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestOptimizedForSize returnMe = result;
result = null;
return returnMe;
......@@ -274,6 +283,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestRequiredOptimizedForSize ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestRequiredOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestRequiredOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestRequiredOptimizedForSize ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -317,6 +332,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestRequiredOptimizedForSize BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestRequiredOptimizedForSize returnMe = result;
result = null;
return returnMe;
......@@ -393,6 +411,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestOptionalOptimizedForSize ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestOptionalOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestOptionalOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestOptionalOptimizedForSize ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -436,6 +460,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestOptionalOptimizedForSize BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestOptionalOptimizedForSize returnMe = result;
result = null;
return returnMe;
......
......@@ -916,6 +916,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static NestedMessage ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -959,6 +965,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override NestedMessage BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
NestedMessage returnMe = result;
result = null;
return returnMe;
......@@ -1118,6 +1127,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static OptionalGroup ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static OptionalGroup ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static OptionalGroup ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static OptionalGroup ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -1161,6 +1176,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override OptionalGroup BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
OptionalGroup returnMe = result;
result = null;
return returnMe;
......@@ -1320,6 +1338,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static RepeatedGroup ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static RepeatedGroup ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static RepeatedGroup ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static RepeatedGroup ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -1363,6 +1387,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override RepeatedGroup BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
RepeatedGroup returnMe = result;
result = null;
return returnMe;
......@@ -2755,6 +2782,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestAllTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestAllTypes ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -2798,6 +2831,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestAllTypes BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.repeatedInt32_.MakeReadOnly();
result.repeatedInt64_.MakeReadOnly();
result.repeatedUint32_.MakeReadOnly();
......@@ -5084,6 +5120,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static ForeignMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static ForeignMessage ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static ForeignMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static ForeignMessage ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -5127,6 +5169,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override ForeignMessage BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
ForeignMessage returnMe = result;
result = null;
return returnMe;
......@@ -5274,6 +5319,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestAllExtensions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestAllExtensions ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestAllExtensions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestAllExtensions ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -5317,6 +5368,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestAllExtensions BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestAllExtensions returnMe = result;
result = null;
return returnMe;
......@@ -5452,6 +5506,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static OptionalGroup_extension ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static OptionalGroup_extension ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static OptionalGroup_extension ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static OptionalGroup_extension ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -5495,6 +5555,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override OptionalGroup_extension BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
OptionalGroup_extension returnMe = result;
result = null;
return returnMe;
......@@ -5654,6 +5717,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static RepeatedGroup_extension ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static RepeatedGroup_extension ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static RepeatedGroup_extension ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static RepeatedGroup_extension ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -5697,6 +5766,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override RepeatedGroup_extension BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
RepeatedGroup_extension returnMe = result;
result = null;
return returnMe;
......@@ -6378,6 +6450,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestRequired ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestRequired ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestRequired ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestRequired ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -6421,6 +6499,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestRequired BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestRequired returnMe = result;
result = null;
return returnMe;
......@@ -7420,6 +7501,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestRequiredForeign ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestRequiredForeign ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestRequiredForeign ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestRequiredForeign ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -7463,6 +7550,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestRequiredForeign BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.repeatedMessage_.MakeReadOnly();
TestRequiredForeign returnMe = result;
result = null;
......@@ -7718,6 +7808,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestForeignNested ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestForeignNested ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestForeignNested ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestForeignNested ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -7761,6 +7857,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestForeignNested BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestForeignNested returnMe = result;
result = null;
return returnMe;
......@@ -7927,6 +8026,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestEmptyMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestEmptyMessage ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestEmptyMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestEmptyMessage ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -7970,6 +8075,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestEmptyMessage BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestEmptyMessage returnMe = result;
result = null;
return returnMe;
......@@ -8092,6 +8200,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestEmptyMessageWithExtensions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestEmptyMessageWithExtensions ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestEmptyMessageWithExtensions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestEmptyMessageWithExtensions ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -8135,6 +8249,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestEmptyMessageWithExtensions BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestEmptyMessageWithExtensions returnMe = result;
result = null;
return returnMe;
......@@ -8286,6 +8403,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestReallyLargeTagNumber ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestReallyLargeTagNumber ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestReallyLargeTagNumber ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestReallyLargeTagNumber ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -8329,6 +8452,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestReallyLargeTagNumber BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestReallyLargeTagNumber returnMe = result;
result = null;
return returnMe;
......@@ -8529,6 +8655,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestRecursiveMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestRecursiveMessage ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestRecursiveMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestRecursiveMessage ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -8572,6 +8704,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestRecursiveMessage BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestRecursiveMessage returnMe = result;
result = null;
return returnMe;
......@@ -8779,6 +8914,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestMutualRecursionA ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestMutualRecursionA ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestMutualRecursionA ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestMutualRecursionA ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -8822,6 +8963,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestMutualRecursionA BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestMutualRecursionA returnMe = result;
result = null;
return returnMe;
......@@ -9020,6 +9164,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestMutualRecursionB ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestMutualRecursionB ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestMutualRecursionB ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestMutualRecursionB ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -9063,6 +9213,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestMutualRecursionB BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestMutualRecursionB returnMe = result;
result = null;
return returnMe;
......@@ -9294,6 +9447,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static Foo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static Foo ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static Foo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static Foo ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -9337,6 +9496,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Foo BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
Foo returnMe = result;
result = null;
return returnMe;
......@@ -9496,6 +9658,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static Bar ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static Bar ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static Bar ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static Bar ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -9539,6 +9707,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override Bar BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
Bar returnMe = result;
result = null;
return returnMe;
......@@ -9711,6 +9882,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestDupFieldNumber ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestDupFieldNumber ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestDupFieldNumber ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestDupFieldNumber ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -9754,6 +9931,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestDupFieldNumber BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestDupFieldNumber returnMe = result;
result = null;
return returnMe;
......@@ -10060,6 +10240,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static NestedMessage ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -10103,6 +10289,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override NestedMessage BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.nestedmessageRepeatedInt32_.MakeReadOnly();
result.nestedmessageRepeatedForeignmessage_.MakeReadOnly();
NestedMessage returnMe = result;
......@@ -10300,6 +10489,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestNestedMessageHasBits ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestNestedMessageHasBits ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestNestedMessageHasBits ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestNestedMessageHasBits ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -10343,6 +10538,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestNestedMessageHasBits BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestNestedMessageHasBits returnMe = result;
result = null;
return returnMe;
......@@ -10750,6 +10948,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestCamelCaseFieldNames ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestCamelCaseFieldNames ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestCamelCaseFieldNames ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestCamelCaseFieldNames ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -10793,6 +10997,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestCamelCaseFieldNames BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.repeatedPrimitiveField_.MakeReadOnly();
result.repeatedStringField_.MakeReadOnly();
result.repeatedEnumField_.MakeReadOnly();
......@@ -11380,6 +11587,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestFieldOrderings ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestFieldOrderings ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestFieldOrderings ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestFieldOrderings ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -11423,6 +11636,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestFieldOrderings BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestFieldOrderings returnMe = result;
result = null;
return returnMe;
......@@ -11714,6 +11930,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestExtremeDefaultValues ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestExtremeDefaultValues ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestExtremeDefaultValues ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestExtremeDefaultValues ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -11757,6 +11979,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestExtremeDefaultValues BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestExtremeDefaultValues returnMe = result;
result = null;
return returnMe;
......@@ -12435,6 +12660,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestPackedTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestPackedTypes ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestPackedTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestPackedTypes ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -12478,6 +12709,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestPackedTypes BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.packedInt32_.MakeReadOnly();
result.packedInt64_.MakeReadOnly();
result.packedUint32_.MakeReadOnly();
......@@ -13154,6 +13388,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static TestPackedExtensions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestPackedExtensions ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestPackedExtensions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestPackedExtensions ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -13197,6 +13437,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override TestPackedExtensions BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestPackedExtensions returnMe = result;
result = null;
return returnMe;
......@@ -13316,6 +13559,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static FooRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static FooRequest ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static FooRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static FooRequest ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -13359,6 +13608,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override FooRequest BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
FooRequest returnMe = result;
result = null;
return returnMe;
......@@ -13477,6 +13729,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static FooResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static FooResponse ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static FooResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static FooResponse ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -13520,6 +13778,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override FooResponse BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
FooResponse returnMe = result;
result = null;
return returnMe;
......@@ -13638,6 +13899,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static BarRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static BarRequest ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static BarRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static BarRequest ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -13681,6 +13948,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override BarRequest BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
BarRequest returnMe = result;
result = null;
return returnMe;
......@@ -13799,6 +14069,12 @@ namespace Google.ProtocolBuffers.TestProtos {
public static BarResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static BarResponse ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static BarResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static BarResponse ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -13842,6 +14118,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override BarResponse BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
BarResponse returnMe = result;
result = null;
return returnMe;
......
......@@ -29,6 +29,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System.IO;
using System.Reflection;
using Google.ProtocolBuffers.Descriptors;
using Google.ProtocolBuffers.TestProtos;
......@@ -98,6 +99,23 @@ namespace Google.ProtocolBuffers {
Assert.AreEqual(rawBytes, rawBytes2);
}
[Test]
public void SerializeDelimited() {
MemoryStream stream = new MemoryStream();
TestUtil.GetAllSet().WriteDelimitedTo(stream);
stream.WriteByte(12);
TestUtil.GetPackedSet().WriteDelimitedTo(stream);
stream.WriteByte(34);
stream.Position = 0;
TestUtil.AssertAllFieldsSet(TestAllTypes.ParseDelimitedFrom(stream));
Assert.AreEqual(12, stream.ReadByte());
TestUtil.AssertPackedFieldsSet(TestPackedTypes.ParseDelimitedFrom(stream));
Assert.AreEqual(34, stream.ReadByte());
Assert.AreEqual(-1, stream.ReadByte());
}
[Test]
public void ParseExtensions() {
// TestAllTypes and TestAllExtensions should have compatible wire formats,
......@@ -133,7 +151,7 @@ namespace Google.ProtocolBuffers {
Assert.AreEqual(TestUtil.GetAllSet().SerializedSize, TestUtil.GetAllExtensionsSet().SerializedSize);
}
private void AssertFieldsInOrder(ByteString data) {
private static void AssertFieldsInOrder(ByteString data) {
CodedInputStream input = data.CreateCodedInput();
uint previousTag = 0;
......
......@@ -225,6 +225,16 @@ namespace Google.ProtocolBuffers {
return ThisBuilder;
}
public TBuilder MergeDelimitedFrom(Stream input, ExtensionRegistry extensionRegistry) {
int size = CodedInputStream.ReadRawVarint32(input);
Stream limitedStream = new LimitedInputStream(input, size);
return MergeFrom(limitedStream, extensionRegistry);
}
public TBuilder MergeDelimitedFrom(Stream input) {
return MergeDelimitedFrom(input, ExtensionRegistry.Empty);
}
public virtual IBuilder SetField(FieldDescriptor field, object value) {
this[field] = value;
return ThisBuilder;
......@@ -234,5 +244,70 @@ namespace Google.ProtocolBuffers {
this[field, index] = value;
return ThisBuilder;
}
/// <summary>
/// Stream implementation which proxies another stream, only allowing a certain amount
/// of data to be read. Note that this is only used to read delimited streams, so it
/// doesn't attempt to implement everything.
/// </summary>
private class LimitedInputStream : Stream {
private readonly Stream proxied;
private int bytesLeft;
internal LimitedInputStream(Stream proxied, int size) {
this.proxied = proxied;
bytesLeft = size;
}
public override bool CanRead {
get { return true; }
}
public override bool CanSeek {
get { return false; }
}
public override bool CanWrite {
get { return false; }
}
public override void Flush() {
}
public override long Length {
get { throw new NotImplementedException(); }
}
public override long Position {
get {
throw new NotImplementedException();
}
set {
throw new NotImplementedException();
}
}
public override int Read(byte[] buffer, int offset, int count) {
if (bytesLeft > 0) {
int bytesRead = proxied.Read(buffer, offset, Math.Min(bytesLeft, count));
bytesLeft -= bytesRead;
return bytesRead;
}
return 0;
}
public override long Seek(long offset, SeekOrigin origin) {
throw new NotImplementedException();
}
public override void SetLength(long value) {
throw new NotImplementedException();
}
public override void Write(byte[] buffer, int offset, int count) {
throw new NotImplementedException();
}
}
}
}
......@@ -205,6 +205,13 @@ namespace Google.ProtocolBuffers {
codedOutput.Flush();
}
public void WriteDelimitedTo(Stream output) {
CodedOutputStream codedOutput = CodedOutputStream.CreateInstance(output);
codedOutput.WriteRawVarint32((uint) SerializedSize);
WriteTo(codedOutput);
codedOutput.Flush();
}
public override bool Equals(object other) {
if (other == this) {
return true;
......
......@@ -141,7 +141,7 @@ namespace Google.ProtocolBuffers {
/// zero is not a valid tag number.
/// </summary>
public uint ReadTag() {
if (bufferPos == bufferSize && !RefillBuffer(false)) {
if (IsAtEnd) {
lastTag = 0;
return 0;
}
......@@ -457,6 +457,41 @@ namespace Google.ProtocolBuffers {
return (uint)result;
}
/// <summary>
/// Reads a varint from the input one byte at a time, so that it does not
/// read any bytes after the end of the varint. If you simply wrapped the
/// stream in a CodedInputStream and used ReadRawVarint32(Stream)}
/// then you would probably end up reading past the end of the varint since
/// CodedInputStream buffers its input.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
internal static int ReadRawVarint32(Stream input) {
int result = 0;
int offset = 0;
for (; offset < 32; offset += 7) {
int b = input.ReadByte();
if (b == -1) {
throw InvalidProtocolBufferException.TruncatedMessage();
}
result |= (b & 0x7f) << offset;
if ((b & 0x80) == 0) {
return result;
}
}
// Keep reading up to 64 bits.
for (; offset < 64; offset += 7) {
int b = input.ReadByte();
if (b == -1) {
throw InvalidProtocolBufferException.TruncatedMessage();
}
if ((b & 0x80) == 0) {
return result;
}
}
throw InvalidProtocolBufferException.MalformedVarint();
}
/// <summary>
/// Read a raw varint from the stream.
/// </summary>
......@@ -555,6 +590,9 @@ namespace Google.ProtocolBuffers {
/// as you can without harming your app's functionality. Note that
/// size limits only apply when reading from an InputStream, not
/// when constructed around a raw byte array (nor with ByteString.NewCodedInput).
/// If you want to read several messages from a single CodedInputStream, you
/// can call ResetSizeCounter() after each message to avoid hitting the
/// size limit.
/// </remarks>
public int SetSizeLimit(int limit) {
if (limit < 0) {
......@@ -566,6 +604,13 @@ namespace Google.ProtocolBuffers {
}
#region Internal reading and buffer management
/// <summary>
/// Resets the current size counter to zero (see SetSizeLimit).
/// </summary>
public void ResetSizeCounter() {
totalBytesRetired = 0;
}
/// <summary>
/// Sets currentLimit to (current position) + byteLimit. This is called
/// when descending into a length-delimited embedded message. The previous
......@@ -622,6 +667,17 @@ namespace Google.ProtocolBuffers {
}
}
/// <summary>
/// Returns true if the stream has reached the end of the input. This is the
/// case if either the end of the underlying input source has been reached or
/// the stream has reached a limit created using PushLimit.
/// </summary>
public bool IsAtEnd {
get {
return bufferPos == bufferSize && !RefillBuffer(false);
}
}
/// <summary>
/// Called when buffer is empty to read more bytes from the
/// input. If <paramref name="mustSucceed"/> is true, RefillBuffer() gurantees that
......@@ -649,6 +705,9 @@ namespace Google.ProtocolBuffers {
bufferPos = 0;
bufferSize = (input == null) ? 0 : input.Read(buffer, 0, buffer.Length);
if (bufferSize < 0) {
throw new InvalidOperationException("Stream.Read returned a negative count");
}
if (bufferSize == 0) {
if (mustSucceed) {
throw InvalidProtocolBufferException.TruncatedMessage();
......@@ -847,7 +906,7 @@ namespace Google.ProtocolBuffers {
throw InvalidProtocolBufferException.TruncatedMessage();
}
if (size < bufferSize - bufferPos) {
if (size <= bufferSize - bufferPos) {
// We have all the bytes we need already.
bufferPos += size;
} else {
......@@ -863,8 +922,9 @@ namespace Google.ProtocolBuffers {
if (input == null) {
throw InvalidProtocolBufferException.TruncatedMessage();
}
input.Seek(size - pos, SeekOrigin.Current);
if (input.Position > input.Length) {
long previousPosition = input.Position;
input.Position += size - pos;
if (input.Position != previousPosition + size - pos) {
throw InvalidProtocolBufferException.TruncatedMessage();
}
totalBytesRetired += size - pos;
......
......@@ -143,6 +143,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static CSharpFileOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static CSharpFileOptions ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static CSharpFileOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static CSharpFileOptions ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -186,6 +192,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override CSharpFileOptions BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
CSharpFileOptions returnMe = result;
result = null;
return returnMe;
......@@ -336,6 +345,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static CSharpFieldOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static CSharpFieldOptions ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static CSharpFieldOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static CSharpFieldOptions ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -379,6 +394,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override CSharpFieldOptions BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
CSharpFieldOptions returnMe = result;
result = null;
return returnMe;
......
......@@ -273,6 +273,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static FileDescriptorSet ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static FileDescriptorSet ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static FileDescriptorSet ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static FileDescriptorSet ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -316,6 +322,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override FileDescriptorSet BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.file_.MakeReadOnly();
FileDescriptorSet returnMe = result;
result = null;
......@@ -642,6 +651,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static FileDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static FileDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static FileDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static FileDescriptorProto ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -685,6 +700,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override FileDescriptorProto BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.dependency_.MakeReadOnly();
result.messageType_.MakeReadOnly();
result.enumType_.MakeReadOnly();
......@@ -1187,6 +1205,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static ExtensionRange ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static ExtensionRange ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static ExtensionRange ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static ExtensionRange ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -1230,6 +1254,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override ExtensionRange BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
ExtensionRange returnMe = result;
result = null;
return returnMe;
......@@ -1516,6 +1543,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static DescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static DescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static DescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static DescriptorProto ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -1559,6 +1592,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override DescriptorProto BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.field_.MakeReadOnly();
result.extension_.MakeReadOnly();
result.nestedType_.MakeReadOnly();
......@@ -2154,6 +2190,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static FieldDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static FieldDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static FieldDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static FieldDescriptorProto ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -2197,6 +2239,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override FieldDescriptorProto BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
FieldDescriptorProto returnMe = result;
result = null;
return returnMe;
......@@ -2614,6 +2659,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static EnumDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static EnumDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static EnumDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static EnumDescriptorProto ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -2657,6 +2708,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override EnumDescriptorProto BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.value_.MakeReadOnly();
EnumDescriptorProto returnMe = result;
result = null;
......@@ -2948,6 +3002,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static EnumValueDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static EnumValueDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static EnumValueDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static EnumValueDescriptorProto ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -2991,6 +3051,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override EnumValueDescriptorProto BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
EnumValueDescriptorProto returnMe = result;
result = null;
return returnMe;
......@@ -3264,6 +3327,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static ServiceDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static ServiceDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static ServiceDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static ServiceDescriptorProto ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -3307,6 +3376,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override ServiceDescriptorProto BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.method_.MakeReadOnly();
ServiceDescriptorProto returnMe = result;
result = null;
......@@ -3614,6 +3686,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static MethodDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static MethodDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static MethodDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static MethodDescriptorProto ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -3657,6 +3735,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override MethodDescriptorProto BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
MethodDescriptorProto returnMe = result;
result = null;
return returnMe;
......@@ -4000,6 +4081,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static FileOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static FileOptions ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static FileOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static FileOptions ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -4043,6 +4130,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override FileOptions BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.uninterpretedOption_.MakeReadOnly();
FileOptions returnMe = result;
result = null;
......@@ -4361,6 +4451,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static MessageOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static MessageOptions ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static MessageOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static MessageOptions ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -4404,6 +4500,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override MessageOptions BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.uninterpretedOption_.MakeReadOnly();
MessageOptions returnMe = result;
result = null;
......@@ -4679,6 +4778,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static FieldOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static FieldOptions ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static FieldOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static FieldOptions ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -4722,6 +4827,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override FieldOptions BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.uninterpretedOption_.MakeReadOnly();
FieldOptions returnMe = result;
result = null;
......@@ -4998,6 +5106,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static EnumOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static EnumOptions ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static EnumOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static EnumOptions ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -5041,6 +5155,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override EnumOptions BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.uninterpretedOption_.MakeReadOnly();
EnumOptions returnMe = result;
result = null;
......@@ -5233,6 +5350,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static EnumValueOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static EnumValueOptions ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static EnumValueOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static EnumValueOptions ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -5276,6 +5399,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override EnumValueOptions BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.uninterpretedOption_.MakeReadOnly();
EnumValueOptions returnMe = result;
result = null;
......@@ -5468,6 +5594,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static ServiceOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static ServiceOptions ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static ServiceOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static ServiceOptions ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -5511,6 +5643,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override ServiceOptions BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.uninterpretedOption_.MakeReadOnly();
ServiceOptions returnMe = result;
result = null;
......@@ -5703,6 +5838,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static MethodOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static MethodOptions ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static MethodOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static MethodOptions ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -5746,6 +5887,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override MethodOptions BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.uninterpretedOption_.MakeReadOnly();
MethodOptions returnMe = result;
result = null;
......@@ -5971,6 +6115,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static NamePart ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static NamePart ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static NamePart ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static NamePart ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -6014,6 +6164,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override NamePart BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
NamePart returnMe = result;
result = null;
return returnMe;
......@@ -6265,6 +6418,12 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
public static UninterpretedOption ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static UninterpretedOption ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static UninterpretedOption ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static UninterpretedOption ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
......@@ -6308,6 +6467,9 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override UninterpretedOption BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.name_.MakeReadOnly();
UninterpretedOption returnMe = result;
result = null;
......
......@@ -248,6 +248,20 @@ namespace Google.ProtocolBuffers {
/// </summary>
TBuilder MergeUnknownFields(UnknownFieldSet unknownFields);
/// <summary>
/// Like MergeFrom(Stream), but does not read until the end of the file.
/// Instead, the size of the message (encoded as a varint) is read first,
/// then the message data. Use Message.WriteDelimitedTo(Stream) to
/// write messages in this format.
/// </summary>
/// <param name="input"></param>
TBuilder MergeDelimitedFrom(Stream input);
/// <summary>
/// Like MergeDelimitedFrom(Stream) but supporting extensions.
/// </summary>
TBuilder MergeDelimitedFrom(Stream input, ExtensionRegistry extensionRegistry);
#region Convenience methods
/// <summary>
/// Parse <paramref name="data"/> as a message of this type and merge
......@@ -283,8 +297,9 @@ namespace Google.ProtocolBuffers {
/// MergeFrom(CodedInputStream). Note that this method always reads
/// the entire input (unless it throws an exception). If you want it to
/// stop earlier, you will need to wrap the input in a wrapper
/// stream which limits reading. Despite usually reading the entire
/// stream, this method never closes the stream.
/// stream which limits reading. Or, use IMessage.WriteDelimitedTo(Stream)
/// to write your message and MmergeDelimitedFrom(Stream) to read it.
/// Despite usually reading the entire stream, this method never closes the stream.
/// </summary>
TBuilder MergeFrom(Stream input);
......
......@@ -113,9 +113,26 @@ namespace Google.ProtocolBuffers {
/// Serializes the message and writes it to the given output stream.
/// This does not flush or close the stream.
/// </summary>
/// <param name="output"></param>
/// <remarks>
/// Protocol Buffers are not self-delimiting. Therefore, if you write
/// any more data to the stream after the message, you must somehow ensure
/// that the parser on the receiving end does not interpret this as being
/// part of the protocol message. One way of doing this is by writing the size
/// of the message before the data, then making sure you limit the input to
/// that size when receiving the data. Alternatively, use WriteDelimitedTo(Stream).
/// </remarks>
void WriteTo(CodedOutputStream output);
/// <summary>
/// Like WriteTo(Stream) but writes the size of the message as a varint before
/// writing the data. This allows more data to be written to the stream after the
/// message without the need to delimit the message data yourself. Use
/// IBuilder.MergeDelimitedFrom(Stream) or the static method
/// YourMessageType.ParseDelimitedFrom(Stream) to parse messages written by this method.
/// </summary>
/// <param name="output"></param>
void WriteDelimitedTo(Stream output);
/// <summary>
/// Returns the number of bytes required to encode this message.
/// The result is only computed on the first call and memoized after that.
......
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.IO;
using System.Reflection;
......
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace Google.ProtocolBuffers {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment