diff options
-rw-r--r-- | src/ProtocolBuffers/ByteString.cs | 5 | ||||
-rw-r--r-- | src/ProtocolBuffers/CodedOutputStream.cs | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/ProtocolBuffers/ByteString.cs b/src/ProtocolBuffers/ByteString.cs index 545bf556..ea17ca1e 100644 --- a/src/ProtocolBuffers/ByteString.cs +++ b/src/ProtocolBuffers/ByteString.cs @@ -252,7 +252,10 @@ namespace Google.ProtocolBuffers }
}
- internal void WriteTo(CodedOutputStream outputStream)
+ /// <summary>
+ /// Used internally by CodedOutputStream to avoid creating a copy for the write
+ /// </summary>
+ internal void WriteRawBytesTo(CodedOutputStream outputStream)
{
outputStream.WriteRawBytes(bytes, 0, bytes.Length);
}
diff --git a/src/ProtocolBuffers/CodedOutputStream.cs b/src/ProtocolBuffers/CodedOutputStream.cs index 59490df3..088db8ae 100644 --- a/src/ProtocolBuffers/CodedOutputStream.cs +++ b/src/ProtocolBuffers/CodedOutputStream.cs @@ -360,7 +360,7 @@ namespace Google.ProtocolBuffers {
WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited);
WriteRawVarint32((uint) value.Length);
- value.WriteTo(this);
+ value.WriteRawBytesTo(this);
}
[CLSCompliant(false)]
@@ -637,7 +637,7 @@ namespace Google.ProtocolBuffers public void WriteBytesNoTag(ByteString value)
{
WriteRawVarint32((uint) value.Length);
- value.WriteTo(this);
+ value.WriteRawBytesTo(this);
}
[CLSCompliant(false)]
|