Fully converted over to ICodedOutputStream for all WriteTo derivations
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestCSharpOptionsProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestCSharpOptionsProtoFile.cs
index aaca1b9..9cc59a2 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestCSharpOptionsProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestCSharpOptionsProtoFile.cs
@@ -115,7 +115,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasNormal) {

         output.WriteString(1, "normal", Normal);

diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs
index 0cfb0ad..53a076e 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs
@@ -450,7 +450,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasField1) {

         output.WriteString(1, "field1", Field1);

@@ -662,7 +662,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       UnknownFields.WriteTo(output);

     }

@@ -842,7 +842,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       UnknownFields.WriteTo(output);

     }

@@ -1037,7 +1037,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       UnknownFields.WriteTo(output);

     }

@@ -1217,7 +1217,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       UnknownFields.WriteTo(output);

     }

@@ -1397,7 +1397,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       UnknownFields.WriteTo(output);

     }

@@ -1577,7 +1577,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       UnknownFields.WriteTo(output);

     }

@@ -1757,7 +1757,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       UnknownFields.WriteTo(output);

     }

@@ -1937,7 +1937,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       UnknownFields.WriteTo(output);

     }

@@ -2117,7 +2117,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       UnknownFields.WriteTo(output);

     }

@@ -2328,7 +2328,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       pb::ExtendableMessage<ComplexOptionType1, ComplexOptionType1.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);

       if (HasFoo) {

@@ -2647,7 +2647,7 @@
           }

         }

         

-        public override void WriteTo(pb::CodedOutputStream output) {

+        public override void WriteTo(pb::ICodedOutputStream output) {

           int size = SerializedSize;

           if (HasWaldo) {

             output.WriteInt32(1, "waldo", Waldo);

@@ -2870,7 +2870,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       pb::ExtendableMessage<ComplexOptionType2, ComplexOptionType2.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);

       if (HasBar) {

@@ -3233,7 +3233,7 @@
           }

         }

         

-        public override void WriteTo(pb::CodedOutputStream output) {

+        public override void WriteTo(pb::ICodedOutputStream output) {

           int size = SerializedSize;

           if (HasPlugh) {

             output.WriteInt32(3, "plugh", Plugh);

@@ -3442,7 +3442,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasQux) {

         output.WriteInt32(1, "qux", Qux);

@@ -3717,7 +3717,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasXyzzy) {

         output.WriteInt32(7593951, "xyzzy", Xyzzy);

@@ -3928,7 +3928,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       UnknownFields.WriteTo(output);

     }

diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs
index b184943..4d94af2 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs
@@ -117,13 +117,13 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasOptionalMessage) {

         output.WriteMessage(1, "optional_message", OptionalMessage);

       }

       if (repeatedMessage_.Count > 0) {

-        output.WriteMessageArray(2, "repeated_message", repeatedMessage_);

+        output.WriteArray(pbd::FieldType.Message, 2, "repeated_message", repeatedMessage_);

       }

       UnknownFields.WriteTo(output);

     }

diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs
index 5960a9f..3eb853c 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs
@@ -579,7 +579,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasField1) {

         output.WriteString(1, "field1", Field1);

@@ -2282,7 +2282,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasField1) {

         output.WriteInt32(1, "field1", Field1);

@@ -3291,7 +3291,7 @@
           }

         }

         

-        public override void WriteTo(pb::CodedOutputStream output) {

+        public override void WriteTo(pb::ICodedOutputStream output) {

           int size = SerializedSize;

           if (HasField5) {

             output.WriteInt32(5, "field5", Field5);

@@ -4330,7 +4330,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasField1) {

         output.WriteString(1, "field1", Field1);

@@ -4348,7 +4348,7 @@
         output.WriteString(6, "field6", Field6);

       }

       if (group1_.Count > 0) {

-        output.WriteGroupArray(10, "group1", group1_);

+        output.WriteArray(pbd::FieldType.Group, 10, "group1", group1_);

       }

       if (HasField21) {

         output.WriteInt32(21, "field21", Field21);

@@ -5622,7 +5622,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasField1) {

         output.WriteFloat(1, "field1", Field1);

diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs
index 9a29d41..2002d8d 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs
@@ -70,7 +70,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasD) {

         output.WriteInt32(1, "d", D);

diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs
index ecf92cf..b00ff2f 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs
@@ -106,7 +106,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasD) {

         output.WriteInt32(1, "d", D);

diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs
index 4872834..c69ac9f 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs
@@ -129,7 +129,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       pb::ExtendableMessage<TestMessageSet, TestMessageSet.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);

       extensionWriter.WriteUntil(536870912, output);

@@ -323,7 +323,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasMessageSet) {

         output.WriteMessage(1, "message_set", MessageSet);

@@ -569,7 +569,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasI) {

         output.WriteInt32(15, "i", I);

@@ -792,7 +792,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasStr) {

         output.WriteString(25, "str", Str);

@@ -1056,7 +1056,7 @@
           }

         }

         

