Refactoring the ICoded interfaces (again) removing the use of some generic methods.
diff --git a/src/AddressBook/AddressBookProtos.cs b/src/AddressBook/AddressBookProtos.cs
index dcaad48..8af5da1 100644
--- a/src/AddressBook/AddressBookProtos.cs
+++ b/src/AddressBook/AddressBookProtos.cs
@@ -461,7 +461,7 @@
         output.WriteString(3, field_names[0], Email);

       }

       if (phone_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 4, field_names[3], phone_);

+        output.WriteMessageArray(4, field_names[3], phone_);

       }

       UnknownFields.WriteTo(output);

     }

@@ -812,7 +812,7 @@
       int size = SerializedSize;

       string[] field_names = _addressBookFieldNames;

       if (person_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 1, field_names[0], person_);

+        output.WriteMessageArray(1, field_names[0], person_);

       }

       UnknownFields.WriteTo(output);

     }

diff --git a/src/ProtoBench/Program.cs b/src/ProtoBench/Program.cs
index e5d98df..9de071f 100644
--- a/src/ProtoBench/Program.cs
+++ b/src/ProtoBench/Program.cs
@@ -72,6 +72,7 @@
             if (temp.Remove("/v2") || temp.Remove("-v2"))

             {

                 Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.RealTime;

+                Process.GetCurrentProcess().ProcessorAffinity = new IntPtr(1);

                 RunBenchmark = BenchmarkV2;

             }

             if (temp.Remove("/all") || temp.Remove("-all"))

diff --git a/src/ProtoGen/RepeatedEnumFieldGenerator.cs b/src/ProtoGen/RepeatedEnumFieldGenerator.cs
index c84d102..b8f4a7d 100644
--- a/src/ProtoGen/RepeatedEnumFieldGenerator.cs
+++ b/src/ProtoGen/RepeatedEnumFieldGenerator.cs
@@ -132,9 +132,9 @@
             writer.WriteLine("if ({0}_.Count > 0) {{", Name);

             writer.Indent();

             if (Descriptor.IsPacked)

-                writer.WriteLine("output.WritePackedArray(pbd::FieldType.{3}, {0}, field_names[{2}], {1}MemoizedSerializedSize, {1}_);", Number, Name, FieldOrdinal, Descriptor.FieldType);

+                writer.WriteLine("output.WritePackedEnumArray({0}, field_names[{2}], {1}MemoizedSerializedSize, {1}_);", Number, Name, FieldOrdinal, Descriptor.FieldType);

             else

-                writer.WriteLine("output.WriteArray(pbd::FieldType.{3}, {0}, field_names[{2}], {1}_);", Number, Name, FieldOrdinal, Descriptor.FieldType);

+                writer.WriteLine("output.WriteEnumArray({0}, field_names[{2}], {1}_);", Number, Name, FieldOrdinal, Descriptor.FieldType);

             writer.Outdent();

             writer.WriteLine("}");

         }

diff --git a/src/ProtoGen/RepeatedMessageFieldGenerator.cs b/src/ProtoGen/RepeatedMessageFieldGenerator.cs
index 0708cd6..0f13ccc 100644
--- a/src/ProtoGen/RepeatedMessageFieldGenerator.cs
+++ b/src/ProtoGen/RepeatedMessageFieldGenerator.cs
@@ -129,7 +129,7 @@
         {

             writer.WriteLine("if ({0}_.Count > 0) {{", Name);

             writer.Indent();

-            writer.WriteLine("output.WriteArray(pbd::FieldType.{3}, {0}, field_names[{2}], {1}_);", Number, Name, FieldOrdinal, Descriptor.FieldType);

+            writer.WriteLine("output.Write{0}Array({1}, field_names[{3}], {2}_);", MessageOrGroup, Number, Name, FieldOrdinal, Descriptor.FieldType);

             writer.Outdent();

             writer.WriteLine("}");

         }

diff --git a/src/ProtoGen/RepeatedPrimitiveFieldGenerator.cs b/src/ProtoGen/RepeatedPrimitiveFieldGenerator.cs
index 535645d..50c1485 100644
--- a/src/ProtoGen/RepeatedPrimitiveFieldGenerator.cs
+++ b/src/ProtoGen/RepeatedPrimitiveFieldGenerator.cs
@@ -121,7 +121,7 @@
 

         public void GenerateParsingCode(TextGenerator writer)

         {

-            writer.WriteLine("input.ReadPrimitiveArray(pbd::FieldType.{1}, tag, field_name, result.{0}_);", Name, Descriptor.FieldType);

+            writer.WriteLine("input.Read{0}Array(tag, field_name, result.{1}_);", CapitalizedTypeName, Name, Descriptor.FieldType);

         }

 

         public void GenerateSerializationCode(TextGenerator writer)

@@ -129,9 +129,9 @@
             writer.WriteLine("if ({0}_.Count > 0) {{", Name);

             writer.Indent();

             if (Descriptor.IsPacked)

-                writer.WriteLine("output.WritePackedArray(pbd::FieldType.{3}, {0}, field_names[{2}], {1}MemoizedSerializedSize, {1}_);", Number, Name, FieldOrdinal, Descriptor.FieldType);

+                writer.WriteLine("output.WritePacked{0}Array({1}, field_names[{3}], {2}MemoizedSerializedSize, {2}_);", CapitalizedTypeName, Number, Name, FieldOrdinal, Descriptor.FieldType);

             else

-                writer.WriteLine("output.WriteArray(pbd::FieldType.{3}, {0}, field_names[{2}], {1}_);", Number, Name, FieldOrdinal, Descriptor.FieldType);

+                writer.WriteLine("output.Write{0}Array({1}, field_names[{3}], {2}_);", CapitalizedTypeName, Number, Name, FieldOrdinal, Descriptor.FieldType);

             writer.Outdent();

             writer.WriteLine("}");

         }

diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs
index 4cf74c9..c8ea755 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs
@@ -126,7 +126,7 @@
         output.WriteMessage(1, field_names[0], OptionalMessage);

       }

       if (repeatedMessage_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 2, field_names[1], repeatedMessage_);

+        output.WriteMessageArray(2, field_names[1], repeatedMessage_);

       }

       UnknownFields.WriteTo(output);

     }

diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs
index 7d4a65b..a4fbde3 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs
@@ -597,7 +597,7 @@
         output.WriteString(4, field_names[29], Field4);

       }

       if (field5_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Fixed64, 5, field_names[30], field5_);

+        output.WriteFixed64Array(5, field_names[30], field5_);

       }

       if (hasField6) {

         output.WriteInt32(6, field_names[32], Field6);

@@ -1122,7 +1122,7 @@
             }

             case 42:

             case 41: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed64, tag, field_name, result.field5_);

+              input.ReadFixed64Array(tag, field_name, result.field5_);

               break;

             }

             case 48: {

@@ -3348,7 +3348,7 @@
             output.WriteString(13, field_names[2], Field13);

           }

           if (field14_.Count > 0) {

-            output.WriteArray(pbd::FieldType.String, 14, field_names[3], field14_);

+            output.WriteStringArray(14, field_names[3], field14_);

           }

           if (hasField15) {

             output.WriteUInt64(15, field_names[4], Field15);

@@ -3360,7 +3360,7 @@
             output.WriteInt32(20, field_names[6], Field20);

           }

           if (field22_.Count > 0) {

-            output.WriteArray(pbd::FieldType.String, 22, field_names[7], field22_);

+            output.WriteStringArray(22, field_names[7], field22_);

           }

           if (hasField24) {

             output.WriteString(24, field_names[8], Field24);

@@ -3381,7 +3381,7 @@
             output.WriteMessage(31, field_names[13], Field31);

           }

           if (field73_.Count > 0) {

-            output.WriteArray(pbd::FieldType.Int32, 73, field_names[15], field73_);

+            output.WriteInt32Array(73, field_names[15], field73_);

           }

           UnknownFields.WriteTo(output);

         }

@@ -3661,7 +3661,7 @@
                   break;

                 }

                 case 114: {

-                  input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.field14_);

+                  input.ReadStringArray(tag, field_name, result.field14_);

                   break;

                 }

                 case 120: {

@@ -3677,7 +3677,7 @@
                   break;

                 }

                 case 178: {

-                  input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.field22_);

+                  input.ReadStringArray(tag, field_name, result.field22_);

                   break;

                 }

                 case 194: {

@@ -3711,7 +3711,7 @@
                 }

                 case 586:

                 case 584: {

-                  input.ReadPrimitiveArray(pbd::FieldType.Int32, tag, field_name, result.field73_);

+                  input.ReadInt32Array(tag, field_name, result.field73_);

                   break;

                 }

               }

@@ -4407,7 +4407,7 @@
         output.WriteString(6, field_names[25], Field6);

       }

       if (group1_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Group, 10, field_names[29], group1_);

+        output.WriteGroupArray(10, field_names[29], group1_);

       }

       if (hasField21) {

         output.WriteInt32(21, field_names[10], Field21);

@@ -4431,16 +4431,16 @@
         output.WriteInt32(109, field_names[1], Field109);

       }

       if (field127_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 127, field_names[2], field127_);

+        output.WriteStringArray(127, field_names[2], field127_);

       }

       if (field128_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 128, field_names[3], field128_);

+        output.WriteStringArray(128, field_names[3], field128_);

       }

       if (hasField129) {

         output.WriteInt32(129, field_names[4], Field129);

       }

       if (field130_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int64, 130, field_names[5], field130_);

+        output.WriteInt64Array(130, field_names[5], field130_);

       }

       if (hasField131) {

         output.WriteInt64(131, field_names[6], Field131);

@@ -4880,11 +4880,11 @@
               break;

             }

             case 1018: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.field127_);

+              input.ReadStringArray(tag, field_name, result.field127_);

               break;

             }

             case 1026: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.field128_);

+              input.ReadStringArray(tag, field_name, result.field128_);

               break;

             }

             case 1032: {

@@ -4893,7 +4893,7 @@
             }

             case 1042:

             case 1040: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int64, tag, field_name, result.field130_);

+              input.ReadInt64Array(tag, field_name, result.field130_);

               break;

             }

             case 1048: {

diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs
index ec1670f..e875b6f 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs
@@ -1385,7 +1385,7 @@
       int size = SerializedSize;

       string[] field_names = _rawMessageSetFieldNames;

       if (item_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Group, 1, field_names[0], item_);

+        output.WriteGroupArray(1, field_names[0], item_);

       }

       UnknownFields.WriteTo(output);

     }

diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
index a3294ca..67fd4cc 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
@@ -2702,76 +2702,76 @@
         output.WriteString(25, field_names[22], OptionalCord);

       }

       if (repeatedInt32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int32, 31, field_names[55], repeatedInt32_);

+        output.WriteInt32Array(31, field_names[55], repeatedInt32_);

       }

       if (repeatedInt64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int64, 32, field_names[56], repeatedInt64_);

+        output.WriteInt64Array(32, field_names[56], repeatedInt64_);

       }

       if (repeatedUint32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.UInt32, 33, field_names[65], repeatedUint32_);

+        output.WriteUInt32Array(33, field_names[65], repeatedUint32_);

       }

       if (repeatedUint64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.UInt64, 34, field_names[66], repeatedUint64_);

+        output.WriteUInt64Array(34, field_names[66], repeatedUint64_);

       }

       if (repeatedSint32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SInt32, 35, field_names[61], repeatedSint32_);

+        output.WriteSInt32Array(35, field_names[61], repeatedSint32_);

       }

       if (repeatedSint64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SInt64, 36, field_names[62], repeatedSint64_);

+        output.WriteSInt64Array(36, field_names[62], repeatedSint64_);

       }

       if (repeatedFixed32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Fixed32, 37, field_names[48], repeatedFixed32_);

+        output.WriteFixed32Array(37, field_names[48], repeatedFixed32_);

       }

       if (repeatedFixed64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Fixed64, 38, field_names[49], repeatedFixed64_);

+        output.WriteFixed64Array(38, field_names[49], repeatedFixed64_);

       }

       if (repeatedSfixed32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SFixed32, 39, field_names[59], repeatedSfixed32_);

+        output.WriteSFixed32Array(39, field_names[59], repeatedSfixed32_);

       }

       if (repeatedSfixed64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SFixed64, 40, field_names[60], repeatedSfixed64_);

+        output.WriteSFixed64Array(40, field_names[60], repeatedSfixed64_);

       }

       if (repeatedFloat_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Float, 41, field_names[50], repeatedFloat_);

+        output.WriteFloatArray(41, field_names[50], repeatedFloat_);

       }

       if (repeatedDouble_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Double, 42, field_names[47], repeatedDouble_);

+        output.WriteDoubleArray(42, field_names[47], repeatedDouble_);

       }

       if (repeatedBool_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Bool, 43, field_names[44], repeatedBool_);

+        output.WriteBoolArray(43, field_names[44], repeatedBool_);

       }

       if (repeatedString_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 44, field_names[63], repeatedString_);

+        output.WriteStringArray(44, field_names[63], repeatedString_);

       }

       if (repeatedBytes_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Bytes, 45, field_names[45], repeatedBytes_);

+        output.WriteBytesArray(45, field_names[45], repeatedBytes_);

       }

       if (repeatedGroup_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Group, 46, field_names[67], repeatedGroup_);

+        output.WriteGroupArray(46, field_names[67], repeatedGroup_);

       }

       if (repeatedNestedMessage_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 48, field_names[58], repeatedNestedMessage_);

+        output.WriteMessageArray(48, field_names[58], repeatedNestedMessage_);

       }

       if (repeatedForeignMessage_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 49, field_names[52], repeatedForeignMessage_);

+        output.WriteMessageArray(49, field_names[52], repeatedForeignMessage_);

       }

       if (repeatedImportMessage_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 50, field_names[54], repeatedImportMessage_);

+        output.WriteMessageArray(50, field_names[54], repeatedImportMessage_);

       }

       if (repeatedNestedEnum_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Enum, 51, field_names[57], repeatedNestedEnum_);

+        output.WriteEnumArray(51, field_names[57], repeatedNestedEnum_);

       }

       if (repeatedForeignEnum_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Enum, 52, field_names[51], repeatedForeignEnum_);

+        output.WriteEnumArray(52, field_names[51], repeatedForeignEnum_);

       }

       if (repeatedImportEnum_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Enum, 53, field_names[53], repeatedImportEnum_);

+        output.WriteEnumArray(53, field_names[53], repeatedImportEnum_);

       }

       if (repeatedStringPiece_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 54, field_names[64], repeatedStringPiece_);

+        output.WriteStringArray(54, field_names[64], repeatedStringPiece_);

       }

       if (repeatedCord_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 55, field_names[46], repeatedCord_);

+        output.WriteStringArray(55, field_names[46], repeatedCord_);

       }

       if (hasDefaultInt32) {

         output.WriteInt32(61, field_names[9], DefaultInt32);

@@ -3646,75 +3646,75 @@
             }

             case 250:

             case 248: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int32, tag, field_name, result.repeatedInt32_);

+              input.ReadInt32Array(tag, field_name, result.repeatedInt32_);

               break;

             }

             case 258:

             case 256: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int64, tag, field_name, result.repeatedInt64_);

+              input.ReadInt64Array(tag, field_name, result.repeatedInt64_);

               break;

             }

             case 266:

             case 264: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt32, tag, field_name, result.repeatedUint32_);

+              input.ReadUInt32Array(tag, field_name, result.repeatedUint32_);

               break;

             }

             case 274:

             case 272: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt64, tag, field_name, result.repeatedUint64_);

+              input.ReadUInt64Array(tag, field_name, result.repeatedUint64_);

               break;

             }

             case 282:

             case 280: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt32, tag, field_name, result.repeatedSint32_);

+              input.ReadSInt32Array(tag, field_name, result.repeatedSint32_);

               break;

             }

             case 290:

             case 288: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt64, tag, field_name, result.repeatedSint64_);

+              input.ReadSInt64Array(tag, field_name, result.repeatedSint64_);

               break;

             }

             case 298:

             case 301: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed32, tag, field_name, result.repeatedFixed32_);

+              input.ReadFixed32Array(tag, field_name, result.repeatedFixed32_);

               break;

             }

             case 306:

             case 305: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed64, tag, field_name, result.repeatedFixed64_);

+              input.ReadFixed64Array(tag, field_name, result.repeatedFixed64_);

               break;

             }

             case 314:

             case 317: {

-              input.ReadPrimitiveArray(pbd::FieldType.SFixed32, tag, field_name, result.repeatedSfixed32_);

+              input.ReadSFixed32Array(tag, field_name, result.repeatedSfixed32_);

               break;

             }

             case 322:

             case 321: {

-              input.ReadPrimitiveArray(pbd::FieldType.SFixed64, tag, field_name, result.repeatedSfixed64_);

+              input.ReadSFixed64Array(tag, field_name, result.repeatedSfixed64_);

               break;

             }

             case 330:

             case 333: {

-              input.ReadPrimitiveArray(pbd::FieldType.Float, tag, field_name, result.repeatedFloat_);

+              input.ReadFloatArray(tag, field_name, result.repeatedFloat_);

               break;

             }

             case 338:

             case 337: {

-              input.ReadPrimitiveArray(pbd::FieldType.Double, tag, field_name, result.repeatedDouble_);

+              input.ReadDoubleArray(tag, field_name, result.repeatedDouble_);

               break;

             }

             case 346:

             case 344: {

-              input.ReadPrimitiveArray(pbd::FieldType.Bool, tag, field_name, result.repeatedBool_);

+              input.ReadBoolArray(tag, field_name, result.repeatedBool_);

               break;

             }

             case 354: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.repeatedString_);

+              input.ReadStringArray(tag, field_name, result.repeatedString_);

               break;

             }

             case 362: {

-              input.ReadPrimitiveArray(pbd::FieldType.Bytes, tag, field_name, result.repeatedBytes_);

+              input.ReadBytesArray(tag, field_name, result.repeatedBytes_);

               break;

             }

             case 371: {

@@ -3776,11 +3776,11 @@
               break;

             }

             case 434: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.repeatedStringPiece_);

+              input.ReadStringArray(tag, field_name, result.repeatedStringPiece_);

               break;

             }

             case 442: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.repeatedCord_);

+              input.ReadStringArray(tag, field_name, result.repeatedCord_);

               break;

             }

             case 488: {

@@ -8485,7 +8485,7 @@
         output.WriteMessage(1, field_names[1], OptionalMessage);

       }

       if (repeatedMessage_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 2, field_names[2], repeatedMessage_);

