aboutsummaryrefslogtreecommitdiff
path: root/csharp/ProtocolBuffers/ByteString.cs
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/ProtocolBuffers/ByteString.cs')
-rw-r--r--csharp/ProtocolBuffers/ByteString.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/csharp/ProtocolBuffers/ByteString.cs b/csharp/ProtocolBuffers/ByteString.cs
index 34aea2df..94eb45e3 100644
--- a/csharp/ProtocolBuffers/ByteString.cs
+++ b/csharp/ProtocolBuffers/ByteString.cs
@@ -105,6 +105,15 @@ namespace Google.ProtocolBuffers {
return ToString(Encoding.UTF8);
}
+ /// <summary>
+ /// Creates a CodedInputStream from this ByteString's data.
+ /// </summary>
+ public CodedInputStream CreateCodedInput() {
+
+ // We trust CodedInputStream not to reveal the provided byte array or modify it
+ return CodedInputStream.CreateInstance(bytes);
+ }
+
// TODO(jonskeet): CopyTo, Equals, GetHashCode if they turn out to be required
/// <summary>