aboutsummaryrefslogtreecommitdiffhomepage
path: root/csharp/src/Google.Protobuf/Collections/RepeatedField.cs
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/src/Google.Protobuf/Collections/RepeatedField.cs')
-rw-r--r--csharp/src/Google.Protobuf/Collections/RepeatedField.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/csharp/src/Google.Protobuf/Collections/RepeatedField.cs b/csharp/src/Google.Protobuf/Collections/RepeatedField.cs
index 1cde03bc..d1db856c 100644
--- a/csharp/src/Google.Protobuf/Collections/RepeatedField.cs
+++ b/csharp/src/Google.Protobuf/Collections/RepeatedField.cs
@@ -33,6 +33,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
+using System.IO;
using System.Text;
namespace Google.Protobuf.Collections
@@ -474,9 +475,9 @@ namespace Google.Protobuf.Collections
/// </summary>
public override string ToString()
{
- var builder = new StringBuilder();
- JsonFormatter.Default.WriteList(builder, this);
- return builder.ToString();
+ var writer = new StringWriter();
+ JsonFormatter.Default.WriteList(writer, this);
+ return writer.ToString();
}
/// <summary>