+        output.WriteMessageArray(2, field_names[2], repeatedMessage_);

       }

       if (hasDummy) {

         output.WriteInt32(3, field_names[0], Dummy);

@@ -11742,10 +11742,10 @@
           int size = SerializedSize;

           string[] field_names = _nestedMessageFieldNames;

           if (nestedmessageRepeatedInt32_.Count > 0) {

-            output.WriteArray(pbd::FieldType.Int32, 1, field_names[1], nestedmessageRepeatedInt32_);

+            output.WriteInt32Array(1, field_names[1], nestedmessageRepeatedInt32_);

           }

           if (nestedmessageRepeatedForeignmessage_.Count > 0) {

-            output.WriteArray(pbd::FieldType.Message, 2, field_names[0], nestedmessageRepeatedForeignmessage_);

+            output.WriteMessageArray(2, field_names[0], nestedmessageRepeatedForeignmessage_);

           }

           UnknownFields.WriteTo(output);

         }

@@ -11915,7 +11915,7 @@
                 }

                 case 10:

                 case 8: {

-                  input.ReadPrimitiveArray(pbd::FieldType.Int32, tag, field_name, result.nestedmessageRepeatedInt32_);

+                  input.ReadInt32Array(tag, field_name, result.nestedmessageRepeatedInt32_);

                   break;

                 }

                 case 18: {

@@ -12426,22 +12426,22 @@
         output.WriteString(6, field_names[0], CordField);

       }

       if (repeatedPrimitiveField_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int32, 7, field_names[7], repeatedPrimitiveField_);

+        output.WriteInt32Array(7, field_names[7], repeatedPrimitiveField_);

       }

       if (repeatedStringField_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 8, field_names[8], repeatedStringField_);

+        output.WriteStringArray(8, field_names[8], repeatedStringField_);

       }

       if (repeatedEnumField_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Enum, 9, field_names[5], repeatedEnumField_);

+        output.WriteEnumArray(9, field_names[5], repeatedEnumField_);

       }

       if (repeatedMessageField_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 10, field_names[6], repeatedMessageField_);

+        output.WriteMessageArray(10, field_names[6], repeatedMessageField_);

       }

       if (repeatedStringPieceField_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 11, field_names[9], repeatedStringPieceField_);

+        output.WriteStringArray(11, field_names[9], repeatedStringPieceField_);

       }

       if (repeatedCordField_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 12, field_names[4], repeatedCordField_);

+        output.WriteStringArray(12, field_names[4], repeatedCordField_);

       }

       UnknownFields.WriteTo(output);

     }

@@ -12734,11 +12734,11 @@
             }

             case 58:

             case 56: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int32, tag, field_name, result.repeatedPrimitiveField_);

+              input.ReadInt32Array(tag, field_name, result.repeatedPrimitiveField_);

               break;

             }

             case 66: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.repeatedStringField_);

+              input.ReadStringArray(tag, field_name, result.repeatedStringField_);

               break;

             }

             case 74:

@@ -12760,11 +12760,11 @@
               break;

             }

             case 90: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.repeatedStringPieceField_);

+              input.ReadStringArray(tag, field_name, result.repeatedStringPieceField_);

               break;

             }

             case 98: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.repeatedCordField_);

+              input.ReadStringArray(tag, field_name, result.repeatedCordField_);

               break;

             }

           }

@@ -15105,46 +15105,46 @@
       int size = SerializedSize;

       string[] field_names = _testPackedTypesFieldNames;

       if (packedInt32_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Int32, 90, field_names[6], packedInt32MemoizedSerializedSize, packedInt32_);

+        output.WritePackedInt32Array(90, field_names[6], packedInt32MemoizedSerializedSize, packedInt32_);

       }

       if (packedInt64_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Int64, 91, field_names[7], packedInt64MemoizedSerializedSize, packedInt64_);

+        output.WritePackedInt64Array(91, field_names[7], packedInt64MemoizedSerializedSize, packedInt64_);

       }

       if (packedUint32_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.UInt32, 92, field_names[12], packedUint32MemoizedSerializedSize, packedUint32_);

+        output.WritePackedUInt32Array(92, field_names[12], packedUint32MemoizedSerializedSize, packedUint32_);

       }

       if (packedUint64_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.UInt64, 93, field_names[13], packedUint64MemoizedSerializedSize, packedUint64_);

+        output.WritePackedUInt64Array(93, field_names[13], packedUint64MemoizedSerializedSize, packedUint64_);

       }

       if (packedSint32_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.SInt32, 94, field_names[10], packedSint32MemoizedSerializedSize, packedSint32_);

+        output.WritePackedSInt32Array(94, field_names[10], packedSint32MemoizedSerializedSize, packedSint32_);

       }

       if (packedSint64_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.SInt64, 95, field_names[11], packedSint64MemoizedSerializedSize, packedSint64_);

+        output.WritePackedSInt64Array(95, field_names[11], packedSint64MemoizedSerializedSize, packedSint64_);

       }

       if (packedFixed32_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Fixed32, 96, field_names[3], packedFixed32MemoizedSerializedSize, packedFixed32_);

+        output.WritePackedFixed32Array(96, field_names[3], packedFixed32MemoizedSerializedSize, packedFixed32_);

       }

       if (packedFixed64_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Fixed64, 97, field_names[4], packedFixed64MemoizedSerializedSize, packedFixed64_);

+        output.WritePackedFixed64Array(97, field_names[4], packedFixed64MemoizedSerializedSize, packedFixed64_);

       }

       if (packedSfixed32_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.SFixed32, 98, field_names[8], packedSfixed32MemoizedSerializedSize, packedSfixed32_);

+        output.WritePackedSFixed32Array(98, field_names[8], packedSfixed32MemoizedSerializedSize, packedSfixed32_);

       }

       if (packedSfixed64_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.SFixed64, 99, field_names[9], packedSfixed64MemoizedSerializedSize, packedSfixed64_);

+        output.WritePackedSFixed64Array(99, field_names[9], packedSfixed64MemoizedSerializedSize, packedSfixed64_);

       }

       if (packedFloat_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Float, 100, field_names[5], packedFloatMemoizedSerializedSize, packedFloat_);

+        output.WritePackedFloatArray(100, field_names[5], packedFloatMemoizedSerializedSize, packedFloat_);

       }

       if (packedDouble_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Double, 101, field_names[1], packedDoubleMemoizedSerializedSize, packedDouble_);

+        output.WritePackedDoubleArray(101, field_names[1], packedDoubleMemoizedSerializedSize, packedDouble_);

       }

       if (packedBool_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Bool, 102, field_names[0], packedBoolMemoizedSerializedSize, packedBool_);

+        output.WritePackedBoolArray(102, field_names[0], packedBoolMemoizedSerializedSize, packedBool_);

       }

       if (packedEnum_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Enum, 103, field_names[2], packedEnumMemoizedSerializedSize, packedEnum_);

+        output.WritePackedEnumArray(103, field_names[2], packedEnumMemoizedSerializedSize, packedEnum_);

       }

       UnknownFields.WriteTo(output);

     }

@@ -15492,67 +15492,67 @@
             }

             case 722:

             case 720: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int32, tag, field_name, result.packedInt32_);

+              input.ReadInt32Array(tag, field_name, result.packedInt32_);

               break;

             }

             case 730:

             case 728: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int64, tag, field_name, result.packedInt64_);

+              input.ReadInt64Array(tag, field_name, result.packedInt64_);

               break;

             }

             case 738:

             case 736: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt32, tag, field_name, result.packedUint32_);

+              input.ReadUInt32Array(tag, field_name, result.packedUint32_);

               break;

             }

             case 746:

             case 744: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt64, tag, field_name, result.packedUint64_);

+              input.ReadUInt64Array(tag, field_name, result.packedUint64_);

               break;

             }

             case 754:

             case 752: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt32, tag, field_name, result.packedSint32_);

+              input.ReadSInt32Array(tag, field_name, result.packedSint32_);

               break;

             }

             case 762:

             case 760: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt64, tag, field_name, result.packedSint64_);

+              input.ReadSInt64Array(tag, field_name, result.packedSint64_);

               break;

             }

             case 770:

             case 773: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed32, tag, field_name, result.packedFixed32_);

+              input.ReadFixed32Array(tag, field_name, result.packedFixed32_);

               break;

             }

             case 778:

             case 777: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed64, tag, field_name, result.packedFixed64_);

+              input.ReadFixed64Array(tag, field_name, result.packedFixed64_);

               break;

             }

             case 786:

             case 789: {

-              input.ReadPrimitiveArray(pbd::FieldType.SFixed32, tag, field_name, result.packedSfixed32_);

+              input.ReadSFixed32Array(tag, field_name, result.packedSfixed32_);

               break;

             }

             case 794:

             case 793: {

-              input.ReadPrimitiveArray(pbd::FieldType.SFixed64, tag, field_name, result.packedSfixed64_);

+              input.ReadSFixed64Array(tag, field_name, result.packedSfixed64_);

               break;

             }

             case 802:

             case 805: {

-              input.ReadPrimitiveArray(pbd::FieldType.Float, tag, field_name, result.packedFloat_);

+              input.ReadFloatArray(tag, field_name, result.packedFloat_);

               break;

             }

             case 810:

             case 809: {

-              input.ReadPrimitiveArray(pbd::FieldType.Double, tag, field_name, result.packedDouble_);

+              input.ReadDoubleArray(tag, field_name, result.packedDouble_);

               break;

             }

             case 818:

             case 816: {

-              input.ReadPrimitiveArray(pbd::FieldType.Bool, tag, field_name, result.packedBool_);

+              input.ReadBoolArray(tag, field_name, result.packedBool_);

               break;

             }

             case 826:

@@ -16181,46 +16181,46 @@
       int size = SerializedSize;

       string[] field_names = _testUnpackedTypesFieldNames;

       if (unpackedInt32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int32, 90, field_names[6], unpackedInt32_);

+        output.WriteInt32Array(90, field_names[6], unpackedInt32_);

       }

       if (unpackedInt64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int64, 91, field_names[7], unpackedInt64_);

+        output.WriteInt64Array(91, field_names[7], unpackedInt64_);

       }

       if (unpackedUint32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.UInt32, 92, field_names[12], unpackedUint32_);

+        output.WriteUInt32Array(92, field_names[12], unpackedUint32_);

       }

       if (unpackedUint64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.UInt64, 93, field_names[13], unpackedUint64_);

+        output.WriteUInt64Array(93, field_names[13], unpackedUint64_);

       }

       if (unpackedSint32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SInt32, 94, field_names[10], unpackedSint32_);

+        output.WriteSInt32Array(94, field_names[10], unpackedSint32_);

       }

       if (unpackedSint64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SInt64, 95, field_names[11], unpackedSint64_);

+        output.WriteSInt64Array(95, field_names[11], unpackedSint64_);

       }

       if (unpackedFixed32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Fixed32, 96, field_names[3], unpackedFixed32_);

+        output.WriteFixed32Array(96, field_names[3], unpackedFixed32_);

       }

       if (unpackedFixed64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Fixed64, 97, field_names[4], unpackedFixed64_);

+        output.WriteFixed64Array(97, field_names[4], unpackedFixed64_);

       }

       if (unpackedSfixed32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SFixed32, 98, field_names[8], unpackedSfixed32_);

+        output.WriteSFixed32Array(98, field_names[8], unpackedSfixed32_);

       }

       if (unpackedSfixed64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SFixed64, 99, field_names[9], unpackedSfixed64_);

+        output.WriteSFixed64Array(99, field_names[9], unpackedSfixed64_);

       }

       if (unpackedFloat_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Float, 100, field_names[5], unpackedFloat_);

+        output.WriteFloatArray(100, field_names[5], unpackedFloat_);

       }

       if (unpackedDouble_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Double, 101, field_names[1], unpackedDouble_);

+        output.WriteDoubleArray(101, field_names[1], unpackedDouble_);

       }

       if (unpackedBool_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Bool, 102, field_names[0], unpackedBool_);

+        output.WriteBoolArray(102, field_names[0], unpackedBool_);

       }

       if (unpackedEnum_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Enum, 103, field_names[2], unpackedEnum_);

+        output.WriteEnumArray(103, field_names[2], unpackedEnum_);

       }

       UnknownFields.WriteTo(output);

     }

@@ -16527,67 +16527,67 @@
             }

             case 722:

             case 720: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int32, tag, field_name, result.unpackedInt32_);

+              input.ReadInt32Array(tag, field_name, result.unpackedInt32_);

               break;

             }

             case 730:

             case 728: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int64, tag, field_name, result.unpackedInt64_);

+              input.ReadInt64Array(tag, field_name, result.unpackedInt64_);

               break;

             }

             case 738:

             case 736: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt32, tag, field_name, result.unpackedUint32_);

+              input.ReadUInt32Array(tag, field_name, result.unpackedUint32_);

               break;

             }

             case 746:

             case 744: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt64, tag, field_name, result.unpackedUint64_);

+              input.ReadUInt64Array(tag, field_name, result.unpackedUint64_);

               break;

             }

             case 754:

             case 752: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt32, tag, field_name, result.unpackedSint32_);

+              input.ReadSInt32Array(tag, field_name, result.unpackedSint32_);

               break;

             }

             case 762:

             case 760: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt64, tag, field_name, result.unpackedSint64_);

+              input.ReadSInt64Array(tag, field_name, result.unpackedSint64_);

               break;

             }

             case 770:

             case 773: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed32, tag, field_name, result.unpackedFixed32_);

+              input.ReadFixed32Array(tag, field_name, result.unpackedFixed32_);

               break;

             }

             case 778:

             case 777: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed64, tag, field_name, result.unpackedFixed64_);

+              input.ReadFixed64Array(tag, field_name, result.unpackedFixed64_);

               break;

             }

             case 786:

             case 789: {

-              input.ReadPrimitiveArray(pbd::FieldType.SFixed32, tag, field_name, result.unpackedSfixed32_);

+              input.ReadSFixed32Array(tag, field_name, result.unpackedSfixed32_);

               break;

             }

             case 794:

             case 793: {

-              input.ReadPrimitiveArray(pbd::FieldType.SFixed64, tag, field_name, result.unpackedSfixed64_);

+              input.ReadSFixed64Array(tag, field_name, result.unpackedSfixed64_);

               break;

             }

             case 802:

             case 805: {

-              input.ReadPrimitiveArray(pbd::FieldType.Float, tag, field_name, result.unpackedFloat_);

+              input.ReadFloatArray(tag, field_name, result.unpackedFloat_);

               break;

             }

             case 810:

             case 809: {

-              input.ReadPrimitiveArray(pbd::FieldType.Double, tag, field_name, result.unpackedDouble_);

+              input.ReadDoubleArray(tag, field_name, result.unpackedDouble_);

               break;

             }

             case 818:

             case 816: {

-              input.ReadPrimitiveArray(pbd::FieldType.Bool, tag, field_name, result.unpackedBool_);

+              input.ReadBoolArray(tag, field_name, result.unpackedBool_);

               break;

             }

             case 826:

@@ -17792,10 +17792,10 @@
         output.WriteMessage(2004, field_names[1], DynamicMessageExtension);

       }

       if (repeatedExtension_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 2005, field_names[5], repeatedExtension_);

+        output.WriteStringArray(2005, field_names[5], repeatedExtension_);

       }

       if (packedExtension_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.SInt32, 2006, field_names[4], packedExtensionMemoizedSerializedSize, packedExtension_);

+        output.WritePackedSInt32Array(2006, field_names[4], packedExtensionMemoizedSerializedSize, packedExtension_);

       }

       UnknownFields.WriteTo(output);

     }

@@ -18048,12 +18048,12 @@
               break;

             }

             case 16042: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.repeatedExtension_);

+              input.ReadStringArray(tag, field_name, result.repeatedExtension_);

               break;

             }

             case 16050:

             case 16048: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt32, tag, field_name, result.packedExtension_);

+              input.ReadSInt32Array(tag, field_name, result.packedExtension_);

               break;

             }

           }

@@ -18368,22 +18368,22 @@
       int size = SerializedSize;

       string[] field_names = _testRepeatedScalarDifferentTagSizesFieldNames;

       if (repeatedFixed32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Fixed32, 12, field_names[0], repeatedFixed32_);

+        output.WriteFixed32Array(12, field_names[0], repeatedFixed32_);

       }

       if (repeatedInt32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int32, 13, field_names[3], repeatedInt32_);

+        output.WriteInt32Array(13, field_names[3], repeatedInt32_);

       }

       if (repeatedFixed64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Fixed64, 2046, field_names[1], repeatedFixed64_);

+        output.WriteFixed64Array(2046, field_names[1], repeatedFixed64_);

       }

       if (repeatedInt64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int64, 2047, field_names[4], repeatedInt64_);

+        output.WriteInt64Array(2047, field_names[4], repeatedInt64_);

       }

       if (repeatedFloat_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Float, 262142, field_names[2], repeatedFloat_);

+        output.WriteFloatArray(262142, field_names[2], repeatedFloat_);

       }

       if (repeatedUint64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.UInt64, 262143, field_names[5], repeatedUint64_);

+        output.WriteUInt64Array(262143, field_names[5], repeatedUint64_);

       }

       UnknownFields.WriteTo(output);

     }

@@ -18600,32 +18600,32 @@
             }

             case 98:

             case 101: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed32, tag, field_name, result.repeatedFixed32_);

+              input.ReadFixed32Array(tag, field_name, result.repeatedFixed32_);

               break;

             }

             case 106:

             case 104: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int32, tag, field_name, result.repeatedInt32_);

+              input.ReadInt32Array(tag, field_name, result.repeatedInt32_);

               break;

             }

             case 16370:

             case 16369: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed64, tag, field_name, result.repeatedFixed64_);

+              input.ReadFixed64Array(tag, field_name, result.repeatedFixed64_);

               break;

             }

             case 16378:

             case 16376: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int64, tag, field_name, result.repeatedInt64_);

+              input.ReadInt64Array(tag, field_name, result.repeatedInt64_);

               break;

             }

             case 2097138:

             case 2097141: {

-              input.ReadPrimitiveArray(pbd::FieldType.Float, tag, field_name, result.repeatedFloat_);

+              input.ReadFloatArray(tag, field_name, result.repeatedFloat_);

               break;

             }

             case 2097146:

             case 2097144: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt64, tag, field_name, result.repeatedUint64_);

