private void WriteEnumerable(Type elementFormalType, int count, IEnumerable collection) { writer.Write(count); foreach(var element in collection) { WriteField(elementFormalType, element); } }