-        public override void WriteTo(pb::CodedOutputStream output) {

+        public override void WriteTo(pb::ICodedOutputStream output) {

           int size = SerializedSize;

           if (HasTypeId) {

             output.WriteInt32(2, "type_id", TypeId);

@@ -1289,10 +1289,10 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (item_.Count > 0) {

-        output.WriteGroupArray(1, "item", item_);

+        output.WriteArray(pbd::FieldType.Group, 1, "item", item_);

       }

       UnknownFields.WriteTo(output);

     }

diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs
index 9449946..423c3ad 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs
@@ -117,7 +117,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       pb::ExtendableMessage<TestMessage, TestMessage.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);

       if (HasA) {

diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
index ae9b1bb..a9a69f1 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
@@ -1103,7 +1103,7 @@
           }

         }

         

-        public override void WriteTo(pb::CodedOutputStream output) {

+        public override void WriteTo(pb::ICodedOutputStream output) {

           int size = SerializedSize;

           if (HasBb) {

             output.WriteInt32(1, "bb", Bb);

@@ -1324,7 +1324,7 @@
           }

         }

         

-        public override void WriteTo(pb::CodedOutputStream output) {

+        public override void WriteTo(pb::ICodedOutputStream output) {

           int size = SerializedSize;

           if (HasA) {

             output.WriteInt32(17, "a", A);

@@ -1545,7 +1545,7 @@
           }

         }

         

-        public override void WriteTo(pb::CodedOutputStream output) {

+        public override void WriteTo(pb::ICodedOutputStream output) {

           int size = SerializedSize;

           if (HasA) {

             output.WriteInt32(47, "a", A);

@@ -2478,7 +2478,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasOptionalInt32) {

         output.WriteInt32(1, "optional_int32", OptionalInt32);

@@ -2598,16 +2598,16 @@
         output.WriteArray(pbd::FieldType.Bytes, 45, "repeated_bytes", repeatedBytes_);

       }

       if (repeatedGroup_.Count > 0) {

-        output.WriteGroupArray(46, "repeatedgroup", repeatedGroup_);

+        output.WriteArray(pbd::FieldType.Group, 46, "repeatedgroup", repeatedGroup_);

       }

       if (repeatedNestedMessage_.Count > 0) {

-        output.WriteMessageArray(48, "repeated_nested_message", repeatedNestedMessage_);

+        output.WriteArray(pbd::FieldType.Message, 48, "repeated_nested_message", repeatedNestedMessage_);

       }

       if (repeatedForeignMessage_.Count > 0) {

-        output.WriteMessageArray(49, "repeated_foreign_message", repeatedForeignMessage_);

+        output.WriteArray(pbd::FieldType.Message, 49, "repeated_foreign_message", repeatedForeignMessage_);

       }

       if (repeatedImportMessage_.Count > 0) {

-        output.WriteMessageArray(50, "repeated_import_message", repeatedImportMessage_);

+        output.WriteArray(pbd::FieldType.Message, 50, "repeated_import_message", repeatedImportMessage_);

       }

       if (repeatedNestedEnum_.Count > 0) {

         output.WriteArray(pbd::FieldType.Enum, 51, "repeated_nested_enum", repeatedNestedEnum_);

@@ -5356,7 +5356,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasDeprecatedInt32) {

         output.WriteInt32(1, "deprecated_int32", DeprecatedInt32);

@@ -5577,7 +5577,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasC) {

         output.WriteInt32(1, "c", C);

@@ -5789,7 +5789,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       pb::ExtendableMessage<TestAllExtensions, TestAllExtensions.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);

       extensionWriter.WriteUntil(536870912, output);

@@ -5983,7 +5983,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasA) {

         output.WriteInt32(17, "a", A);

@@ -6204,7 +6204,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasA) {

         output.WriteInt32(47, "a", A);

@@ -6417,7 +6417,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       UnknownFields.WriteTo(output);

     }

@@ -6934,7 +6934,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasA) {

         output.WriteInt32(1, "a", A);

@@ -8175,13 +8175,13 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasOptionalMessage) {

         output.WriteMessage(1, "optional_message", OptionalMessage);

       }

       if (repeatedMessage_.Count > 0) {

-        output.WriteMessageArray(2, "repeated_message", repeatedMessage_);

+        output.WriteArray(pbd::FieldType.Message, 2, "repeated_message", repeatedMessage_);

       }

       if (HasDummy) {

         output.WriteInt32(3, "dummy", Dummy);

@@ -8504,7 +8504,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasForeignNested) {

         output.WriteMessage(1, "foreign_nested", ForeignNested);

@@ -8738,7 +8738,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       UnknownFields.WriteTo(output);

     }

@@ -8919,7 +8919,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       pb::ExtendableMessage<TestEmptyMessageWithExtensions, TestEmptyMessageWithExtensions.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);

       extensionWriter.WriteUntil(536870912, output);

@@ -9104,7 +9104,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       pb::ExtendableMessage<TestMultipleExtensionRanges, TestMultipleExtensionRanges.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);

       extensionWriter.WriteUntil(43, output);