+              input.ReadUInt64Array(tag, field_name, result.repeatedUint64_);

               break;

             }

           }

diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs
index 7545d85..f5fa46e 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs
@@ -126,7 +126,7 @@
       int size = SerializedSize;

       string[] field_names = _searchRequestFieldNames;

       if (criteria_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 1, field_names[0], criteria_);

+        output.WriteStringArray(1, field_names[0], criteria_);

       }

       UnknownFields.WriteTo(output);

     }

@@ -288,7 +288,7 @@
               break;

             }

             case 10: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.criteria_);

+              input.ReadStringArray(tag, field_name, result.criteria_);

               break;

             }

           }

@@ -677,7 +677,7 @@
       int size = SerializedSize;

       string[] field_names = _searchResponseFieldNames;

       if (results_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 1, field_names[0], results_);

+        output.WriteMessageArray(1, field_names[0], results_);

       }

       UnknownFields.WriteTo(output);

     }

@@ -951,7 +951,7 @@
       int size = SerializedSize;

       string[] field_names = _refineSearchRequestFieldNames;

       if (criteria_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 1, field_names[0], criteria_);

+        output.WriteStringArray(1, field_names[0], criteria_);

       }

       if (hasPreviousResults) {

         output.WriteMessage(2, field_names[1], PreviousResults);

@@ -1122,7 +1122,7 @@
               break;

             }

             case 10: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.criteria_);

+              input.ReadStringArray(tag, field_name, result.criteria_);

               break;

             }

             case 18: {

diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs
index e6887dc..441ea65 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs
@@ -183,7 +183,7 @@
       int size = SerializedSize;

       string[] field_names = _testXmlChildFieldNames;

       if (options_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Enum, 3, field_names[1], options_);

+        output.WriteEnumArray(3, field_names[1], options_);

       }

       if (hasBinary) {

         output.WriteBytes(4, field_names[0], Binary);

@@ -722,7 +722,7 @@
           int size = SerializedSize;

           string[] field_names = _childrenFieldNames;

           if (options_.Count > 0) {

-            output.WriteArray(pbd::FieldType.Enum, 3, field_names[1], options_);

+            output.WriteEnumArray(3, field_names[1], options_);

           }

           if (hasBinary) {

             output.WriteBytes(4, field_names[0], Binary);

@@ -1066,7 +1066,7 @@
         output.WriteMessage(1, field_names[0], Child);

       }

       if (numbers_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int32, 2, field_names[3], numbers_);

+        output.WriteInt32Array(2, field_names[3], numbers_);

       }

       if (hasText) {

         output.WriteString(3, field_names[4], Text);

@@ -1079,10 +1079,10 @@
       }

       extensionWriter.WriteUntil(200, output);

       if (children_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Group, 401, field_names[1], children_);

+        output.WriteGroupArray(401, field_names[1], children_);

       }

       if (textlines_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 700, field_names[5], textlines_);

+        output.WriteStringArray(700, field_names[5], textlines_);

       }

       UnknownFields.WriteTo(output);

     }

@@ -1299,7 +1299,7 @@
             }

             case 18:

             case 16: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int32, tag, field_name, result.numbers_);

+              input.ReadInt32Array(tag, field_name, result.numbers_);

               break;

             }

             case 26: {

@@ -1319,7 +1319,7 @@
               break;

             }

             case 5602: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.textlines_);

+              input.ReadStringArray(tag, field_name, result.textlines_);

               break;

             }

           }

diff --git a/src/ProtocolBuffers/CodedInputStream.cs b/src/ProtocolBuffers/CodedInputStream.cs
index aad47f9..72f5d2f 100644
--- a/src/ProtocolBuffers/CodedInputStream.cs
+++ b/src/ProtocolBuffers/CodedInputStream.cs
@@ -513,14 +513,39 @@
             return true;

         }

 

+        private bool BeginArray(uint fieldTag, out bool isPacked, out int oldLimit)

+        {

+            isPacked = WireFormat.GetTagWireType(fieldTag) == WireFormat.WireType.LengthDelimited;

+

+            if (isPacked)

+            {

+                int length = (int) (ReadRawVarint32() & int.MaxValue);

+                if (length > 0)

+                {

+                    oldLimit = PushLimit(length);

+                    return true;

+                }

+                oldLimit = -1;

+                return false; //packed but empty

+            }

+

+            oldLimit = -1;

+            return true;

+        }

+

         /// <summary>

         /// Returns true if the next tag is also part of the same unpacked array

         /// </summary>

-        private bool ContinueArray(uint currentTag, bool packed)

+        private bool ContinueArray(uint currentTag, bool packed, int oldLimit)

         {

             if (packed)

             {

-                return !ReachedLimit;

+                if (ReachedLimit)

+                {

+                    PopLimit(oldLimit);

+                    return false;

+                }

+                return true;

             }

 

             string ignore;

@@ -563,239 +588,238 @@
                     if (ReadPrimitiveField(fieldType, ref value))

                         list.Add(value);

                 }

-                while (ContinueArray(fieldTag, false));

+                while (ContinueArray(fieldTag, false, 0));

             }

         }

 

         [CLSCompliant(false)]

-        public void ReadPrimitiveArray<T>(FieldType fieldType, uint fieldTag, string fieldName, ICollection<T> list)

+        public void ReadStringArray(uint fieldTag, string fieldName, ICollection<string> list)

         {

-            WireFormat.WireType normal = WireFormat.GetWireType(fieldType);

-            WireFormat.WireType wformat = WireFormat.GetTagWireType(fieldTag);

-

-            // 2.3 allows packed form even if the field is not declared packed.

-            if (normal != wformat && wformat == WireFormat.WireType.LengthDelimited)

+            string tmp = null;

+            do

             {

-                int length = (int)(ReadRawVarint32() & int.MaxValue);

-                int limit = PushLimit(length);

-                //while (!ReachedLimit)

-                //{

-                //    Object value = null;

-                //    if (ReadPrimitiveField(fieldType, ref value))

-                //        list.Add((T)value);

-                //}

-                if (!ReachedLimit)

-                    ReadPrimitiveArrayItems(fieldType, fieldTag, list, true);

+                ReadString(ref tmp);

+                list.Add(tmp);

+            } while (ContinueArray(fieldTag, false, 0));

+        }

 

-                PopLimit(limit);

+        [CLSCompliant(false)]

+        public void ReadBytesArray(uint fieldTag, string fieldName, ICollection<ByteString> list)

+        {

+            ByteString tmp = null;

+            do

+            {

+                ReadBytes(ref tmp);

+                list.Add(tmp);

             }

-            else

+            while (ContinueArray(fieldTag, false, 0));

+        }

+

+        [CLSCompliant(false)]

+        public void ReadBoolArray(uint fieldTag, string fieldName, ICollection<bool> list)

+        {

+            bool isPacked;

+            int holdLimit;

+            if (BeginArray(fieldTag, out isPacked, out holdLimit))

             {

-                ReadPrimitiveArrayItems(fieldType, fieldTag, list, false);

-                //Object value = null;

-                //do

-                //{

-                //    if (ReadPrimitiveField(fieldType, ref value))

-                //        list.Add((T)value);

-                //}

-                //while (ContinueArray(fieldTag, false));

+                bool tmp = false;

+                do

+                {

+                    ReadBool(ref tmp);

+                    list.Add(tmp);

+                } while (ContinueArray(fieldTag, isPacked, holdLimit));

             }

         }

 

-        void ReadPrimitiveArrayItems<T>(FieldType fieldType, uint fieldTag, ICollection<T> list, bool packed)

+        [CLSCompliant(false)]

+        public void ReadInt32Array(uint fieldTag, string fieldName, ICollection<int> list)

         {

-            switch (fieldType)

+            bool isPacked;

+            int holdLimit;

+            if (BeginArray(fieldTag, out isPacked, out holdLimit))

             {

-                case FieldType.Double:

-                    {

-                        ICollection<double> output = (ICollection<double>)list;

-                        double tmp = 0;

-                        do

-                        {

-                            ReadDouble(ref tmp);

-                            output.Add(tmp);

-                        }

-                        while (ContinueArray(fieldTag, packed));

-                    }

-                    break;

-                case FieldType.Float:

-                    {

-                        ICollection<float> output = (ICollection<float>)list;

-                        float tmp = 0;

-                        do

-                        {

-                            ReadFloat(ref tmp);

-                            output.Add(tmp);

-                        }

-                        while (ContinueArray(fieldTag, packed));

-                    }

-                    break;

-                case FieldType.Int64:

-                    {

-                        ICollection<long> output = (ICollection<long>)list;

-                        long tmp = 0;

-                        do

-                        {

-                            ReadInt64(ref tmp);

-                            output.Add(tmp);

-                        }

-                        while (ContinueArray(fieldTag, packed));

-                    }

-                    break;

-                case FieldType.UInt64:

-                    {

-                        ICollection<ulong> output = (ICollection<ulong>)list;

-                        ulong tmp = 0;

-                        do

-                        {

-                            ReadUInt64(ref tmp);

-                            output.Add(tmp);

-                        }

-                        while (ContinueArray(fieldTag, packed));

-                    }

-                    break;

-                case FieldType.Int32:

-                    {

-                        ICollection<int> output = (ICollection<int>)list;

-                        int tmp = 0;

-                        do

-                        {

-                            ReadInt32(ref tmp);

-                            output.Add(tmp);

-                        }

-                        while (ContinueArray(fieldTag, packed));

-                    }

-                    break;

-                case FieldType.Fixed64:

-                    {

-                        ICollection<ulong> output = (ICollection<ulong>)list;

-                        ulong tmp = 0;

-                        do

-                        {

-                            ReadFixed64(ref tmp);

-                            output.Add(tmp);

-                        }

-                        while (ContinueArray(fieldTag, packed));

-                    }

-                    break;

-                case FieldType.Fixed32:

-                    {

-                        ICollection<uint> output = (ICollection<uint>)list;

-                        uint tmp = 0;

-                        do

-                        {

-                            ReadFixed32(ref tmp);

-                            output.Add(tmp);

-                        }

-                        while (ContinueArray(fieldTag, packed));

-                    }

-                    break;

-                case FieldType.Bool:

-                    {

-                        ICollection<bool> output = (ICollection<bool>)list;

-                        bool tmp = false;

-                        do

-                        {

-                            ReadBool(ref tmp);

-                            output.Add(tmp);

-                        }

-                        while (ContinueArray(fieldTag, packed));

-                    }

-                    break;

-                case FieldType.String:

-                    {

-                        ICollection<string> output = (ICollection<string>)list;

-                        string tmp = null;

-                        do

-                        {

-                            ReadString(ref tmp);

-                            output.Add(tmp);

-                        }

-                        while (ContinueArray(fieldTag, packed));

-                    }

-                    break;

-                case FieldType.Bytes:

-                    {

-                        ICollection<ByteString> output = (ICollection<ByteString>)list;

-                        ByteString tmp = null;

-                        do

-                        {

-                            ReadBytes(ref tmp);

-                            output.Add(tmp);

-                        }

-                        while (ContinueArray(fieldTag, packed));

-                    }

-                    break;

-                case FieldType.UInt32:

-                    {

-                        ICollection<uint> output = (ICollection<uint>)list;

-                        uint tmp = 0;

-                        do

-                        {

-                            ReadUInt32(ref tmp);

-                            output.Add(tmp);

-                        }

-                        while (ContinueArray(fieldTag, packed));

-                    }

-                    break;

-                case FieldType.SFixed32:

-                    {

-                        ICollection<int> output = (ICollection<int>)list;

-                        int tmp = 0;

-                        do

-                        {

-                            ReadSFixed32(ref tmp);

-                            output.Add(tmp);

-                        }

-                        while (ContinueArray(fieldTag, packed));

-                    }

-                    break;

-                case FieldType.SFixed64:

-                    {

-                        ICollection<long> output = (ICollection<long>)list;

-                        long tmp = 0;

-                        do

-                        {

-                            ReadSFixed64(ref tmp);

-                            output.Add(tmp);

-                        }

-                        while (ContinueArray(fieldTag, packed));

-                    }

-                    break;

-                case FieldType.SInt32:

-                    {

-                        ICollection<int> output = (ICollection<int>)list;

-                        int tmp = 0;

-                        do

-                        {

-                            ReadSInt32(ref tmp);

-                            output.Add(tmp);

-                        }

-                        while (ContinueArray(fieldTag, packed));

-                    }

-                    break;

-                case FieldType.SInt64:

-                    {

-                        ICollection<long> output = (ICollection<long>)list;

-                        long tmp = 0;

-                        do

-                        {

-                            ReadSInt64(ref tmp);

-                            output.Add(tmp);

-                        }

-                        while (ContinueArray(fieldTag, packed));

-                    }

-                    break;

-                case FieldType.Group:

-                    throw new ArgumentException("ReadPrimitiveField() cannot handle nested groups.");

-                case FieldType.Message:

-                    throw new ArgumentException("ReadPrimitiveField() cannot handle embedded messages.");

-                // We don't handle enums because we don't know what to do if the

-                // value is not recognized.

-                case FieldType.Enum:

-                    throw new ArgumentException("ReadPrimitiveField() cannot handle enums.");

-                default:

-                    throw new ArgumentOutOfRangeException("Invalid field type " + fieldType);

+                int tmp = 0;

+                do

+                {

+                    ReadInt32(ref tmp);

+                    list.Add(tmp);

+                } while (ContinueArray(fieldTag, isPacked, holdLimit));

+            }

+        }

+

+        [CLSCompliant(false)]

+        public void ReadSInt32Array(uint fieldTag, string fieldName, ICollection<int> list)

+        {

+            bool isPacked;

+            int holdLimit;

+            if (BeginArray(fieldTag, out isPacked, out holdLimit))

+            {

+                int tmp = 0;

+                do

+                {

+                    ReadSInt32(ref tmp);

+                    list.Add(tmp);

+                } while (ContinueArray(fieldTag, isPacked, holdLimit));

+            }

+        }

+

+        [CLSCompliant(false)]

+        public void ReadUInt32Array(uint fieldTag, string fieldName, ICollection<uint> list)

+        {

+            bool isPacked;

+            int holdLimit;

+            if (BeginArray(fieldTag, out isPacked, out holdLimit))

+            {

+                uint tmp = 0;

+                do

+                {

+                    ReadUInt32(ref tmp);

+                    list.Add(tmp);

+                } while (ContinueArray(fieldTag, isPacked, holdLimit));

+            }

+        }

+

+        [CLSCompliant(false)]

+        public void ReadFixed32Array(uint fieldTag, string fieldName, ICollection<uint> list)

+        {

+            bool isPacked;

+            int holdLimit;

+            if (BeginArray(fieldTag, out isPacked, out holdLimit))

+            {

+                uint tmp = 0;

+                do

+                {

+                    ReadFixed32(ref tmp);

+                    list.Add(tmp);

+                } while (ContinueArray(fieldTag, isPacked, holdLimit));

+            }

+        }

+

+        [CLSCompliant(false)]

+        public void ReadSFixed32Array(uint fieldTag, string fieldName, ICollection<int> list)

+        {

+            bool isPacked;

+            int holdLimit;

+            if (BeginArray(fieldTag, out isPacked, out holdLimit))

+            {

+                int tmp = 0;

+                do

+                {

+                    ReadSFixed32(ref tmp);

+                    list.Add(tmp);

+                } while (ContinueArray(fieldTag, isPacked, holdLimit));

+            }

+        }

+

+        [CLSCompliant(false)]

+        public void ReadInt64Array(uint fieldTag, string fieldName, ICollection<long> list)

+        {

+            bool isPacked;

+            int holdLimit;

+            if (BeginArray(fieldTag, out isPacked, out holdLimit))

+            {

+                long tmp = 0;

+                do

+                {

+                    ReadInt64(ref tmp);

+                    list.Add(tmp);

+                } while (ContinueArray(fieldTag, isPacked, holdLimit));

+            }

+        }

+

+        [CLSCompliant(false)]

+        public void ReadSInt64Array(uint fieldTag, string fieldName, ICollection<long> list)

+        {

+            bool isPacked;

+            int holdLimit;

+            if (BeginArray(fieldTag, out isPacked, out holdLimit))

+            {

+                long tmp = 0;

+                do

+                {

+                    ReadSInt64(ref tmp);

+                    list.Add(tmp);

+                } while (ContinueArray(fieldTag, isPacked, holdLimit));

+            }

+        }

+

+        [CLSCompliant(false)]

+        public void ReadUInt64Array(uint fieldTag, string fieldName, ICollection<ulong> list)

+        {

+            bool isPacked;

+            int holdLimit;

+            if (BeginArray(fieldTag, out isPacked, out holdLimit))

+            {

+                ulong tmp = 0;

+                do

+                {

+                    ReadUInt64(ref tmp);

+                    list.Add(tmp);

+                } while (ContinueArray(fieldTag, isPacked, holdLimit));

+            }

+        }

+

+        [CLSCompliant(false)]

+        public void ReadFixed64Array(uint fieldTag, string fieldName, ICollection<ulong> list)

+        {

+            bool isPacked;

+            int holdLimit;

+            if (BeginArray(fieldTag, out isPacked, out holdLimit))

+            {

+                ulong tmp = 0;

+                do

+                {

+                    ReadFixed64(ref tmp);

+                    list.Add(tmp);

+                } while (ContinueArray(fieldTag, isPacked, holdLimit));

+            }

+        }

+

+        [CLSCompliant(false)]

+        public void ReadSFixed64Array(uint fieldTag, string fieldName, ICollection<long> list)

+        {

+            bool isPacked;

+            int holdLimit;

+            if (BeginArray(fieldTag, out isPacked, out holdLimit))

+            {

+                long tmp = 0;

+                do

+                {

+                    ReadSFixed64(ref tmp);

+                    list.Add(tmp);

+                } while (ContinueArray(fieldTag, isPacked, holdLimit));

+            }

+        }

+

+        [CLSCompliant(false)]

+        public void ReadDoubleArray(uint fieldTag, string fieldName, ICollection<double> list)

+        {

+            bool isPacked;

+            int holdLimit;

+            if (BeginArray(fieldTag, out isPacked, out holdLimit))

+            {

+                double tmp = 0;

+                do

+                {

+                    ReadDouble(ref tmp);

+                    list.Add(tmp);

+                } while (ContinueArray(fieldTag, isPacked, holdLimit));

+            }

+        }

