aboutsummaryrefslogtreecommitdiff
path: root/src/ProtocolBuffers
diff options
context:
space:
mode:
authorcsharptest <roger@csharptest.net>2011-09-09 12:18:16 -0500
committerrogerk <devnull@localhost>2011-09-09 12:18:16 -0500
commit60fd773d300cd0390ba08812590690ab2d28c837 (patch)
tree292994e6c5602566ed50d9911522f2e5e80515b1 /src/ProtocolBuffers
parent819b7154d162f3ef4f187f19b020f999c02fcf03 (diff)
downloadprotobuf-60fd773d300cd0390ba08812590690ab2d28c837.tar.gz
protobuf-60fd773d300cd0390ba08812590690ab2d28c837.tar.bz2
protobuf-60fd773d300cd0390ba08812590690ab2d28c837.zip
Completed work and testing for manually reading/writing start/end message
Diffstat (limited to 'src/ProtocolBuffers')
-rw-r--r--src/ProtocolBuffers/CodedInputStream.cs3
-rw-r--r--src/ProtocolBuffers/CodedOutputStream.cs3
-rw-r--r--src/ProtocolBuffers/ICodedInputStream.cs18
-rw-r--r--src/ProtocolBuffers/ICodedOutputStream.cs18
4 files changed, 42 insertions, 0 deletions
diff --git a/src/ProtocolBuffers/CodedInputStream.cs b/src/ProtocolBuffers/CodedInputStream.cs
index 509b4164..35ebba92 100644
--- a/src/ProtocolBuffers/CodedInputStream.cs
+++ b/src/ProtocolBuffers/CodedInputStream.cs
@@ -144,6 +144,9 @@ namespace Google.ProtocolBuffers
#endregion
+ void ICodedInputStream.ReadMessageStart() { }
+ void ICodedInputStream.ReadMessageEnd() { }
+
#region Validation
/// <summary>
diff --git a/src/ProtocolBuffers/CodedOutputStream.cs b/src/ProtocolBuffers/CodedOutputStream.cs
index bb133a77..560719af 100644
--- a/src/ProtocolBuffers/CodedOutputStream.cs
+++ b/src/ProtocolBuffers/CodedOutputStream.cs
@@ -136,6 +136,9 @@ namespace Google.ProtocolBuffers
}
}
+ void ICodedOutputStream.WriteMessageStart() { }
+ void ICodedOutputStream.WriteMessageEnd() { Flush(); }
+
#region Writing of unknown fields
[Obsolete]
diff --git a/src/ProtocolBuffers/ICodedInputStream.cs b/src/ProtocolBuffers/ICodedInputStream.cs
index 1d9d26e3..a3c0f30b 100644
--- a/src/ProtocolBuffers/ICodedInputStream.cs
+++ b/src/ProtocolBuffers/ICodedInputStream.cs
@@ -46,6 +46,24 @@ namespace Google.ProtocolBuffers
public interface ICodedInputStream
{
/// <summary>
+ /// Reads any message initialization data expected from the input stream
+ /// </summary>
+ /// <remarks>
+ /// This is primarily used by text formats and unnecessary for protobuffers' own
+ /// binary format. The API for MessageStart/End was added for consistent handling
+ /// of output streams regardless of the actual writer implementation.
+ /// </remarks>
+ void ReadMessageStart();
+ /// <summary>
+ /// Reads any message finalization data expected from the input stream
+ /// </summary>
+ /// <remarks>
+ /// This is primarily used by text formats and unnecessary for protobuffers' own
+ /// binary format. The API for MessageStart/End was added for consistent handling
+ /// of output streams regardless of the actual writer implementation.
+ /// </remarks>
+ void ReadMessageEnd();
+ /// <summary>
/// Attempt to read a field tag, returning false if we have reached the end
/// of the input data.
/// </summary>
diff --git a/src/ProtocolBuffers/ICodedOutputStream.cs b/src/ProtocolBuffers/ICodedOutputStream.cs
index 2c324792..a686fed1 100644
--- a/src/ProtocolBuffers/ICodedOutputStream.cs
+++ b/src/ProtocolBuffers/ICodedOutputStream.cs
@@ -52,6 +52,24 @@ namespace Google.ProtocolBuffers
public interface ICodedOutputStream : IDisposable
{
/// <summary>
+ /// Writes any message initialization data needed to the output stream
+ /// </summary>
+ /// <remarks>
+ /// This is primarily used by text formats and unnecessary for protobuffers' own
+ /// binary format. The API for MessageStart/End was added for consistent handling
+ /// of output streams regardless of the actual writer implementation.
+ /// </remarks>
+ void WriteMessageStart();
+ /// <summary>
+ /// Writes any message finalization data needed to the output stream
+ /// </summary>
+ /// <remarks>
+ /// This is primarily used by text formats and unnecessary for protobuffers' own
+ /// binary format. The API for MessageStart/End was added for consistent handling
+ /// of output streams regardless of the actual writer implementation.
+ /// </remarks>
+ void WriteMessageEnd();
+ /// <summary>
/// Indicates that all temporary buffers be written to the final output.
/// </summary>
void Flush();