@@ -9310,7 +9310,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasA) {

         output.WriteInt32(1, "a", A);

@@ -9572,7 +9572,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasA) {

         output.WriteMessage(1, "a", A);

@@ -9847,7 +9847,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasBb) {

         output.WriteMessage(1, "bb", Bb);

@@ -10101,7 +10101,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasA) {

         output.WriteMessage(1, "a", A);

@@ -10406,7 +10406,7 @@
           }

         }

         

-        public override void WriteTo(pb::CodedOutputStream output) {

+        public override void WriteTo(pb::ICodedOutputStream output) {

           int size = SerializedSize;

           if (HasA) {

             output.WriteInt32(1, "a", A);

@@ -10627,7 +10627,7 @@
           }

         }

         

-        public override void WriteTo(pb::CodedOutputStream output) {

+        public override void WriteTo(pb::ICodedOutputStream output) {

           int size = SerializedSize;

           if (HasA) {

             output.WriteInt32(1, "a", A);

@@ -10846,7 +10846,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasA) {

         output.WriteInt32(1, "a", A);

@@ -11219,13 +11219,13 @@
           }

         }

         

-        public override void WriteTo(pb::CodedOutputStream output) {

+        public override void WriteTo(pb::ICodedOutputStream output) {

           int size = SerializedSize;

           if (nestedmessageRepeatedInt32_.Count > 0) {

             output.WriteArray(pbd::FieldType.Int32, 1, "nestedmessage_repeated_int32", nestedmessageRepeatedInt32_);

           }

           if (nestedmessageRepeatedForeignmessage_.Count > 0) {

-            output.WriteMessageArray(2, "nestedmessage_repeated_foreignmessage", nestedmessageRepeatedForeignmessage_);

+            output.WriteArray(pbd::FieldType.Message, 2, "nestedmessage_repeated_foreignmessage", nestedmessageRepeatedForeignmessage_);

           }

           UnknownFields.WriteTo(output);

         }

@@ -11486,7 +11486,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasOptionalNestedMessage) {

         output.WriteMessage(1, "optional_nested_message", OptionalNestedMessage);

@@ -11852,7 +11852,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasPrimitiveField) {

         output.WriteInt32(1, "PrimitiveField", PrimitiveField);

@@ -11882,7 +11882,7 @@
         output.WriteArray(pbd::FieldType.Enum, 9, "RepeatedEnumField", repeatedEnumField_);

       }

       if (repeatedMessageField_.Count > 0) {

-        output.WriteMessageArray(10, "RepeatedMessageField", repeatedMessageField_);

+        output.WriteArray(pbd::FieldType.Message, 10, "RepeatedMessageField", repeatedMessageField_);

       }

       if (repeatedStringPieceField_.Count > 0) {

         output.WriteArray(pbd::FieldType.String, 11, "RepeatedStringPieceField", repeatedStringPieceField_);

@@ -12578,7 +12578,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       pb::ExtendableMessage<TestFieldOrderings, TestFieldOrderings.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);

       if (HasMyInt) {

@@ -13049,7 +13049,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasEscapedBytes) {

         output.WriteBytes(1, "escaped_bytes", EscapedBytes);

@@ -13834,7 +13834,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasData) {

         output.WriteString(1, "data", Data);

@@ -14056,7 +14056,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasData) {

         output.WriteBytes(1, "data", Data);

@@ -14458,7 +14458,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (packedInt32_.Count > 0) {

         output.WritePackedArray(pbd::FieldType.Int32, 90, "packed_int32", packedInt32MemoizedSerializedSize, packedInt32_);

@@ -15571,7 +15571,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (unpackedInt32_.Count > 0) {

         output.WriteArray(pbd::FieldType.Int32, 90, "unpacked_int32", unpackedInt32_);

@@ -16398,7 +16398,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       pb::ExtendableMessage<TestPackedExtensions, TestPackedExtensions.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);

       extensionWriter.WriteUntil(536870912, output);

@@ -16630,7 +16630,7 @@
           }

         }

         

-        public override void WriteTo(pb::CodedOutputStream output) {

+        public override void WriteTo(pb::ICodedOutputStream output) {

           int size = SerializedSize;

           if (HasDynamicField) {

             output.WriteInt32(2100, "dynamic_field", DynamicField);

@@ -16895,7 +16895,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasScalarExtension) {

         output.WriteFixed32(2000, "scalar_extension", ScalarExtension);

@@ -17472,7 +17472,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (repeatedFixed32_.Count > 0) {

         output.WriteArray(pbd::FieldType.Fixed32, 12, "repeated_fixed32", repeatedFixed32_);

@@ -17931,7 +17931,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       UnknownFields.WriteTo(output);

     }

@@ -18111,7 +18111,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       UnknownFields.WriteTo(output);

     }

@@ -18291,7 +18291,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       UnknownFields.WriteTo(output);

     }

@@ -18471,7 +18471,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       UnknownFields.WriteTo(output);

     }

diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs
index 11a8637..08ac8a6 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs
@@ -120,7 +120,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (criteria_.Count > 0) {

         output.WriteArray(pbd::FieldType.String, 1, "Criteria", criteria_);

@@ -398,7 +398,7 @@
           }

         }

         

-        public override void WriteTo(pb::CodedOutputStream output) {

+        public override void WriteTo(pb::ICodedOutputStream output) {

           int size = SerializedSize;

           if (HasUrl) {

             output.WriteString(1, "url", Url);

@@ -635,10 +635,10 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (results_.Count > 0) {

-        output.WriteMessageArray(1, "results", results_);

+        output.WriteArray(pbd::FieldType.Message, 1, "results", results_);

       }

       UnknownFields.WriteTo(output);

     }

@@ -893,7 +893,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (criteria_.Count > 0) {

         output.WriteArray(pbd::FieldType.String, 1, "Criteria", criteria_);

diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs
index 9119fdb..2c38333 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs
@@ -177,7 +177,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (options_.Count > 0) {

         output.WriteArray(pbd::FieldType.Enum, 3, "options", options_);

@@ -444,7 +444,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       UnknownFields.WriteTo(output);

     }

@@ -676,7 +676,7 @@
           }

         }

         

-        public override void WriteTo(pb::CodedOutputStream output) {

+        public override void WriteTo(pb::ICodedOutputStream output) {

           int size = SerializedSize;

           if (options_.Count > 0) {

             output.WriteArray(pbd::FieldType.Enum, 3, "options", options_);

@@ -998,7 +998,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       pb::ExtendableMessage<TestXmlMessage, TestXmlMessage.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);

       if (HasChild) {

@@ -1018,7 +1018,7 @@
       }

       extensionWriter.WriteUntil(200, output);

       if (children_.Count > 0) {

-        output.WriteGroupArray(401, "children", children_);

+        output.WriteArray(pbd::FieldType.Group, 401, "children", children_);

       }

       if (textlines_.Count > 0) {

         output.WriteArray(pbd::FieldType.String, 700, "textlines", textlines_);

@@ -1487,7 +1487,7 @@
       }

     }

     

-    public override void WriteTo(pb::CodedOutputStream output) {

+    public override void WriteTo(pb::ICodedOutputStream output) {

       int size = SerializedSize;

       if (HasNumber) {

         output.WriteInt32(1, "number", Number);