+

+        [CLSCompliant(false)]

+        public void ReadFloatArray(uint fieldTag, string fieldName, ICollection<float> list)

+        {

+            bool isPacked;

+            int holdLimit;

+            if (BeginArray(fieldTag, out isPacked, out holdLimit))

+            {

+                float tmp = 0;

+                do

+                {

+                    ReadFloat(ref tmp);

+                    list.Add(tmp);

+                } while (ContinueArray(fieldTag, isPacked, holdLimit));

             }

         }

 

@@ -838,7 +862,7 @@
                         unknown.Add(unkval);

                     }

                 }

-                while (ContinueArray(fieldTag, false));

+                while (ContinueArray(fieldTag, false, 0));

             }

         }

 

@@ -882,7 +906,7 @@
                         unknown.Add(unkval);

                     }

                 }

-                while (ContinueArray(fieldTag, false));

+                while (ContinueArray(fieldTag, false, 0));

             }

         }

 

@@ -895,7 +919,7 @@
                 ReadMessage(builder, registry);

                 list.Add((T)builder.WeakBuildPartial());

             }

-            while (ContinueArray(fieldTag, false));

+            while (ContinueArray(fieldTag, false, 0));

         }

 

         [CLSCompliant(false)]

@@ -907,7 +931,7 @@
                 ReadGroup(WireFormat.GetTagFieldNumber(fieldTag), builder, registry);

                 list.Add((T)builder.WeakBuildPartial());

             }

-            while (ContinueArray(fieldTag, false));

+            while (ContinueArray(fieldTag, false, 0));

         }

 

         /// <summary>

diff --git a/src/ProtocolBuffers/CodedOutputStream.cs b/src/ProtocolBuffers/CodedOutputStream.cs
index 3735541..f16abf6 100644
--- a/src/ProtocolBuffers/CodedOutputStream.cs
+++ b/src/ProtocolBuffers/CodedOutputStream.cs
@@ -127,7 +127,71 @@
 

         #endregion

 

-        #region Writing of tags etc

+        #region Writing of tags and fields

+

+        public void WriteField(FieldType fieldType, int fieldNumber, string fieldName, object value)

+        {

+            switch (fieldType)

+            {

+                case FieldType.String:

+                    WriteString(fieldNumber, fieldName, (string)value);

+                    break;

+                case FieldType.Message:

+                    WriteMessage(fieldNumber, fieldName, (IMessageLite)value);

+                    break;

+                case FieldType.Group:

+                    WriteGroup(fieldNumber, fieldName, (IMessageLite)value);

+                    break;

+                case FieldType.Bytes:

+                    WriteBytes(fieldNumber, fieldName, (ByteString)value);

+                    break;

+                case FieldType.Bool:

+                    WriteBool(fieldNumber, fieldName, (bool)value);

+                    break;

+                case FieldType.Enum:

+                    if (value is System.Enum)

+                        WriteEnum(fieldNumber, fieldName, (int)value, null/*not used*/);

+                    else

+                        WriteEnum(fieldNumber, fieldName, ((IEnumLite)value).Number, null/*not used*/);

+                    break;

+                case FieldType.Int32:

+                    WriteInt32(fieldNumber, fieldName, (int)value);

+                    break;

+                case FieldType.Int64:

+                    WriteInt64(fieldNumber, fieldName, (long)value);

+                    break;

+                case FieldType.UInt32:

+                    WriteUInt32(fieldNumber, fieldName, (uint)value);

+                    break;

+                case FieldType.UInt64:

+                    WriteUInt64(fieldNumber, fieldName, (ulong)value);

+                    break;

+                case FieldType.SInt32:

+                    WriteSInt32(fieldNumber, fieldName, (int)value);

+                    break;

+                case FieldType.SInt64:

+                    WriteSInt64(fieldNumber, fieldName, (long)value);

+                    break;

+                case FieldType.Fixed32:

+                    WriteFixed32(fieldNumber, fieldName, (uint)value);

+                    break;

+                case FieldType.Fixed64:

+                    WriteFixed64(fieldNumber, fieldName, (ulong)value);

+                    break;

+                case FieldType.SFixed32:

+                    WriteSFixed32(fieldNumber, fieldName, (int)value);

+                    break;

+                case FieldType.SFixed64:

+                    WriteSFixed64(fieldNumber, fieldName, (long)value);

+                    break;

+                case FieldType.Double:

+                    WriteDouble(fieldNumber, fieldName, (double)value);

+                    break;

+                case FieldType.Float:

+                    WriteFloat(fieldNumber, fieldName, (float)value);

+                    break;

+            }

+        }

 

         /// <summary>

         /// Writes a double field value, including tag, to the stream.

@@ -318,266 +382,10 @@
             WriteBytes(WireFormat.MessageSetField.Message, "message", value);

             WriteTag(WireFormat.MessageSetField.Item, WireFormat.WireType.EndGroup);

         }

-        

-        public void WriteArray(FieldType fieldType, int fieldNumber, string fieldName, System.Collections.IEnumerable list)

-        {

-            foreach (object element in list)

-                WriteField(fieldType, fieldNumber, fieldName, element);

-        }

 

-        public void WriteArray<T>(FieldType fieldType, int fieldNumber, string fieldName, System.Collections.Generic.IEnumerable<T> list)

-        {

-            switch (fieldType)

-            {

-                case FieldType.String:

-                    foreach (string value in ((IEnumerable<string>)list))

-                        WriteString(fieldNumber, fieldName, value);

-                    break;

-                case FieldType.Message:

-                    foreach (T value in list)

-                        WriteMessage(fieldNumber, fieldName, (IMessageLite)value);

-                    break;

-                case FieldType.Group:

-                    foreach (T value in list)

-                        WriteGroup(fieldNumber, fieldName, (IMessageLite)value);

-                    break;

-                case FieldType.Bytes:

-                    foreach (ByteString value in ((IEnumerable<ByteString>)list))

-                        WriteBytes(fieldNumber, fieldName, value);

-                    break;

-                case FieldType.Bool:

-                    foreach (bool value in ((IEnumerable<bool>)list))

-                        WriteBool(fieldNumber, fieldName, value);

-                    break;

-                case FieldType.Enum:

-                    if (default(T) is System.Enum)

-                    {

-                        foreach (int value in ((ICastArray)list).CastArray<int>())

-                            WriteEnum(fieldNumber, fieldName, value, null/*not used*/);

-                    }

-                    else

-                    {

-                        foreach (T value in list)

-                            WriteEnum(fieldNumber, fieldName, ((IEnumLite)value).Number, null/*not used*/);

-                    }

-                    break;

-                case FieldType.Int32:

-                    foreach (int value in ((IEnumerable<int>)list))

-                        WriteInt32(fieldNumber, fieldName, value);

-                    break;

-                case FieldType.Int64:

-                    foreach (long value in ((IEnumerable<long>)list))

-                        WriteInt64(fieldNumber, fieldName, value);

-                    break;

-                case FieldType.UInt32:

-                    foreach (uint value in ((IEnumerable<uint>)list))

-                        WriteUInt32(fieldNumber, fieldName, value);

-                    break;

-                case FieldType.UInt64:

-                    foreach (ulong value in ((IEnumerable<ulong>)list))

-                        WriteUInt64(fieldNumber, fieldName, value);

-                    break;

-                case FieldType.SInt32:

-                    foreach (int value in ((IEnumerable<int>)list))

-                        WriteSInt32(fieldNumber, fieldName, value);

-                    break;

-                case FieldType.SInt64:

-                    foreach (long value in ((IEnumerable<long>)list))

-                        WriteSInt64(fieldNumber, fieldName, value);

-                    break;

-                case FieldType.Fixed32:

-                    foreach (uint value in ((IEnumerable<uint>)list))

-                        WriteFixed32(fieldNumber, fieldName, value);

-                    break;

-                case FieldType.Fixed64:

-                    foreach (ulong value in ((IEnumerable<ulong>)list))

-                        WriteFixed64(fieldNumber, fieldName, value);

-                    break;

-                case FieldType.SFixed32:

-                    foreach (int value in ((IEnumerable<int>)list))

-                        WriteSFixed32(fieldNumber, fieldName, value);

-                    break;

-                case FieldType.SFixed64:

-                    foreach (long value in ((IEnumerable<long>)list))

-                        WriteSFixed64(fieldNumber, fieldName, value);

-                    break;

-                case FieldType.Double:

-                    foreach (double value in ((IEnumerable<double>)list))

-                        WriteDouble(fieldNumber, fieldName, value);

-                    break;

-                case FieldType.Float:

-                    foreach (float value in ((IEnumerable<float>)list))

-                        WriteFloat(fieldNumber, fieldName, value);

-                    break;

-            }

-        }

+        #endregion

 

-        public void WritePackedArray(FieldType fieldType, int fieldNumber, string fieldName, System.Collections.IEnumerable list)

-        {

-            int calculatedSize = 0;

-            foreach (object element in list)

-                calculatedSize += CodedOutputStream.ComputeFieldSizeNoTag(fieldType, element);

-            

-            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

-            WriteRawVarint32((uint)calculatedSize);

-            

-            foreach (object element in list)

-                WriteFieldNoTag(fieldType, element);

-        }

-

-        public void WritePackedArray<T>(FieldType fieldType, int fieldNumber, string fieldName, int calculatedSize, System.Collections.Generic.IEnumerable<T> list)

-        {

-            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

-            WriteRawVarint32((uint)calculatedSize);

-

-            switch (fieldType)

-            {

-                case FieldType.String:

-                    foreach (string value in ((IEnumerable<string>)list))

-                        WriteStringNoTag(value);

-                    break;

-                case FieldType.Message:

-                    foreach (T value in list)

-                        WriteMessageNoTag((IMessageLite)value);

-                    break;

-                case FieldType.Group:

-                    foreach (T value in list)

-                        WriteGroupNoTag((IMessageLite)value);

-                    break;

-                case FieldType.Bytes:

-                    foreach (ByteString value in ((IEnumerable<ByteString>)list))

-                        WriteBytesNoTag(value);

-                    break;

-                case FieldType.Bool:

-                    foreach (bool value in ((IEnumerable<bool>)list))

-                        WriteBoolNoTag(value);

-                    break;

-                case FieldType.Enum:

-                    if (default(T) is System.Enum)

-                    {

-                        foreach (int value in ((ICastArray)list).CastArray<int>())

-                            WriteEnumNoTag(value);

-                    }

-                    else

-                    {

-                        foreach (T value in list)

-                            WriteEnumNoTag(((IEnumLite)value).Number);

-                    }

-                    break;

-                case FieldType.Int32:

-                    foreach (int value in ((IEnumerable<int>)list))

-                        WriteInt32NoTag(value);

-                    break;

-                case FieldType.Int64:

-                    foreach (long value in ((IEnumerable<long>)list))

-                        WriteInt64NoTag(value);

-                    break;

-                case FieldType.UInt32:

-                    foreach (uint value in ((IEnumerable<uint>)list))

-                        WriteUInt32NoTag(value);

-                    break;

-                case FieldType.UInt64:

-                    foreach (ulong value in ((IEnumerable<ulong>)list))

-                        WriteUInt64NoTag(value);

-                    break;

-                case FieldType.SInt32:

-                    foreach (int value in ((IEnumerable<int>)list))

-                        WriteSInt32NoTag(value);

-                    break;

-                case FieldType.SInt64:

-                    foreach (long value in ((IEnumerable<long>)list))

-                        WriteSInt64NoTag(value);

-                    break;

-                case FieldType.Fixed32:

-                    foreach (uint value in ((IEnumerable<uint>)list))

-                        WriteFixed32NoTag(value);

-                    break;

-                case FieldType.Fixed64:

-                    foreach (ulong value in ((IEnumerable<ulong>)list))

-                        WriteFixed64NoTag(value);

-                    break;

-                case FieldType.SFixed32:

-                    foreach (int value in ((IEnumerable<int>)list))

-                        WriteSFixed32NoTag(value);

-                    break;

-                case FieldType.SFixed64:

-                    foreach (long value in ((IEnumerable<long>)list))

-                        WriteSFixed64NoTag(value);

-                    break;

-                case FieldType.Double:

-                    foreach (double value in ((IEnumerable<double>)list))

-                        WriteDoubleNoTag(value);

-                    break;

-                case FieldType.Float:

-                    foreach (float value in ((IEnumerable<float>)list))

-                        WriteFloatNoTag(value);

-                    break;

-            }

-        }

-

-        public void WriteField(FieldType fieldType, int fieldNumber, string fieldName, object value)

-        {

-            switch (fieldType)

-            {

-                case FieldType.String:

-                    WriteString(fieldNumber, fieldName, (string)value);

-                    break;

-                case FieldType.Message:

-                    WriteMessage(fieldNumber, fieldName, (IMessageLite)value);

-                    break;

-                case FieldType.Group:

-                    WriteGroup(fieldNumber, fieldName, (IMessageLite)value);

-                    break;

-                case FieldType.Bytes:

-                    WriteBytes(fieldNumber, fieldName, (ByteString)value);

-                    break;

-                case FieldType.Bool:

-                    WriteBool(fieldNumber, fieldName, (bool)value);

-                    break;

-                case FieldType.Enum:

-                    if (value is System.Enum)

-                        WriteEnum(fieldNumber, fieldName, (int)value, null/*not used*/);

-                    else

-                        WriteEnum(fieldNumber, fieldName, ((IEnumLite)value).Number, null/*not used*/);

-                    break;

-                case FieldType.Int32:

-                    WriteInt32(fieldNumber, fieldName, (int) value);

-                    break;

-                case FieldType.Int64:

-                    WriteInt64(fieldNumber, fieldName, (long) value);

-                    break;

-                case FieldType.UInt32:

-                    WriteUInt32(fieldNumber, fieldName, (uint) value);

-                    break;

-                case FieldType.UInt64:

-                    WriteUInt64(fieldNumber, fieldName, (ulong) value);

-                    break;

-                case FieldType.SInt32:

-                    WriteSInt32(fieldNumber, fieldName, (int)value);

-                    break;

-                case FieldType.SInt64:

-                    WriteSInt64(fieldNumber, fieldName, (long)value);

-                    break;

-                case FieldType.Fixed32:

-                    WriteFixed32(fieldNumber, fieldName, (uint) value);

-                    break;

-                case FieldType.Fixed64:

-                    WriteFixed64(fieldNumber, fieldName, (ulong) value);

-                    break;

-                case FieldType.SFixed32:

-                    WriteSFixed32(fieldNumber, fieldName, (int) value);

-                    break;

-                case FieldType.SFixed64:

-                    WriteSFixed64(fieldNumber, fieldName, (long) value);

-                    break;

-                case FieldType.Double:

-                    WriteDouble(fieldNumber, fieldName, (double)value);

-                    break;

-                case FieldType.Float:

-                    WriteFloat(fieldNumber, fieldName, (float)value);

-                    break;

-            }

-        }

+        #region Writing of values without tags

 

         public void WriteFieldNoTag(FieldType fieldType, object value)

         {

@@ -605,34 +413,34 @@
                         WriteEnumNoTag(((IEnumLite)value).Number);

                     break;

                 case FieldType.Int32:

-                    WriteInt32NoTag((int) value);

+                    WriteInt32NoTag((int)value);

                     break;

                 case FieldType.Int64:

-                    WriteInt64NoTag((long) value);

+                    WriteInt64NoTag((long)value);

                     break;

                 case FieldType.UInt32:

-                    WriteUInt32NoTag((uint) value);

+                    WriteUInt32NoTag((uint)value);

                     break;

                 case FieldType.UInt64:

-                    WriteUInt64NoTag((ulong) value);

+                    WriteUInt64NoTag((ulong)value);

                     break;

                 case FieldType.SInt32:

-                    WriteSInt32NoTag((int) value);

+                    WriteSInt32NoTag((int)value);

                     break;

                 case FieldType.SInt64:

-                    WriteSInt64NoTag((long) value);

+                    WriteSInt64NoTag((long)value);

                     break;

                 case FieldType.Fixed32:

-                    WriteFixed32NoTag((uint) value);

+                    WriteFixed32NoTag((uint)value);

                     break;

                 case FieldType.Fixed64:

-                    WriteFixed64NoTag((ulong) value);

+                    WriteFixed64NoTag((ulong)value);

                     break;

                 case FieldType.SFixed32:

-                    WriteSFixed32NoTag((int) value);

+                    WriteSFixed32NoTag((int)value);

                     break;

                 case FieldType.SFixed64:

-                    WriteSFixed64NoTag((long) value);

+                    WriteSFixed64NoTag((long)value);

                     break;

                 case FieldType.Double:

                     WriteDoubleNoTag((double)value);

@@ -643,10 +451,6 @@
             }

         }

 

-        #endregion

-

-        #region Writing of values without tags

-

         /// <summary>

         /// Writes a double field value, including tag, to the stream.

         /// </summary>

@@ -709,7 +513,7 @@
         /// </summary>

         public void WriteInt64NoTag(long value)

         {

-            WriteRawVarint64((ulong) value);

+            WriteRawVarint64((ulong)value);

         }

 

         /// <summary>

@@ -719,12 +523,12 @@
         {

             if (value >= 0)

             {

-                WriteRawVarint32((uint) value);

+                WriteRawVarint32((uint)value);

             }

             else

             {

                 // Must sign-extend.

-                WriteRawVarint64((ulong) value);

+                WriteRawVarint64((ulong)value);

             }

         }

 

@@ -751,7 +555,7 @@
         /// </summary>

         public void WriteBoolNoTag(bool value)

         {

-            WriteRawByte(value ? (byte) 1 : (byte) 0);

+            WriteRawByte(value ? (byte)1 : (byte)0);

         }

 

         /// <summary>

@@ -762,7 +566,7 @@
             // Optimise the case where we have enough space to write

             // the string directly to the buffer, which should be common.

             int length = Encoding.UTF8.GetByteCount(value);

-            WriteRawVarint32((uint) length);

