diff options
author | Jon Skeet <skeet@pobox.com> | 2010-05-19 21:07:58 +0100 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2010-05-19 21:07:58 +0100 |
commit | 17ded8261d19f79181dc71402f019993667fe0df (patch) | |
tree | 7fcd3bad8cb071becca7090f48c0204aa6f36ebd /src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs | |
parent | ae9b3ff224eb251674584e8e414010d2d0ed2cb1 (diff) | |
download | protobuf-17ded8261d19f79181dc71402f019993667fe0df.tar.gz protobuf-17ded8261d19f79181dc71402f019993667fe0df.tar.bz2 protobuf-17ded8261d19f79181dc71402f019993667fe0df.zip |
Fix issue 10 - check serialized size before writing to stream
Diffstat (limited to 'src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs')
-rw-r--r-- | src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs index d2c38005..40ac8d3f 100644 --- a/src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs +++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs @@ -432,6 +432,7 @@ namespace Google.ProtocolBuffers.TestProtos { } public override void WriteTo(pb::CodedOutputStream output) { + int size = SerializedSize; if (HasField1) { output.WriteString(1, Field1); } @@ -637,6 +638,7 @@ namespace Google.ProtocolBuffers.TestProtos { } public override void WriteTo(pb::CodedOutputStream output) { + int size = SerializedSize; UnknownFields.WriteTo(output); } @@ -810,6 +812,7 @@ namespace Google.ProtocolBuffers.TestProtos { } public override void WriteTo(pb::CodedOutputStream output) { + int size = SerializedSize; UnknownFields.WriteTo(output); } @@ -993,6 +996,7 @@ namespace Google.ProtocolBuffers.TestProtos { } public override void WriteTo(pb::CodedOutputStream output) { + int size = SerializedSize; UnknownFields.WriteTo(output); } @@ -1166,6 +1170,7 @@ namespace Google.ProtocolBuffers.TestProtos { } public override void WriteTo(pb::CodedOutputStream output) { + int size = SerializedSize; UnknownFields.WriteTo(output); } @@ -1339,6 +1344,7 @@ namespace Google.ProtocolBuffers.TestProtos { } public override void WriteTo(pb::CodedOutputStream output) { + int size = SerializedSize; UnknownFields.WriteTo(output); } @@ -1512,6 +1518,7 @@ namespace Google.ProtocolBuffers.TestProtos { } public override void WriteTo(pb::CodedOutputStream output) { + int size = SerializedSize; UnknownFields.WriteTo(output); } @@ -1685,6 +1692,7 @@ namespace Google.ProtocolBuffers.TestProtos { } public override void WriteTo(pb::CodedOutputStream output) { + int size = SerializedSize; UnknownFields.WriteTo(output); } @@ -1858,6 +1866,7 @@ namespace Google.ProtocolBuffers.TestProtos { } public override void WriteTo(pb::CodedOutputStream output) { + int size = SerializedSize; UnknownFields.WriteTo(output); } @@ -2031,6 +2040,7 @@ namespace Google.ProtocolBuffers.TestProtos { } public override void WriteTo(pb::CodedOutputStream output) { + int size = SerializedSize; UnknownFields.WriteTo(output); } @@ -2215,6 +2225,7 @@ namespace Google.ProtocolBuffers.TestProtos { } public override void WriteTo(pb::CodedOutputStream output) { + int size = SerializedSize; pb::ExtendableMessage<ComplexOptionType1, ComplexOptionType1.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this); if (HasFoo) { output.WriteInt32(1, Foo); @@ -2459,6 +2470,7 @@ namespace Google.ProtocolBuffers.TestProtos { } public override void WriteTo(pb::CodedOutputStream output) { + int size = SerializedSize; if (HasWaldo) { output.WriteInt32(1, Waldo); } @@ -2678,6 +2690,7 @@ namespace Google.ProtocolBuffers.TestProtos { } public override void WriteTo(pb::CodedOutputStream output) { + int size = SerializedSize; pb::ExtendableMessage<ComplexOptionType2, ComplexOptionType2.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this); if (HasBar) { output.WriteMessage(1, Bar); @@ -3028,6 +3041,7 @@ namespace Google.ProtocolBuffers.TestProtos { } public override void WriteTo(pb::CodedOutputStream output) { + int size = SerializedSize; if (HasPlugh) { output.WriteInt32(3, Plugh); } @@ -3233,6 +3247,7 @@ namespace Google.ProtocolBuffers.TestProtos { } public override void WriteTo(pb::CodedOutputStream output) { + int size = SerializedSize; if (HasQux) { output.WriteInt32(1, Qux); } @@ -3501,6 +3516,7 @@ namespace Google.ProtocolBuffers.TestProtos { } public override void WriteTo(pb::CodedOutputStream output) { + int size = SerializedSize; if (HasXyzzy) { output.WriteInt32(7593951, Xyzzy); } @@ -3705,6 +3721,7 @@ namespace Google.ProtocolBuffers.TestProtos { } public override void WriteTo(pb::CodedOutputStream output) { + int size = SerializedSize; UnknownFields.WriteTo(output); } |