aboutsummaryrefslogtreecommitdiff
path: root/src/ProtocolBuffers/IBuilder.cs
diff options
context:
space:
mode:
authorJon Skeet <skeet@pobox.com>2009-05-29 06:34:52 +0100
committerJon Skeet <skeet@pobox.com>2009-05-29 06:34:52 +0100
commit2e6dc12fa8e8cf58a8ab27838b11f929b5cf909b (patch)
treed91d424a60adc04ac4c63d6dad592aa141b0bb7b /src/ProtocolBuffers/IBuilder.cs
parent43da7ae328b699d9c6e64ea909e348fac3506f73 (diff)
downloadprotobuf-2e6dc12fa8e8cf58a8ab27838b11f929b5cf909b.tar.gz
protobuf-2e6dc12fa8e8cf58a8ab27838b11f929b5cf909b.tar.bz2
protobuf-2e6dc12fa8e8cf58a8ab27838b11f929b5cf909b.zip
Write/Read delimited messages
Diffstat (limited to 'src/ProtocolBuffers/IBuilder.cs')
-rw-r--r--src/ProtocolBuffers/IBuilder.cs19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/ProtocolBuffers/IBuilder.cs b/src/ProtocolBuffers/IBuilder.cs
index 6b01afb9..36db1f11 100644
--- a/src/ProtocolBuffers/IBuilder.cs
+++ b/src/ProtocolBuffers/IBuilder.cs
@@ -247,6 +247,20 @@ namespace Google.ProtocolBuffers {
/// Merge some unknown fields into the set for this message.
/// </summary>
TBuilder MergeUnknownFields(UnknownFieldSet unknownFields);
+
+ /// <summary>
+ /// Like MergeFrom(Stream), but does not read until the end of the file.
+ /// Instead, the size of the message (encoded as a varint) is read first,
+ /// then the message data. Use Message.WriteDelimitedTo(Stream) to
+ /// write messages in this format.
+ /// </summary>
+ /// <param name="input"></param>
+ TBuilder MergeDelimitedFrom(Stream input);
+
+ /// <summary>
+ /// Like MergeDelimitedFrom(Stream) but supporting extensions.
+ /// </summary>
+ TBuilder MergeDelimitedFrom(Stream input, ExtensionRegistry extensionRegistry);
#region Convenience methods
/// <summary>
@@ -283,8 +297,9 @@ namespace Google.ProtocolBuffers {
/// MergeFrom(CodedInputStream). Note that this method always reads
/// the entire input (unless it throws an exception). If you want it to
/// stop earlier, you will need to wrap the input in a wrapper
- /// stream which limits reading. Despite usually reading the entire
- /// stream, this method never closes the stream.
+ /// stream which limits reading. Or, use IMessage.WriteDelimitedTo(Stream)
+ /// to write your message and MmergeDelimitedFrom(Stream) to read it.
+ /// Despite usually reading the entire stream, this method never closes the stream.
/// </summary>
TBuilder MergeFrom(Stream input);