+            WriteRawVarint32((uint)length);

             if (limit - position >= length)

             {

                 Encoding.UTF8.GetBytes(value, 0, value.Length, buffer, position);

@@ -785,7 +589,7 @@
 

         public void WriteMessageNoTag(IMessageLite value)

         {

-            WriteRawVarint32((uint) value.SerializedSize);

+            WriteRawVarint32((uint)value.SerializedSize);

             value.WriteTo(this);

         }

 

@@ -803,17 +607,17 @@
 

         public void WriteEnumNoTag(int value)

         {

-            WriteRawVarint32((uint) value);

+            WriteRawVarint32((uint)value);

         }

 

         public void WriteSFixed32NoTag(int value)

         {

-            WriteRawLittleEndian32((uint) value);

+            WriteRawLittleEndian32((uint)value);

         }

 

         public void WriteSFixed64NoTag(long value)

         {

-            WriteRawLittleEndian64((ulong) value);

+            WriteRawLittleEndian64((ulong)value);

         }

 

         public void WriteSInt32NoTag(int value)

@@ -828,6 +632,309 @@
 

         #endregion

 

+        #region Write array members

+

+        public void WriteArray(FieldType fieldType, int fieldNumber, string fieldName, System.Collections.IEnumerable list)

+        {

+            foreach (object element in list)

+                WriteField(fieldType, fieldNumber, fieldName, element);

+        }

+

+        public void WriteGroupArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)

+            where T : IMessageLite

+        {

+            foreach (IMessageLite value in list)

+                WriteGroup(fieldNumber, fieldName, value);

+        }

+

+        public void WriteMessageArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)

+            where T : IMessageLite

+        {

+            foreach (IMessageLite value in list)

+                WriteMessage(fieldNumber, fieldName, value);

+        }

+

+        public void WriteStringArray(int fieldNumber, string fieldName, IEnumerable<string> list)

+        {

+            foreach (var value in list)

+                WriteString(fieldNumber, fieldName, value);

+        }

+

+        public void WriteBytesArray(int fieldNumber, string fieldName, IEnumerable<ByteString> list)

+        {

+            foreach (var value in list)

+                WriteBytes(fieldNumber, fieldName, value);

+        }

+

+        public void WriteBoolArray(int fieldNumber, string fieldName, IEnumerable<bool> list)

+        {

+            foreach (var value in list)

+                WriteBool(fieldNumber, fieldName, value);

+        }

+

+        public void WriteInt32Array(int fieldNumber, string fieldName, IEnumerable<int> list)

+        {

+            foreach (var value in list)

+                WriteInt32(fieldNumber, fieldName, value);

+        }

+

+        public void WriteSInt32Array(int fieldNumber, string fieldName, IEnumerable<int> list)

+        {

+            foreach (var value in list)

+                WriteSInt32(fieldNumber, fieldName, value);

+        }

+

+        public void WriteUInt32Array(int fieldNumber, string fieldName, IEnumerable<uint> list)

+        {

+            foreach (var value in list)

+                WriteUInt32(fieldNumber, fieldName, value);

+        }

+

+        public void WriteFixed32Array(int fieldNumber, string fieldName, IEnumerable<uint> list)

+        {

+            foreach (var value in list)

+                WriteFixed32(fieldNumber, fieldName, value);

+        }

+

+        public void WriteSFixed32Array(int fieldNumber, string fieldName, IEnumerable<int> list)

+        {

+            foreach (var value in list)

+                WriteSFixed32(fieldNumber, fieldName, value);

+        }

+

+        public void WriteInt64Array(int fieldNumber, string fieldName, IEnumerable<long> list)

+        {

+            foreach (var value in list)

+                WriteInt64(fieldNumber, fieldName, value);

+        }

+

+        public void WriteSInt64Array(int fieldNumber, string fieldName, IEnumerable<long> list)

+        {

+            foreach (var value in list)

+                WriteSInt64(fieldNumber, fieldName, value);

+        }

+

+        public void WriteUInt64Array(int fieldNumber, string fieldName, IEnumerable<ulong> list)

+        {

+            foreach (var value in list)

+                WriteUInt64(fieldNumber, fieldName, value);

+        }

+

+        public void WriteFixed64Array(int fieldNumber, string fieldName, IEnumerable<ulong> list)

+        {

+            foreach (var value in list)

+                WriteFixed64(fieldNumber, fieldName, value);

+        }

+

+        public void WriteSFixed64Array(int fieldNumber, string fieldName, IEnumerable<long> list)

+        {

+            foreach (var value in list)

+                WriteSFixed64(fieldNumber, fieldName, value);

+        }

+

+        public void WriteDoubleArray(int fieldNumber, string fieldName, IEnumerable<double> list)

+        {

+            foreach (var value in list)

+                WriteDouble(fieldNumber, fieldName, value);

+        }

+

+        public void WriteFloatArray(int fieldNumber, string fieldName, IEnumerable<float> list)

+        {

+            foreach (var value in list)

+                WriteFloat(fieldNumber, fieldName, value);

+        }

+

+        [CLSCompliant(false)]

+        public void WriteEnumArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)

+            where T : struct, IComparable, IFormattable, IConvertible

+        {

+            if (list is ICastArray)

+            {

+                foreach (int value in ((ICastArray)list).CastArray<int>())

+                    WriteEnum(fieldNumber, fieldName, value, null /*unused*/);

+            }

+            else

+            {

+                foreach (object value in list)

+                    WriteEnum(fieldNumber, fieldName, (int) value, null /*unused*/);

+            }

+        }

+

+        #endregion

+

+        #region Write packed array members

+

+        public void WritePackedArray(FieldType fieldType, int fieldNumber, string fieldName, System.Collections.IEnumerable list)

+        {

+            int calculatedSize = 0;

+            foreach (object element in list)

+                calculatedSize += CodedOutputStream.ComputeFieldSizeNoTag(fieldType, element);

+

+            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

+            WriteRawVarint32((uint)calculatedSize);

+

+            foreach (object element in list)

+                WriteFieldNoTag(fieldType, element);

+        }

+

+        public void WritePackedGroupArray<T>(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<T> list)

+            where T : IMessageLite

+        {

+            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

+            WriteRawVarint32((uint)calculatedSize);

+            foreach (IMessageLite value in list)

+                WriteGroupNoTag(value);

+        }

+

+        public void WritePackedMessageArray<T>(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<T> list)

+            where T : IMessageLite

+        {

+            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

+            WriteRawVarint32((uint)calculatedSize);

+            foreach (IMessageLite value in list)

+                WriteMessageNoTag(value);

+        }

+

+        public void WritePackedStringArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<string> list)

+        {

+            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

+            WriteRawVarint32((uint)calculatedSize);

+            foreach (var value in list)

+                WriteStringNoTag(value);

+        }

+

+        public void WritePackedBytesArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<ByteString> list)

+        {

+            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

+            WriteRawVarint32((uint)calculatedSize);

+            foreach (var value in list)

+                WriteBytesNoTag(value);

+        }

+

+        public void WritePackedBoolArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<bool> list)

+        {

+            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

+            WriteRawVarint32((uint)calculatedSize);

+            foreach (var value in list)

+                WriteBoolNoTag(value);

+        }

+

+        public void WritePackedInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<int> list)

+        {

+            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

+            WriteRawVarint32((uint)calculatedSize);

+            foreach (var value in list)

+                WriteInt32NoTag(value);

+        }

+

+        public void WritePackedSInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<int> list)

+        {

+            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

+            WriteRawVarint32((uint)calculatedSize);

+            foreach (var value in list)

+                WriteSInt32NoTag(value);

+        }

+

+        public void WritePackedUInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<uint> list)

+        {

+            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

+            WriteRawVarint32((uint)calculatedSize);

+            foreach (var value in list)

+                WriteUInt32NoTag(value);

+        }

+

+        public void WritePackedFixed32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<uint> list)

+        {

+            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

+            WriteRawVarint32((uint)calculatedSize);

+            foreach (var value in list)

+                WriteFixed32NoTag(value);

+        }

+

+        public void WritePackedSFixed32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<int> list)

+        {

+            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

+            WriteRawVarint32((uint)calculatedSize);

+            foreach (var value in list)

+                WriteSFixed32NoTag(value);

+        }

+

+        public void WritePackedInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<long> list)

+        {

+            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

+            WriteRawVarint32((uint)calculatedSize);

+            foreach (var value in list)

+                WriteInt64NoTag(value);

+        }

+

+        public void WritePackedSInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<long> list)

+        {

+            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

+            WriteRawVarint32((uint)calculatedSize);

+            foreach (var value in list)

+                WriteSInt64NoTag(value);

+        }

+

+        public void WritePackedUInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<ulong> list)

+        {

+            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

+            WriteRawVarint32((uint)calculatedSize);

+            foreach (var value in list)

+                WriteUInt64NoTag(value);

+        }

+

+        public void WritePackedFixed64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<ulong> list)

+        {

+            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

+            WriteRawVarint32((uint)calculatedSize);

+            foreach (var value in list)

+                WriteFixed64NoTag(value);

+        }

+

+        public void WritePackedSFixed64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<long> list)

+        {

+            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

+            WriteRawVarint32((uint)calculatedSize);

+            foreach (var value in list)

+                WriteSFixed64NoTag(value);

+        }

+

+        public void WritePackedDoubleArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<double> list)

+        {

+            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

+            WriteRawVarint32((uint)calculatedSize);

+            foreach (var value in list)

+                WriteDoubleNoTag(value);

+        }

+

+        public void WritePackedFloatArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<float> list)

+        {

+            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

+            WriteRawVarint32((uint)calculatedSize);

+            foreach (var value in list)

+                WriteFloatNoTag(value);

+        }

+

+        [CLSCompliant(false)]

+        public void WritePackedEnumArray<T>(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<T> list)

+            where T : struct, IComparable, IFormattable, IConvertible

+        {

+            WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);

+            WriteRawVarint32((uint)calculatedSize);

+            if (list is ICastArray)

+            {

+                foreach (int value in ((ICastArray)list).CastArray<int>())

+                    WriteEnumNoTag(value);

+            }

+            else

+            {

+                foreach (object value in list)

+                    WriteEnumNoTag((int)value);

+            }

+        }

+

+        #endregion

+

         #region Underlying writing primitives

 

         /// <summary>

diff --git a/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs b/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs
index ee6ac94..5dd88ad 100644
--- a/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs
+++ b/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs
@@ -279,7 +279,7 @@
       int size = SerializedSize;

       string[] field_names = _fileDescriptorSetFieldNames;

       if (file_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 1, field_names[0], file_);

+        output.WriteMessageArray(1, field_names[0], file_);

       }

       UnknownFields.WriteTo(output);

     }

@@ -640,19 +640,19 @@
         output.WriteString(2, field_names[6], Package);

       }

       if (dependency_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 3, field_names[0], dependency_);

+        output.WriteStringArray(3, field_names[0], dependency_);

       }

       if (messageType_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 4, field_names[3], messageType_);

+        output.WriteMessageArray(4, field_names[3], messageType_);

       }

       if (enumType_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 5, field_names[1], enumType_);

+        output.WriteMessageArray(5, field_names[1], enumType_);

       }

       if (service_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 6, field_names[7], service_);

+        output.WriteMessageArray(6, field_names[7], service_);

       }

       if (extension_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 7, field_names[2], extension_);

+        output.WriteMessageArray(7, field_names[2], extension_);

       }

       if (hasOptions) {

         output.WriteMessage(8, field_names[5], Options);

@@ -871,7 +871,7 @@
               break;

             }

             case 26: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.dependency_);

+              input.ReadStringArray(tag, field_name, result.dependency_);

               break;

             }

             case 34: {

@@ -1591,19 +1591,19 @@
         output.WriteString(1, field_names[4], Name);

       }

       if (field_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 2, field_names[3], field_);

+        output.WriteMessageArray(2, field_names[3], field_);

       }

       if (nestedType_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 3, field_names[5], nestedType_);

+        output.WriteMessageArray(3, field_names[5], nestedType_);

       }

       if (enumType_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 4, field_names[0], enumType_);

+        output.WriteMessageArray(4, field_names[0], enumType_);

       }

       if (extensionRange_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 5, field_names[2], extensionRange_);

+        output.WriteMessageArray(5, field_names[2], extensionRange_);

       }

       if (extension_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 6, field_names[1], extension_);

+        output.WriteMessageArray(6, field_names[1], extension_);

       }

       if (hasOptions) {

         output.WriteMessage(7, field_names[6], Options);

@@ -2784,7 +2784,7 @@
         output.WriteString(1, field_names[0], Name);

       }

       if (value_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 2, field_names[2], value_);

+        output.WriteMessageArray(2, field_names[2], value_);

       }

       if (hasOptions) {

         output.WriteMessage(3, field_names[1], Options);

@@ -3506,7 +3506,7 @@
         output.WriteString(1, field_names[1], Name);

       }

       if (method_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 2, field_names[0], method_);

+        output.WriteMessageArray(2, field_names[0], method_);

       }

       if (hasOptions) {

         output.WriteMessage(3, field_names[2], Options);

@@ -4354,7 +4354,7 @@
         output.WriteBool(18, field_names[6], PyGenericServices);

       }

       if (uninterpretedOption_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 999, field_names[7], uninterpretedOption_);

+        output.WriteMessageArray(999, field_names[7], uninterpretedOption_);

       }

       extensionWriter.WriteUntil(536870912, output);

       UnknownFields.WriteTo(output);

@@ -4856,7 +4856,7 @@
         output.WriteBool(2, field_names[1], NoStandardDescriptorAccessor);

       }

       if (uninterpretedOption_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 999, field_names[2], uninterpretedOption_);

+        output.WriteMessageArray(999, field_names[2], uninterpretedOption_);

       }

       extensionWriter.WriteUntil(536870912, output);

       UnknownFields.WriteTo(output);

@@ -5250,7 +5250,7 @@
         output.WriteString(9, field_names[2], ExperimentalMapKey);

       }

       if (uninterpretedOption_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 999, field_names[4], uninterpretedOption_);

+        output.WriteMessageArray(999, field_names[4], uninterpretedOption_);

       }

       extensionWriter.WriteUntil(536870912, output);

       UnknownFields.WriteTo(output);

@@ -5641,7 +5641,7 @@
       string[] field_names = _enumOptionsFieldNames;

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

       if (uninterpretedOption_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 999, field_names[0], uninterpretedOption_);

+        output.WriteMessageArray(999, field_names[0], uninterpretedOption_);

       }

       extensionWriter.WriteUntil(536870912, output);

       UnknownFields.WriteTo(output);

@@ -5911,7 +5911,7 @@
       string[] field_names = _enumValueOptionsFieldNames;

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

       if (uninterpretedOption_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 999, field_names[0], uninterpretedOption_);

+        output.WriteMessageArray(999, field_names[0], uninterpretedOption_);

       }

       extensionWriter.WriteUntil(536870912, output);

       UnknownFields.WriteTo(output);

@@ -6181,7 +6181,7 @@
       string[] field_names = _serviceOptionsFieldNames;

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

       if (uninterpretedOption_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 999, field_names[0], uninterpretedOption_);

+        output.WriteMessageArray(999, field_names[0], uninterpretedOption_);

       }

       extensionWriter.WriteUntil(536870912, output);

       UnknownFields.WriteTo(output);

@@ -6451,7 +6451,7 @@
       string[] field_names = _methodOptionsFieldNames;

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

       if (uninterpretedOption_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 999, field_names[0], uninterpretedOption_);

+        output.WriteMessageArray(999, field_names[0], uninterpretedOption_);

       }

       extensionWriter.WriteUntil(536870912, output);

       UnknownFields.WriteTo(output);

@@ -7061,7 +7061,7 @@
       int size = SerializedSize;

       string[] field_names = _uninterpretedOptionFieldNames;

       if (name_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 2, field_names[2], name_);

+        output.WriteMessageArray(2, field_names[2], name_);

       }

       if (hasIdentifierValue) {

         output.WriteString(3, field_names[1], IdentifierValue);

diff --git a/src/ProtocolBuffers/ICodedInputStream.cs b/src/ProtocolBuffers/ICodedInputStream.cs
index f4c6622..5a9df87 100644
--- a/src/ProtocolBuffers/ICodedInputStream.cs
+++ b/src/ProtocolBuffers/ICodedInputStream.cs
@@ -147,13 +147,6 @@
         void ReadPrimitiveArray(FieldType fieldType, uint fieldTag, string fieldName, ICollection<object> list);

 

         /// <summary>

-        /// Reads an array of primitive values into the list, if the wire-type of fieldTag is length-prefixed and the 

-        /// type is numberic, it will read a packed array.

-        /// </summary>

-        [CLSCompliant(false)]

-        void ReadPrimitiveArray<T>(FieldType fieldType, uint fieldTag, string fieldName, ICollection<T> list);

-

-        /// <summary>

         /// Reads an array of primitive values into the list, if the wire-type of fieldTag is length-prefixed, it will

         /// read a packed array.

         /// </summary>

@@ -201,5 +194,50 @@
         /// nothing is skipped. Otherwise, returns true.</returns>

         [CLSCompliant(false)]

         bool SkipField();

+

+        [CLSCompliant(false)]

+        void ReadStringArray(uint fieldTag, string fieldName, ICollection<string> list);

+

+        [CLSCompliant(false)]

+        void ReadBytesArray(uint fieldTag, string fieldName, ICollection<ByteString> list);

+

+        [CLSCompliant(false)]

+        void ReadBoolArray(uint fieldTag, string fieldName, ICollection<bool> list);

+

+        [CLSCompliant(false)]

+        void ReadInt32Array(uint fieldTag, string fieldName, ICollection<int> list);

+

+        [CLSCompliant(false)]

+        void ReadSInt32Array(uint fieldTag, string fieldName, ICollection<int> list);

+

+        [CLSCompliant(false)]

+        void ReadUInt32Array(uint fieldTag, string fieldName, ICollection<uint> list);

+

+        [CLSCompliant(false)]

+        void ReadFixed32Array(uint fieldTag, string fieldName, ICollection<uint> list);

+

+        [CLSCompliant(false)]

+        void ReadSFixed32Array(uint fieldTag, string fieldName, ICollection<int> list);

+

+        [CLSCompliant(false)]

+        void ReadInt64Array(uint fieldTag, string fieldName, ICollection<long> list);

+

+        [CLSCompliant(false)]

+        void ReadSInt64Array(uint fieldTag, string fieldName, ICollection<long> list);

+

+        [CLSCompliant(false)]

+        void ReadUInt64Array(uint fieldTag, string fieldName, ICollection<ulong> list);

+

+        [CLSCompliant(false)]

+        void ReadFixed64Array(uint fieldTag, string fieldName, ICollection<ulong> list);

+

+        [CLSCompliant(false)]

+        void ReadSFixed64Array(uint fieldTag, string fieldName, ICollection<long> list);

+

+        [CLSCompliant(false)]

+        void ReadDoubleArray(uint fieldTag, string fieldName, ICollection<double> list);

+

+        [CLSCompliant(false)]

+        void ReadFloatArray(uint fieldTag, string fieldName, ICollection<float> list);

     }

 }
