aboutsummaryrefslogtreecommitdiff
path: root/src/ProtocolBuffers.Serialization/Http/MessageFormatFactory.cs
diff options
context:
space:
mode:
authorcsharptest <roger@csharptest.net>2011-10-01 14:45:47 -0500
committerrogerk <devnull@localhost>2011-10-01 14:45:47 -0500
commit4ad552692f737dc27e0ea7829eb8f771b852013c (patch)
treeb0935fcfa31760d07d185854ed46ff46f1657001 /src/ProtocolBuffers.Serialization/Http/MessageFormatFactory.cs
parentadfdc008919cf373c98ef099e7796345c191ca18 (diff)
downloadprotobuf-4ad552692f737dc27e0ea7829eb8f771b852013c.tar.gz
protobuf-4ad552692f737dc27e0ea7829eb8f771b852013c.tar.bz2
protobuf-4ad552692f737dc27e0ea7829eb8f771b852013c.zip
Moved all extension methods to a single class/file
Diffstat (limited to 'src/ProtocolBuffers.Serialization/Http/MessageFormatFactory.cs')
-rw-r--r--src/ProtocolBuffers.Serialization/Http/MessageFormatFactory.cs40
1 files changed, 0 insertions, 40 deletions
diff --git a/src/ProtocolBuffers.Serialization/Http/MessageFormatFactory.cs b/src/ProtocolBuffers.Serialization/Http/MessageFormatFactory.cs
index 52fff83f..68de9411 100644
--- a/src/ProtocolBuffers.Serialization/Http/MessageFormatFactory.cs
+++ b/src/ProtocolBuffers.Serialization/Http/MessageFormatFactory.cs
@@ -30,24 +30,6 @@ namespace Google.ProtocolBuffers.Serialization.Http
return codedInput;
}
-
- /// <summary>
- /// Merges the message from the input stream based on the contentType provided
- /// </summary>
- /// <typeparam name="TBuilder">A type derived from IBuilderLite</typeparam>
- /// <param name="builder">An instance of a message builder</param>
- /// <param name="options">Options specific to reading this message and/or content type</param>
- /// <param name="contentType">The mime type of the input stream content</param>
- /// <param name="input">The stream to read the message from</param>
- /// <returns>The same builder instance that was supplied in the builder parameter</returns>
- public static TBuilder MergeFrom<TBuilder>(this TBuilder builder, MessageFormatOptions options, string contentType, Stream input) where TBuilder : IBuilderLite
- {
- ICodedInputStream codedInput = CreateInputStream(options, contentType, input);
- codedInput.ReadMessageStart();
- builder.WeakMergeFrom(codedInput, options.ExtensionRegistry);
- codedInput.ReadMessageEnd();
- return builder;
- }
/// <summary>
/// Writes the message instance to the stream using the content type provided
@@ -93,28 +75,6 @@ namespace Google.ProtocolBuffers.Serialization.Http
return codedOutput;
}
- /// <summary>
- /// Writes the message instance to the stream using the content type provided
- /// </summary>
- /// <param name="message">An instance of a message</param>
- /// <param name="options">Options specific to writing this message and/or content type</param>
- /// <param name="contentType">The mime type of the content to be written</param>
- /// <param name="output">The stream to write the message to</param>
- public static void WriteTo(this IMessageLite message, MessageFormatOptions options, string contentType, Stream output)
- {
- ICodedOutputStream codedOutput = CreateOutputStream(options, contentType, output);
-
- // Output the appropriate message preamble
- codedOutput.WriteMessageStart();
-
- // Write the message content to the output
- message.WriteTo(codedOutput);
-
- // Write the closing message fragment
- codedOutput.WriteMessageEnd();
- codedOutput.Flush();
- }
-
private static ICodedInputStream ContentTypeToInputStream(string contentType, MessageFormatOptions options, Stream input)
{
contentType = (contentType ?? String.Empty).Split(';')[0].Trim();