\ No newline at end of file
diff --git a/src/ProtocolBuffers/ICodedOutputStream.cs b/src/ProtocolBuffers/ICodedOutputStream.cs
index 6408d98..56ee5b6 100644
--- a/src/ProtocolBuffers/ICodedOutputStream.cs
+++ b/src/ProtocolBuffers/ICodedOutputStream.cs
@@ -1,4 +1,5 @@
 using System;

+using System.Collections.Generic;

 using Google.ProtocolBuffers.Descriptors;

 

 //Disable warning CS3010: CLS-compliant interfaces must have only CLS-compliant members

@@ -8,6 +9,15 @@
 {

     public interface ICodedOutputStream

     {

+        void Flush();

+

+        [Obsolete]

+        void WriteUnknownGroup(int fieldNumber, string fieldName, IMessageLite value);

+        void WriteMessageSetExtension(int fieldNumber, string fieldName, IMessageLite value);

+        void WriteMessageSetExtension(int fieldNumber, string fieldName, ByteString value);

+

+        void WriteField(FieldType fieldType, int fieldNumber, string fieldName, object value);

+

         /// <summary>

         /// Writes a double field value, including tag, to the stream.

         /// </summary>

@@ -61,27 +71,114 @@
         /// </summary>

         void WriteGroup(int fieldNumber, string fieldName, IMessageLite value);

 

-        [Obsolete]

-        void WriteUnknownGroup(int fieldNumber, string fieldName, IMessageLite value);

-

+        /// <summary>

+        /// Writes a message field value, including tag, to the stream.

+        /// </summary>

         void WriteMessage(int fieldNumber, string fieldName, IMessageLite value);

+        /// <summary>

+        /// Writes a byte array field value, including tag, to the stream.

+        /// </summary>

         void WriteBytes(int fieldNumber, string fieldName, ByteString value);

 

+        /// <summary>

+        /// Writes a UInt32 field value, including tag, to the stream.

+        /// </summary>

         [CLSCompliant(false)]

         void WriteUInt32(int fieldNumber, string fieldName, uint value);

 

+        /// <summary>

+        /// Writes an enum field value, including tag, to the stream.

+        /// </summary>

         void WriteEnum(int fieldNumber, string fieldName, int value, object rawValue);

+        /// <summary>

+        /// Writes a fixed 32-bit field value, including tag, to the stream.

+        /// </summary>

         void WriteSFixed32(int fieldNumber, string fieldName, int value);

+        /// <summary>

+        /// Writes a signed fixed 64-bit field value, including tag, to the stream.

+        /// </summary>

         void WriteSFixed64(int fieldNumber, string fieldName, long value);

+        /// <summary>

+        /// Writes a signed 32-bit field value, including tag, to the stream.

+        /// </summary>

         void WriteSInt32(int fieldNumber, string fieldName, int value);

+        /// <summary>

+        /// Writes a signed 64-bit field value, including tag, to the stream.

+        /// </summary>

         void WriteSInt64(int fieldNumber, string fieldName, long value);

-        void WriteMessageSetExtension(int fieldNumber, string fieldName, IMessageLite value);

-        void WriteMessageSetExtension(int fieldNumber, string fieldName, ByteString value);

+

         void WriteArray(FieldType fieldType, int fieldNumber, string fieldName, System.Collections.IEnumerable list);

+

+        void WriteGroupArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)

+            where T : IMessageLite;

+            

+        void WriteMessageArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)

+            where T : IMessageLite;

+            

+        void WriteStringArray(int fieldNumber, string fieldName, IEnumerable<string> list);

+            

+        void WriteBytesArray(int fieldNumber, string fieldName, IEnumerable<ByteString> list);

+                    

+        void WriteBoolArray(int fieldNumber, string fieldName, IEnumerable<bool> list);

+                    

+        void WriteInt32Array(int fieldNumber, string fieldName, IEnumerable<int> list);

+            

+        void WriteSInt32Array(int fieldNumber, string fieldName, IEnumerable<int> list);

+            

+        void WriteUInt32Array(int fieldNumber, string fieldName, IEnumerable<uint> list);

+            

+        void WriteFixed32Array(int fieldNumber, string fieldName, IEnumerable<uint> list);

+            

+        void WriteSFixed32Array(int fieldNumber, string fieldName, IEnumerable<int> list);

+                    

+        void WriteInt64Array(int fieldNumber, string fieldName, IEnumerable<long> list);

+            

+        void WriteSInt64Array(int fieldNumber, string fieldName, IEnumerable<long> list);

+            

+        void WriteUInt64Array(int fieldNumber, string fieldName, IEnumerable<ulong> list);

+            

+        void WriteFixed64Array(int fieldNumber, string fieldName, IEnumerable<ulong> list);

+            

+        void WriteSFixed64Array(int fieldNumber, string fieldName, IEnumerable<long> list);

+

+        void WriteDoubleArray(int fieldNumber, string fieldName, IEnumerable<double> list);

+            

+        void WriteFloatArray(int fieldNumber, string fieldName, IEnumerable<float> list);

+

+        [CLSCompliant(false)]

+        void WriteEnumArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list) 

+            where T : struct, IComparable, IFormattable, IConvertible;

+

         void WritePackedArray(FieldType fieldType, int fieldNumber, string fieldName, System.Collections.IEnumerable list);

-        void WriteArray<T>(FieldType fieldType, int fieldNumber, string fieldName, System.Collections.Generic.IEnumerable<T> list);

-        void WritePackedArray<T>(FieldType fieldType, int fieldNumber, string fieldName, int calculatedSize, System.Collections.Generic.IEnumerable<T> list);

-        void WriteField(FieldType fieldType, int fieldNumber, string fieldName, object value);

-        void Flush();

+        

+        void WritePackedBoolArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<bool> list);

+

+        void WritePackedInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<int> list);

+

+        void WritePackedSInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<int> list);

+

+        void WritePackedUInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<uint> list);

+

+        void WritePackedFixed32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<uint> list);

+

+        void WritePackedSFixed32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<int> list);

+

+        void WritePackedInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<long> list);

+

+        void WritePackedSInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<long> list);

+

+        void WritePackedUInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<ulong> list);

+

+        void WritePackedFixed64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<ulong> list);

+

+        void WritePackedSFixed64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<long> list);

+

+        void WritePackedDoubleArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<double> list);

+

+        void WritePackedFloatArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<float> list);

+

+        [CLSCompliant(false)]

+        void WritePackedEnumArray<T>(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<T> list)

+            where T : struct, IComparable, IFormattable, IConvertible;

     }

 }
\ No newline at end of file
diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasLiteProtoFile.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasLiteProtoFile.cs
index e8f9dea..d54f2d5 100644
--- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasLiteProtoFile.cs
+++ b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasLiteProtoFile.cs
@@ -1158,13 +1158,13 @@
         output.WriteString(3, field_names[2], Email);

       }

       if (phone_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 4, field_names[5], phone_);

+        output.WriteMessageArray(4, field_names[5], phone_);

       }

       if (addresses_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Group, 5, field_names[0], addresses_);

+        output.WriteGroupArray(5, field_names[0], addresses_);

       }

       if (codes_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Int32, 10, field_names[1], codesMemoizedSerializedSize, codes_);

+        output.WritePackedInt32Array(10, field_names[1], codesMemoizedSerializedSize, codes_);

       }

       extensionWriter.WriteUntil(200, output);

     }

@@ -1414,7 +1414,7 @@
             }

             case 82:

             case 80: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int32, tag, field_name, result.codes_);

+              input.ReadInt32Array(tag, field_name, result.codes_);

               break;

             }

           }

diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteProtoFile.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteProtoFile.cs
index 50ea783..10cbed2 100644
--- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteProtoFile.cs
+++ b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteProtoFile.cs
@@ -2773,76 +2773,76 @@
         output.WriteString(25, field_names[22], OptionalCord);

       }

       if (repeatedInt32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int32, 31, field_names[55], repeatedInt32_);

+        output.WriteInt32Array(31, field_names[55], repeatedInt32_);

       }

       if (repeatedInt64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int64, 32, field_names[56], repeatedInt64_);

+        output.WriteInt64Array(32, field_names[56], repeatedInt64_);

       }

       if (repeatedUint32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.UInt32, 33, field_names[65], repeatedUint32_);

+        output.WriteUInt32Array(33, field_names[65], repeatedUint32_);

       }

       if (repeatedUint64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.UInt64, 34, field_names[66], repeatedUint64_);

+        output.WriteUInt64Array(34, field_names[66], repeatedUint64_);

       }

       if (repeatedSint32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SInt32, 35, field_names[61], repeatedSint32_);

+        output.WriteSInt32Array(35, field_names[61], repeatedSint32_);

       }

       if (repeatedSint64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SInt64, 36, field_names[62], repeatedSint64_);

+        output.WriteSInt64Array(36, field_names[62], repeatedSint64_);

       }

       if (repeatedFixed32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Fixed32, 37, field_names[48], repeatedFixed32_);

+        output.WriteFixed32Array(37, field_names[48], repeatedFixed32_);

       }

       if (repeatedFixed64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Fixed64, 38, field_names[49], repeatedFixed64_);

+        output.WriteFixed64Array(38, field_names[49], repeatedFixed64_);

       }

       if (repeatedSfixed32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SFixed32, 39, field_names[59], repeatedSfixed32_);

+        output.WriteSFixed32Array(39, field_names[59], repeatedSfixed32_);

       }

       if (repeatedSfixed64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SFixed64, 40, field_names[60], repeatedSfixed64_);

+        output.WriteSFixed64Array(40, field_names[60], repeatedSfixed64_);

       }

       if (repeatedFloat_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Float, 41, field_names[50], repeatedFloat_);

+        output.WriteFloatArray(41, field_names[50], repeatedFloat_);

       }

       if (repeatedDouble_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Double, 42, field_names[47], repeatedDouble_);

+        output.WriteDoubleArray(42, field_names[47], repeatedDouble_);

       }

       if (repeatedBool_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Bool, 43, field_names[44], repeatedBool_);

+        output.WriteBoolArray(43, field_names[44], repeatedBool_);

       }

       if (repeatedString_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 44, field_names[63], repeatedString_);

+        output.WriteStringArray(44, field_names[63], repeatedString_);

       }

       if (repeatedBytes_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Bytes, 45, field_names[45], repeatedBytes_);

+        output.WriteBytesArray(45, field_names[45], repeatedBytes_);

       }

       if (repeatedGroup_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Group, 46, field_names[67], repeatedGroup_);

+        output.WriteGroupArray(46, field_names[67], repeatedGroup_);

       }

       if (repeatedNestedMessage_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 48, field_names[58], repeatedNestedMessage_);

+        output.WriteMessageArray(48, field_names[58], repeatedNestedMessage_);

       }

       if (repeatedForeignMessage_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 49, field_names[52], repeatedForeignMessage_);

+        output.WriteMessageArray(49, field_names[52], repeatedForeignMessage_);

       }

       if (repeatedImportMessage_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 50, field_names[54], repeatedImportMessage_);

+        output.WriteMessageArray(50, field_names[54], repeatedImportMessage_);

       }

       if (repeatedNestedEnum_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Enum, 51, field_names[57], repeatedNestedEnum_);

+        output.WriteEnumArray(51, field_names[57], repeatedNestedEnum_);

       }

       if (repeatedForeignEnum_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Enum, 52, field_names[51], repeatedForeignEnum_);

+        output.WriteEnumArray(52, field_names[51], repeatedForeignEnum_);

       }

       if (repeatedImportEnum_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Enum, 53, field_names[53], repeatedImportEnum_);

+        output.WriteEnumArray(53, field_names[53], repeatedImportEnum_);

       }

       if (repeatedStringPiece_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 54, field_names[64], repeatedStringPiece_);

+        output.WriteStringArray(54, field_names[64], repeatedStringPiece_);

       }

       if (repeatedCord_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 55, field_names[46], repeatedCord_);

+        output.WriteStringArray(55, field_names[46], repeatedCord_);

       }

       if (hasDefaultInt32) {

         output.WriteInt32(61, field_names[9], DefaultInt32);

@@ -3980,75 +3980,75 @@
             }

             case 250:

             case 248: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int32, tag, field_name, result.repeatedInt32_);

+              input.ReadInt32Array(tag, field_name, result.repeatedInt32_);

               break;

             }

             case 258:

             case 256: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int64, tag, field_name, result.repeatedInt64_);

+              input.ReadInt64Array(tag, field_name, result.repeatedInt64_);

               break;

             }

             case 266:

             case 264: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt32, tag, field_name, result.repeatedUint32_);

+              input.ReadUInt32Array(tag, field_name, result.repeatedUint32_);

               break;

             }

             case 274:

             case 272: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt64, tag, field_name, result.repeatedUint64_);

+              input.ReadUInt64Array(tag, field_name, result.repeatedUint64_);

               break;

             }

             case 282:

             case 280: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt32, tag, field_name, result.repeatedSint32_);

+              input.ReadSInt32Array(tag, field_name, result.repeatedSint32_);

               break;

             }

             case 290:

             case 288: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt64, tag, field_name, result.repeatedSint64_);

+              input.ReadSInt64Array(tag, field_name, result.repeatedSint64_);

               break;

             }

             case 298:

             case 301: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed32, tag, field_name, result.repeatedFixed32_);

+              input.ReadFixed32Array(tag, field_name, result.repeatedFixed32_);

               break;

             }

             case 306:

             case 305: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed64, tag, field_name, result.repeatedFixed64_);

+              input.ReadFixed64Array(tag, field_name, result.repeatedFixed64_);

               break;

             }

             case 314:

             case 317: {

-              input.ReadPrimitiveArray(pbd::FieldType.SFixed32, tag, field_name, result.repeatedSfixed32_);

+              input.ReadSFixed32Array(tag, field_name, result.repeatedSfixed32_);

               break;

             }

             case 322:

             case 321: {

-              input.ReadPrimitiveArray(pbd::FieldType.SFixed64, tag, field_name, result.repeatedSfixed64_);

+              input.ReadSFixed64Array(tag, field_name, result.repeatedSfixed64_);

               break;

             }

             case 330:

             case 333: {

-              input.ReadPrimitiveArray(pbd::FieldType.Float, tag, field_name, result.repeatedFloat_);

+              input.ReadFloatArray(tag, field_name, result.repeatedFloat_);

               break;

             }

             case 338:

             case 337: {

-              input.ReadPrimitiveArray(pbd::FieldType.Double, tag, field_name, result.repeatedDouble_);

+              input.ReadDoubleArray(tag, field_name, result.repeatedDouble_);

               break;

             }

             case 346:

             case 344: {

-              input.ReadPrimitiveArray(pbd::FieldType.Bool, tag, field_name, result.repeatedBool_);

+              input.ReadBoolArray(tag, field_name, result.repeatedBool_);

               break;

             }

             case 354: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.repeatedString_);

+              input.ReadStringArray(tag, field_name, result.repeatedString_);

               break;

             }

             case 362: {

-              input.ReadPrimitiveArray(pbd::FieldType.Bytes, tag, field_name, result.repeatedBytes_);

+              input.ReadBytesArray(tag, field_name, result.repeatedBytes_);

               break;

             }

             case 371: {

@@ -4086,11 +4086,11 @@
               break;

             }

             case 434: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.repeatedStringPiece_);

+              input.ReadStringArray(tag, field_name, result.repeatedStringPiece_);

               break;

             }

             case 442: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.repeatedCord_);

+              input.ReadStringArray(tag, field_name, result.repeatedCord_);

               break;

             }

             case 488: {

@@ -6234,46 +6234,46 @@
       int size = SerializedSize;

       string[] field_names = _testPackedTypesLiteFieldNames;

       if (packedInt32_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Int32, 90, field_names[6], packedInt32MemoizedSerializedSize, packedInt32_);

+        output.WritePackedInt32Array(90, field_names[6], packedInt32MemoizedSerializedSize, packedInt32_);

       }

       if (packedInt64_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Int64, 91, field_names[7], packedInt64MemoizedSerializedSize, packedInt64_);

+        output.WritePackedInt64Array(91, field_names[7], packedInt64MemoizedSerializedSize, packedInt64_);

       }

       if (packedUint32_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.UInt32, 92, field_names[12], packedUint32MemoizedSerializedSize, packedUint32_);

+        output.WritePackedUInt32Array(92, field_names[12], packedUint32MemoizedSerializedSize, packedUint32_);

       }

       if (packedUint64_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.UInt64, 93, field_names[13], packedUint64MemoizedSerializedSize, packedUint64_);

+        output.WritePackedUInt64Array(93, field_names[13], packedUint64MemoizedSerializedSize, packedUint64_);

       }

       if (packedSint32_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.SInt32, 94, field_names[10], packedSint32MemoizedSerializedSize, packedSint32_);

+        output.WritePackedSInt32Array(94, field_names[10], packedSint32MemoizedSerializedSize, packedSint32_);

       }

       if (packedSint64_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.SInt64, 95, field_names[11], packedSint64MemoizedSerializedSize, packedSint64_);

+        output.WritePackedSInt64Array(95, field_names[11], packedSint64MemoizedSerializedSize, packedSint64_);

       }

       if (packedFixed32_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Fixed32, 96, field_names[3], packedFixed32MemoizedSerializedSize, packedFixed32_);

+        output.WritePackedFixed32Array(96, field_names[3], packedFixed32MemoizedSerializedSize, packedFixed32_);

       }

       if (packedFixed64_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Fixed64, 97, field_names[4], packedFixed64MemoizedSerializedSize, packedFixed64_);

+        output.WritePackedFixed64Array(97, field_names[4], packedFixed64MemoizedSerializedSize, packedFixed64_);

       }

       if (packedSfixed32_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.SFixed32, 98, field_names[8], packedSfixed32MemoizedSerializedSize, packedSfixed32_);

+        output.WritePackedSFixed32Array(98, field_names[8], packedSfixed32MemoizedSerializedSize, packedSfixed32_);

       }

       if (packedSfixed64_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.SFixed64, 99, field_names[9], packedSfixed64MemoizedSerializedSize, packedSfixed64_);

+        output.WritePackedSFixed64Array(99, field_names[9], packedSfixed64MemoizedSerializedSize, packedSfixed64_);

       }

       if (packedFloat_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Float, 100, field_names[5], packedFloatMemoizedSerializedSize, packedFloat_);

+        output.WritePackedFloatArray(100, field_names[5], packedFloatMemoizedSerializedSize, packedFloat_);

       }

       if (packedDouble_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Double, 101, field_names[1], packedDoubleMemoizedSerializedSize, packedDouble_);

+        output.WritePackedDoubleArray(101, field_names[1], packedDoubleMemoizedSerializedSize, packedDouble_);

       }

       if (packedBool_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Bool, 102, field_names[0], packedBoolMemoizedSerializedSize, packedBool_);

+        output.WritePackedBoolArray(102, field_names[0], packedBoolMemoizedSerializedSize, packedBool_);

       }

       if (packedEnum_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Enum, 103, field_names[2], packedEnumMemoizedSerializedSize, packedEnum_);

+        output.WritePackedEnumArray(103, field_names[2], packedEnumMemoizedSerializedSize, packedEnum_);

       }

     }

     

@@ -6704,67 +6704,67 @@
             }

             case 722:

             case 720: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int32, tag, field_name, result.packedInt32_);

+              input.ReadInt32Array(tag, field_name, result.packedInt32_);

               break;

             }

             case 730:

             case 728: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int64, tag, field_name, result.packedInt64_);

+              input.ReadInt64Array(tag, field_name, result.packedInt64_);

               break;

             }

             case 738:

             case 736: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt32, tag, field_name, result.packedUint32_);

+              input.ReadUInt32Array(tag, field_name, result.packedUint32_);

               break;

             }

             case 746:

             case 744: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt64, tag, field_name, result.packedUint64_);

+              input.ReadUInt64Array(tag, field_name, result.packedUint64_);

               break;

             }

             case 754:

             case 752: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt32, tag, field_name, result.packedSint32_);

+              input.ReadSInt32Array(tag, field_name, result.packedSint32_);

               break;

             }

             case 762:

             case 760: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt64, tag, field_name, result.packedSint64_);

+              input.ReadSInt64Array(tag, field_name, result.packedSint64_);

               break;

             }

             case 770:

             case 773: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed32, tag, field_name, result.packedFixed32_);

+              input.ReadFixed32Array(tag, field_name, result.packedFixed32_);

               break;

             }

             case 778:

             case 777: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed64, tag, field_name, result.packedFixed64_);

+              input.ReadFixed64Array(tag, field_name, result.packedFixed64_);

               break;

             }

             case 786:

             case 789: {

-              input.ReadPrimitiveArray(pbd::FieldType.SFixed32, tag, field_name, result.packedSfixed32_);

+              input.ReadSFixed32Array(tag, field_name, result.packedSfixed32_);

               break;

             }

             case 794:

             case 793: {

-              input.ReadPrimitiveArray(pbd::FieldType.SFixed64, tag, field_name, result.packedSfixed64_);

+              input.ReadSFixed64Array(tag, field_name, result.packedSfixed64_);

               break;

             }

             case 802:

             case 805: {

-              input.ReadPrimitiveArray(pbd::FieldType.Float, tag, field_name, result.packedFloat_);

+              input.ReadFloatArray(tag, field_name, result.packedFloat_);

               break;

             }

             case 810:

             case 809: {

-              input.ReadPrimitiveArray(pbd::FieldType.Double, tag, field_name, result.packedDouble_);

+              input.ReadDoubleArray(tag, field_name, result.packedDouble_);

               break;

             }

             case 818:

             case 816: {

-              input.ReadPrimitiveArray(pbd::FieldType.Bool, tag, field_name, result.packedBool_);

+              input.ReadBoolArray(tag, field_name, result.packedBool_);

               break;

             }

             case 826:

@@ -7374,46 +7374,46 @@
       int size = SerializedSize;

       string[] field_names = _testUnpackedTypesLiteFieldNames;

       if (unpackedInt32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int32, 90, field_names[6], unpackedInt32_);

+        output.WriteInt32Array(90, field_names[6], unpackedInt32_);

       }

       if (unpackedInt64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int64, 91, field_names[7], unpackedInt64_);

+        output.WriteInt64Array(91, field_names[7], unpackedInt64_);

       }

       if (unpackedUint32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.UInt32, 92, field_names[12], unpackedUint32_);

+        output.WriteUInt32Array(92, field_names[12], unpackedUint32_);

       }

       if (unpackedUint64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.UInt64, 93, field_names[13], unpackedUint64_);

+        output.WriteUInt64Array(93, field_names[13], unpackedUint64_);

       }

       if (unpackedSint32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SInt32, 94, field_names[10], unpackedSint32_);

+        output.WriteSInt32Array(94, field_names[10], unpackedSint32_);

       }

       if (unpackedSint64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SInt64, 95, field_names[11], unpackedSint64_);

+        output.WriteSInt64Array(95, field_names[11], unpackedSint64_);

       }

       if (unpackedFixed32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Fixed32, 96, field_names[3], unpackedFixed32_);

+        output.WriteFixed32Array(96, field_names[3], unpackedFixed32_);

       }

       if (unpackedFixed64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Fixed64, 97, field_names[4], unpackedFixed64_);

+        output.WriteFixed64Array(97, field_names[4], unpackedFixed64_);

       }

       if (unpackedSfixed32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SFixed32, 98, field_names[8], unpackedSfixed32_);

+        output.WriteSFixed32Array(98, field_names[8], unpackedSfixed32_);

       }

       if (unpackedSfixed64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SFixed64, 99, field_names[9], unpackedSfixed64_);

+        output.WriteSFixed64Array(99, field_names[9], unpackedSfixed64_);

       }

       if (unpackedFloat_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Float, 100, field_names[5], unpackedFloat_);

+        output.WriteFloatArray(100, field_names[5], unpackedFloat_);

       }

       if (unpackedDouble_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Double, 101, field_names[1], unpackedDouble_);

+        output.WriteDoubleArray(101, field_names[1], unpackedDouble_);

       }

       if (unpackedBool_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Bool, 102, field_names[0], unpackedBool_);

+        output.WriteBoolArray(102, field_names[0], unpackedBool_);

       }

       if (unpackedEnum_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Enum, 103, field_names[2], unpackedEnum_);

+        output.WriteEnumArray(103, field_names[2], unpackedEnum_);

       }

     }

     

@@ -7803,67 +7803,67 @@
             }

             case 722:

             case 720: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int32, tag, field_name, result.unpackedInt32_);

+              input.ReadInt32Array(tag, field_name, result.unpackedInt32_);

               break;

             }

             case 730:

             case 728: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int64, tag, field_name, result.unpackedInt64_);

+              input.ReadInt64Array(tag, field_name, result.unpackedInt64_);

               break;

             }

             case 738:

             case 736: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt32, tag, field_name, result.unpackedUint32_);

+              input.ReadUInt32Array(tag, field_name, result.unpackedUint32_);

               break;

             }

             case 746:

             case 744: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt64, tag, field_name, result.unpackedUint64_);

+              input.ReadUInt64Array(tag, field_name, result.unpackedUint64_);

               break;

             }

             case 754:

             case 752: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt32, tag, field_name, result.unpackedSint32_);

+              input.ReadSInt32Array(tag, field_name, result.unpackedSint32_);

               break;

             }

             case 762:

             case 760: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt64, tag, field_name, result.unpackedSint64_);

+              input.ReadSInt64Array(tag, field_name, result.unpackedSint64_);

               break;

             }

             case 770:

             case 773: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed32, tag, field_name, result.unpackedFixed32_);

+              input.ReadFixed32Array(tag, field_name, result.unpackedFixed32_);

               break;

             }

             case 778:

             case 777: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed64, tag, field_name, result.unpackedFixed64_);

+              input.ReadFixed64Array(tag, field_name, result.unpackedFixed64_);

               break;

             }

             case 786:

             case 789: {

-              input.ReadPrimitiveArray(pbd::FieldType.SFixed32, tag, field_name, result.unpackedSfixed32_);

+              input.ReadSFixed32Array(tag, field_name, result.unpackedSfixed32_);

               break;

             }

             case 794:

             case 793: {

-              input.ReadPrimitiveArray(pbd::FieldType.SFixed64, tag, field_name, result.unpackedSfixed64_);

+              input.ReadSFixed64Array(tag, field_name, result.unpackedSfixed64_);

               break;

             }

             case 802:

             case 805: {

-              input.ReadPrimitiveArray(pbd::FieldType.Float, tag, field_name, result.unpackedFloat_);

+              input.ReadFloatArray(tag, field_name, result.unpackedFloat_);

               break;

             }

             case 810:

             case 809: {

-              input.ReadPrimitiveArray(pbd::FieldType.Double, tag, field_name, result.unpackedDouble_);

+              input.ReadDoubleArray(tag, field_name, result.unpackedDouble_);

               break;

             }

             case 818:

             case 816: {

-              input.ReadPrimitiveArray(pbd::FieldType.Bool, tag, field_name, result.unpackedBool_);

+              input.ReadBoolArray(tag, field_name, result.unpackedBool_);

               break;

             }

             case 826:

diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestProtoFile.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestProtoFile.cs
index a3294ca..67fd4cc 100644
--- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestProtoFile.cs
+++ b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestProtoFile.cs
@@ -2702,76 +2702,76 @@
         output.WriteString(25, field_names[22], OptionalCord);

       }

       if (repeatedInt32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int32, 31, field_names[55], repeatedInt32_);

+        output.WriteInt32Array(31, field_names[55], repeatedInt32_);

       }

       if (repeatedInt64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int64, 32, field_names[56], repeatedInt64_);

+        output.WriteInt64Array(32, field_names[56], repeatedInt64_);

       }

       if (repeatedUint32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.UInt32, 33, field_names[65], repeatedUint32_);

+        output.WriteUInt32Array(33, field_names[65], repeatedUint32_);

       }

       if (repeatedUint64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.UInt64, 34, field_names[66], repeatedUint64_);

+        output.WriteUInt64Array(34, field_names[66], repeatedUint64_);

       }

       if (repeatedSint32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SInt32, 35, field_names[61], repeatedSint32_);

+        output.WriteSInt32Array(35, field_names[61], repeatedSint32_);

       }

       if (repeatedSint64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SInt64, 36, field_names[62], repeatedSint64_);

+        output.WriteSInt64Array(36, field_names[62], repeatedSint64_);

       }

       if (repeatedFixed32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Fixed32, 37, field_names[48], repeatedFixed32_);

+        output.WriteFixed32Array(37, field_names[48], repeatedFixed32_);

       }

       if (repeatedFixed64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Fixed64, 38, field_names[49], repeatedFixed64_);

+        output.WriteFixed64Array(38, field_names[49], repeatedFixed64_);

       }

       if (repeatedSfixed32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SFixed32, 39, field_names[59], repeatedSfixed32_);

+        output.WriteSFixed32Array(39, field_names[59], repeatedSfixed32_);

       }

       if (repeatedSfixed64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SFixed64, 40, field_names[60], repeatedSfixed64_);

+        output.WriteSFixed64Array(40, field_names[60], repeatedSfixed64_);

       }

       if (repeatedFloat_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Float, 41, field_names[50], repeatedFloat_);

+        output.WriteFloatArray(41, field_names[50], repeatedFloat_);

       }

       if (repeatedDouble_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Double, 42, field_names[47], repeatedDouble_);

+        output.WriteDoubleArray(42, field_names[47], repeatedDouble_);

       }

       if (repeatedBool_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Bool, 43, field_names[44], repeatedBool_);

+        output.WriteBoolArray(43, field_names[44], repeatedBool_);

       }

       if (repeatedString_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 44, field_names[63], repeatedString_);

+        output.WriteStringArray(44, field_names[63], repeatedString_);

       }

       if (repeatedBytes_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Bytes, 45, field_names[45], repeatedBytes_);

+        output.WriteBytesArray(45, field_names[45], repeatedBytes_);

       }

       if (repeatedGroup_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Group, 46, field_names[67], repeatedGroup_);

+        output.WriteGroupArray(46, field_names[67], repeatedGroup_);

       }

       if (repeatedNestedMessage_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 48, field_names[58], repeatedNestedMessage_);

+        output.WriteMessageArray(48, field_names[58], repeatedNestedMessage_);

       }

       if (repeatedForeignMessage_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 49, field_names[52], repeatedForeignMessage_);

+        output.WriteMessageArray(49, field_names[52], repeatedForeignMessage_);

       }

       if (repeatedImportMessage_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 50, field_names[54], repeatedImportMessage_);

+        output.WriteMessageArray(50, field_names[54], repeatedImportMessage_);

       }

       if (repeatedNestedEnum_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Enum, 51, field_names[57], repeatedNestedEnum_);

+        output.WriteEnumArray(51, field_names[57], repeatedNestedEnum_);

       }

       if (repeatedForeignEnum_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Enum, 52, field_names[51], repeatedForeignEnum_);

+        output.WriteEnumArray(52, field_names[51], repeatedForeignEnum_);

       }

       if (repeatedImportEnum_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Enum, 53, field_names[53], repeatedImportEnum_);

+        output.WriteEnumArray(53, field_names[53], repeatedImportEnum_);

       }

       if (repeatedStringPiece_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 54, field_names[64], repeatedStringPiece_);

+        output.WriteStringArray(54, field_names[64], repeatedStringPiece_);

       }

       if (repeatedCord_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 55, field_names[46], repeatedCord_);

+        output.WriteStringArray(55, field_names[46], repeatedCord_);

       }

       if (hasDefaultInt32) {

         output.WriteInt32(61, field_names[9], DefaultInt32);

@@ -3646,75 +3646,75 @@
             }

             case 250:

             case 248: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int32, tag, field_name, result.repeatedInt32_);

+              input.ReadInt32Array(tag, field_name, result.repeatedInt32_);

               break;

             }

             case 258:

             case 256: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int64, tag, field_name, result.repeatedInt64_);

+              input.ReadInt64Array(tag, field_name, result.repeatedInt64_);

               break;

             }

             case 266:

             case 264: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt32, tag, field_name, result.repeatedUint32_);

+              input.ReadUInt32Array(tag, field_name, result.repeatedUint32_);

               break;

             }

             case 274:

             case 272: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt64, tag, field_name, result.repeatedUint64_);

+              input.ReadUInt64Array(tag, field_name, result.repeatedUint64_);

               break;

             }

             case 282:

             case 280: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt32, tag, field_name, result.repeatedSint32_);

+              input.ReadSInt32Array(tag, field_name, result.repeatedSint32_);

               break;

             }

             case 290:

             case 288: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt64, tag, field_name, result.repeatedSint64_);

+              input.ReadSInt64Array(tag, field_name, result.repeatedSint64_);

               break;

             }

             case 298:

             case 301: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed32, tag, field_name, result.repeatedFixed32_);

+              input.ReadFixed32Array(tag, field_name, result.repeatedFixed32_);

               break;

             }

             case 306:

             case 305: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed64, tag, field_name, result.repeatedFixed64_);

+              input.ReadFixed64Array(tag, field_name, result.repeatedFixed64_);

               break;

             }

             case 314:

             case 317: {

-              input.ReadPrimitiveArray(pbd::FieldType.SFixed32, tag, field_name, result.repeatedSfixed32_);

+              input.ReadSFixed32Array(tag, field_name, result.repeatedSfixed32_);

               break;

             }

             case 322:

             case 321: {

-              input.ReadPrimitiveArray(pbd::FieldType.SFixed64, tag, field_name, result.repeatedSfixed64_);

+              input.ReadSFixed64Array(tag, field_name, result.repeatedSfixed64_);

               break;

             }

             case 330:

             case 333: {

-              input.ReadPrimitiveArray(pbd::FieldType.Float, tag, field_name, result.repeatedFloat_);

+              input.ReadFloatArray(tag, field_name, result.repeatedFloat_);

               break;

             }

             case 338:

             case 337: {

-              input.ReadPrimitiveArray(pbd::FieldType.Double, tag, field_name, result.repeatedDouble_);

+              input.ReadDoubleArray(tag, field_name, result.repeatedDouble_);

               break;

             }

             case 346:

             case 344: {

-              input.ReadPrimitiveArray(pbd::FieldType.Bool, tag, field_name, result.repeatedBool_);

+              input.ReadBoolArray(tag, field_name, result.repeatedBool_);

               break;

             }

             case 354: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.repeatedString_);

+              input.ReadStringArray(tag, field_name, result.repeatedString_);

               break;

             }

             case 362: {

-              input.ReadPrimitiveArray(pbd::FieldType.Bytes, tag, field_name, result.repeatedBytes_);

+              input.ReadBytesArray(tag, field_name, result.repeatedBytes_);

               break;

             }

             case 371: {

@@ -3776,11 +3776,11 @@
               break;

             }

             case 434: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.repeatedStringPiece_);

+              input.ReadStringArray(tag, field_name, result.repeatedStringPiece_);

               break;

             }

             case 442: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.repeatedCord_);

+              input.ReadStringArray(tag, field_name, result.repeatedCord_);

               break;

             }

             case 488: {

@@ -8485,7 +8485,7 @@
         output.WriteMessage(1, field_names[1], OptionalMessage);

       }

       if (repeatedMessage_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 2, field_names[2], repeatedMessage_);

+        output.WriteMessageArray(2, field_names[2], repeatedMessage_);

       }

       if (hasDummy) {

         output.WriteInt32(3, field_names[0], Dummy);

@@ -11742,10 +11742,10 @@
           int size = SerializedSize;

           string[] field_names = _nestedMessageFieldNames;

           if (nestedmessageRepeatedInt32_.Count > 0) {

-            output.WriteArray(pbd::FieldType.Int32, 1, field_names[1], nestedmessageRepeatedInt32_);

+            output.WriteInt32Array(1, field_names[1], nestedmessageRepeatedInt32_);

           }

           if (nestedmessageRepeatedForeignmessage_.Count > 0) {

-            output.WriteArray(pbd::FieldType.Message, 2, field_names[0], nestedmessageRepeatedForeignmessage_);

+            output.WriteMessageArray(2, field_names[0], nestedmessageRepeatedForeignmessage_);

           }

           UnknownFields.WriteTo(output);

         }

@@ -11915,7 +11915,7 @@
                 }

                 case 10:

                 case 8: {

-                  input.ReadPrimitiveArray(pbd::FieldType.Int32, tag, field_name, result.nestedmessageRepeatedInt32_);

+                  input.ReadInt32Array(tag, field_name, result.nestedmessageRepeatedInt32_);

                   break;

                 }

                 case 18: {

@@ -12426,22 +12426,22 @@
         output.WriteString(6, field_names[0], CordField);

       }

       if (repeatedPrimitiveField_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int32, 7, field_names[7], repeatedPrimitiveField_);

+        output.WriteInt32Array(7, field_names[7], repeatedPrimitiveField_);

       }

       if (repeatedStringField_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 8, field_names[8], repeatedStringField_);

+        output.WriteStringArray(8, field_names[8], repeatedStringField_);

       }

       if (repeatedEnumField_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Enum, 9, field_names[5], repeatedEnumField_);

+        output.WriteEnumArray(9, field_names[5], repeatedEnumField_);

       }

       if (repeatedMessageField_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Message, 10, field_names[6], repeatedMessageField_);

+        output.WriteMessageArray(10, field_names[6], repeatedMessageField_);

       }

       if (repeatedStringPieceField_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 11, field_names[9], repeatedStringPieceField_);

+        output.WriteStringArray(11, field_names[9], repeatedStringPieceField_);

       }

       if (repeatedCordField_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 12, field_names[4], repeatedCordField_);

+        output.WriteStringArray(12, field_names[4], repeatedCordField_);

       }

       UnknownFields.WriteTo(output);

     }

@@ -12734,11 +12734,11 @@
             }

             case 58:

             case 56: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int32, tag, field_name, result.repeatedPrimitiveField_);

+              input.ReadInt32Array(tag, field_name, result.repeatedPrimitiveField_);

               break;

             }

             case 66: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.repeatedStringField_);

+              input.ReadStringArray(tag, field_name, result.repeatedStringField_);

               break;

             }

             case 74:

@@ -12760,11 +12760,11 @@
               break;

             }

             case 90: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.repeatedStringPieceField_);

+              input.ReadStringArray(tag, field_name, result.repeatedStringPieceField_);

               break;

             }

             case 98: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.repeatedCordField_);

+              input.ReadStringArray(tag, field_name, result.repeatedCordField_);

               break;

             }

           }

@@ -15105,46 +15105,46 @@
       int size = SerializedSize;

       string[] field_names = _testPackedTypesFieldNames;

       if (packedInt32_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Int32, 90, field_names[6], packedInt32MemoizedSerializedSize, packedInt32_);

+        output.WritePackedInt32Array(90, field_names[6], packedInt32MemoizedSerializedSize, packedInt32_);

       }

       if (packedInt64_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Int64, 91, field_names[7], packedInt64MemoizedSerializedSize, packedInt64_);

+        output.WritePackedInt64Array(91, field_names[7], packedInt64MemoizedSerializedSize, packedInt64_);

       }

       if (packedUint32_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.UInt32, 92, field_names[12], packedUint32MemoizedSerializedSize, packedUint32_);

+        output.WritePackedUInt32Array(92, field_names[12], packedUint32MemoizedSerializedSize, packedUint32_);

       }

       if (packedUint64_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.UInt64, 93, field_names[13], packedUint64MemoizedSerializedSize, packedUint64_);

+        output.WritePackedUInt64Array(93, field_names[13], packedUint64MemoizedSerializedSize, packedUint64_);

       }

       if (packedSint32_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.SInt32, 94, field_names[10], packedSint32MemoizedSerializedSize, packedSint32_);

+        output.WritePackedSInt32Array(94, field_names[10], packedSint32MemoizedSerializedSize, packedSint32_);

       }

       if (packedSint64_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.SInt64, 95, field_names[11], packedSint64MemoizedSerializedSize, packedSint64_);

+        output.WritePackedSInt64Array(95, field_names[11], packedSint64MemoizedSerializedSize, packedSint64_);

       }

       if (packedFixed32_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Fixed32, 96, field_names[3], packedFixed32MemoizedSerializedSize, packedFixed32_);

+        output.WritePackedFixed32Array(96, field_names[3], packedFixed32MemoizedSerializedSize, packedFixed32_);

       }

       if (packedFixed64_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Fixed64, 97, field_names[4], packedFixed64MemoizedSerializedSize, packedFixed64_);

+        output.WritePackedFixed64Array(97, field_names[4], packedFixed64MemoizedSerializedSize, packedFixed64_);

       }

       if (packedSfixed32_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.SFixed32, 98, field_names[8], packedSfixed32MemoizedSerializedSize, packedSfixed32_);

+        output.WritePackedSFixed32Array(98, field_names[8], packedSfixed32MemoizedSerializedSize, packedSfixed32_);

       }

       if (packedSfixed64_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.SFixed64, 99, field_names[9], packedSfixed64MemoizedSerializedSize, packedSfixed64_);

+        output.WritePackedSFixed64Array(99, field_names[9], packedSfixed64MemoizedSerializedSize, packedSfixed64_);

       }

       if (packedFloat_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Float, 100, field_names[5], packedFloatMemoizedSerializedSize, packedFloat_);

+        output.WritePackedFloatArray(100, field_names[5], packedFloatMemoizedSerializedSize, packedFloat_);

       }

       if (packedDouble_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Double, 101, field_names[1], packedDoubleMemoizedSerializedSize, packedDouble_);

+        output.WritePackedDoubleArray(101, field_names[1], packedDoubleMemoizedSerializedSize, packedDouble_);

       }

       if (packedBool_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Bool, 102, field_names[0], packedBoolMemoizedSerializedSize, packedBool_);

+        output.WritePackedBoolArray(102, field_names[0], packedBoolMemoizedSerializedSize, packedBool_);

       }

       if (packedEnum_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.Enum, 103, field_names[2], packedEnumMemoizedSerializedSize, packedEnum_);

+        output.WritePackedEnumArray(103, field_names[2], packedEnumMemoizedSerializedSize, packedEnum_);

       }

       UnknownFields.WriteTo(output);

     }

@@ -15492,67 +15492,67 @@
             }

             case 722:

             case 720: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int32, tag, field_name, result.packedInt32_);

+              input.ReadInt32Array(tag, field_name, result.packedInt32_);

               break;

             }

             case 730:

             case 728: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int64, tag, field_name, result.packedInt64_);

+              input.ReadInt64Array(tag, field_name, result.packedInt64_);

               break;

             }

             case 738:

             case 736: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt32, tag, field_name, result.packedUint32_);

+              input.ReadUInt32Array(tag, field_name, result.packedUint32_);

               break;

             }

             case 746:

             case 744: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt64, tag, field_name, result.packedUint64_);

+              input.ReadUInt64Array(tag, field_name, result.packedUint64_);

               break;

             }

             case 754:

             case 752: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt32, tag, field_name, result.packedSint32_);

+              input.ReadSInt32Array(tag, field_name, result.packedSint32_);

               break;

             }

             case 762:

             case 760: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt64, tag, field_name, result.packedSint64_);

+              input.ReadSInt64Array(tag, field_name, result.packedSint64_);

               break;

             }

             case 770:

             case 773: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed32, tag, field_name, result.packedFixed32_);

+              input.ReadFixed32Array(tag, field_name, result.packedFixed32_);

               break;

             }

             case 778:

             case 777: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed64, tag, field_name, result.packedFixed64_);

+              input.ReadFixed64Array(tag, field_name, result.packedFixed64_);

               break;

             }

             case 786:

             case 789: {

-              input.ReadPrimitiveArray(pbd::FieldType.SFixed32, tag, field_name, result.packedSfixed32_);

+              input.ReadSFixed32Array(tag, field_name, result.packedSfixed32_);

               break;

             }

             case 794:

             case 793: {

-              input.ReadPrimitiveArray(pbd::FieldType.SFixed64, tag, field_name, result.packedSfixed64_);

+              input.ReadSFixed64Array(tag, field_name, result.packedSfixed64_);

               break;

             }

             case 802:

             case 805: {

-              input.ReadPrimitiveArray(pbd::FieldType.Float, tag, field_name, result.packedFloat_);

+              input.ReadFloatArray(tag, field_name, result.packedFloat_);

               break;

             }

             case 810:

             case 809: {

-              input.ReadPrimitiveArray(pbd::FieldType.Double, tag, field_name, result.packedDouble_);

+              input.ReadDoubleArray(tag, field_name, result.packedDouble_);

               break;

             }

             case 818:

             case 816: {

-              input.ReadPrimitiveArray(pbd::FieldType.Bool, tag, field_name, result.packedBool_);

+              input.ReadBoolArray(tag, field_name, result.packedBool_);

               break;

             }

             case 826:

@@ -16181,46 +16181,46 @@
       int size = SerializedSize;

       string[] field_names = _testUnpackedTypesFieldNames;

       if (unpackedInt32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int32, 90, field_names[6], unpackedInt32_);

+        output.WriteInt32Array(90, field_names[6], unpackedInt32_);

       }

       if (unpackedInt64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int64, 91, field_names[7], unpackedInt64_);

+        output.WriteInt64Array(91, field_names[7], unpackedInt64_);

       }

       if (unpackedUint32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.UInt32, 92, field_names[12], unpackedUint32_);

+        output.WriteUInt32Array(92, field_names[12], unpackedUint32_);

       }

       if (unpackedUint64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.UInt64, 93, field_names[13], unpackedUint64_);

+        output.WriteUInt64Array(93, field_names[13], unpackedUint64_);

       }

       if (unpackedSint32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SInt32, 94, field_names[10], unpackedSint32_);

+        output.WriteSInt32Array(94, field_names[10], unpackedSint32_);

       }

       if (unpackedSint64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SInt64, 95, field_names[11], unpackedSint64_);

+        output.WriteSInt64Array(95, field_names[11], unpackedSint64_);

       }

       if (unpackedFixed32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Fixed32, 96, field_names[3], unpackedFixed32_);

+        output.WriteFixed32Array(96, field_names[3], unpackedFixed32_);

       }

       if (unpackedFixed64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Fixed64, 97, field_names[4], unpackedFixed64_);

+        output.WriteFixed64Array(97, field_names[4], unpackedFixed64_);

       }

       if (unpackedSfixed32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SFixed32, 98, field_names[8], unpackedSfixed32_);

+        output.WriteSFixed32Array(98, field_names[8], unpackedSfixed32_);

       }

       if (unpackedSfixed64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.SFixed64, 99, field_names[9], unpackedSfixed64_);

+        output.WriteSFixed64Array(99, field_names[9], unpackedSfixed64_);

       }

       if (unpackedFloat_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Float, 100, field_names[5], unpackedFloat_);

+        output.WriteFloatArray(100, field_names[5], unpackedFloat_);

       }

       if (unpackedDouble_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Double, 101, field_names[1], unpackedDouble_);

+        output.WriteDoubleArray(101, field_names[1], unpackedDouble_);

       }

       if (unpackedBool_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Bool, 102, field_names[0], unpackedBool_);

+        output.WriteBoolArray(102, field_names[0], unpackedBool_);

       }

       if (unpackedEnum_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Enum, 103, field_names[2], unpackedEnum_);

+        output.WriteEnumArray(103, field_names[2], unpackedEnum_);

       }

       UnknownFields.WriteTo(output);

     }

@@ -16527,67 +16527,67 @@
             }

             case 722:

             case 720: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int32, tag, field_name, result.unpackedInt32_);

+              input.ReadInt32Array(tag, field_name, result.unpackedInt32_);

               break;

             }

             case 730:

             case 728: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int64, tag, field_name, result.unpackedInt64_);

+              input.ReadInt64Array(tag, field_name, result.unpackedInt64_);

               break;

             }

             case 738:

             case 736: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt32, tag, field_name, result.unpackedUint32_);

+              input.ReadUInt32Array(tag, field_name, result.unpackedUint32_);

               break;

             }

             case 746:

             case 744: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt64, tag, field_name, result.unpackedUint64_);

+              input.ReadUInt64Array(tag, field_name, result.unpackedUint64_);

               break;

             }

             case 754:

             case 752: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt32, tag, field_name, result.unpackedSint32_);

+              input.ReadSInt32Array(tag, field_name, result.unpackedSint32_);

               break;

             }

             case 762:

             case 760: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt64, tag, field_name, result.unpackedSint64_);

+              input.ReadSInt64Array(tag, field_name, result.unpackedSint64_);

               break;

             }

             case 770:

             case 773: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed32, tag, field_name, result.unpackedFixed32_);

+              input.ReadFixed32Array(tag, field_name, result.unpackedFixed32_);

               break;

             }

             case 778:

             case 777: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed64, tag, field_name, result.unpackedFixed64_);

+              input.ReadFixed64Array(tag, field_name, result.unpackedFixed64_);

               break;

             }

             case 786:

             case 789: {

-              input.ReadPrimitiveArray(pbd::FieldType.SFixed32, tag, field_name, result.unpackedSfixed32_);

+              input.ReadSFixed32Array(tag, field_name, result.unpackedSfixed32_);

               break;

             }

             case 794:

             case 793: {

-              input.ReadPrimitiveArray(pbd::FieldType.SFixed64, tag, field_name, result.unpackedSfixed64_);

+              input.ReadSFixed64Array(tag, field_name, result.unpackedSfixed64_);

               break;

             }

             case 802:

             case 805: {

-              input.ReadPrimitiveArray(pbd::FieldType.Float, tag, field_name, result.unpackedFloat_);

+              input.ReadFloatArray(tag, field_name, result.unpackedFloat_);

               break;

             }

             case 810:

             case 809: {

-              input.ReadPrimitiveArray(pbd::FieldType.Double, tag, field_name, result.unpackedDouble_);

+              input.ReadDoubleArray(tag, field_name, result.unpackedDouble_);

               break;

             }

             case 818:

             case 816: {

-              input.ReadPrimitiveArray(pbd::FieldType.Bool, tag, field_name, result.unpackedBool_);

+              input.ReadBoolArray(tag, field_name, result.unpackedBool_);

               break;

             }

             case 826:

@@ -17792,10 +17792,10 @@
         output.WriteMessage(2004, field_names[1], DynamicMessageExtension);

       }

       if (repeatedExtension_.Count > 0) {

-        output.WriteArray(pbd::FieldType.String, 2005, field_names[5], repeatedExtension_);

+        output.WriteStringArray(2005, field_names[5], repeatedExtension_);

       }

       if (packedExtension_.Count > 0) {

-        output.WritePackedArray(pbd::FieldType.SInt32, 2006, field_names[4], packedExtensionMemoizedSerializedSize, packedExtension_);

+        output.WritePackedSInt32Array(2006, field_names[4], packedExtensionMemoizedSerializedSize, packedExtension_);

       }

       UnknownFields.WriteTo(output);

     }

@@ -18048,12 +18048,12 @@
               break;

             }

             case 16042: {

-              input.ReadPrimitiveArray(pbd::FieldType.String, tag, field_name, result.repeatedExtension_);

+              input.ReadStringArray(tag, field_name, result.repeatedExtension_);

               break;

             }

             case 16050:

             case 16048: {

-              input.ReadPrimitiveArray(pbd::FieldType.SInt32, tag, field_name, result.packedExtension_);

+              input.ReadSInt32Array(tag, field_name, result.packedExtension_);

               break;

             }

           }

@@ -18368,22 +18368,22 @@
       int size = SerializedSize;

       string[] field_names = _testRepeatedScalarDifferentTagSizesFieldNames;

       if (repeatedFixed32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Fixed32, 12, field_names[0], repeatedFixed32_);

+        output.WriteFixed32Array(12, field_names[0], repeatedFixed32_);

       }

       if (repeatedInt32_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int32, 13, field_names[3], repeatedInt32_);

+        output.WriteInt32Array(13, field_names[3], repeatedInt32_);

       }

       if (repeatedFixed64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Fixed64, 2046, field_names[1], repeatedFixed64_);

+        output.WriteFixed64Array(2046, field_names[1], repeatedFixed64_);

       }

       if (repeatedInt64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Int64, 2047, field_names[4], repeatedInt64_);

+        output.WriteInt64Array(2047, field_names[4], repeatedInt64_);

       }

       if (repeatedFloat_.Count > 0) {

-        output.WriteArray(pbd::FieldType.Float, 262142, field_names[2], repeatedFloat_);

+        output.WriteFloatArray(262142, field_names[2], repeatedFloat_);

       }

       if (repeatedUint64_.Count > 0) {

-        output.WriteArray(pbd::FieldType.UInt64, 262143, field_names[5], repeatedUint64_);

+        output.WriteUInt64Array(262143, field_names[5], repeatedUint64_);

       }

       UnknownFields.WriteTo(output);

     }

@@ -18600,32 +18600,32 @@
             }

             case 98:

             case 101: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed32, tag, field_name, result.repeatedFixed32_);

+              input.ReadFixed32Array(tag, field_name, result.repeatedFixed32_);

               break;

             }

             case 106:

             case 104: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int32, tag, field_name, result.repeatedInt32_);

+              input.ReadInt32Array(tag, field_name, result.repeatedInt32_);

               break;

             }

             case 16370:

             case 16369: {

-              input.ReadPrimitiveArray(pbd::FieldType.Fixed64, tag, field_name, result.repeatedFixed64_);

+              input.ReadFixed64Array(tag, field_name, result.repeatedFixed64_);

               break;

             }

             case 16378:

             case 16376: {

-              input.ReadPrimitiveArray(pbd::FieldType.Int64, tag, field_name, result.repeatedInt64_);

+              input.ReadInt64Array(tag, field_name, result.repeatedInt64_);

               break;

             }

             case 2097138:

             case 2097141: {

-              input.ReadPrimitiveArray(pbd::FieldType.Float, tag, field_name, result.repeatedFloat_);

+              input.ReadFloatArray(tag, field_name, result.repeatedFloat_);

               break;

             }

             case 2097146:

             case 2097144: {

-              input.ReadPrimitiveArray(pbd::FieldType.UInt64, tag, field_name, result.repeatedUint64_);

+              input.ReadUInt64Array(tag, field_name, result.repeatedUint64_);

               break;

             }

           }