Explorar o código

add WriteContext.Flush() method

Jan Tattermusch %!s(int64=5) %!d(string=hai) anos
pai
achega
ecbb29d354
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      csharp/src/Google.Protobuf/WriteContext.cs

+ 6 - 0
csharp/src/Google.Protobuf/WriteContext.cs

@@ -338,6 +338,12 @@ namespace Google.Protobuf
             WritingPrimitives.WriteRawTag(ref buffer, ref state, b1, b2, b3, b4, b5);
         }
 
+        internal void Flush()
+        {
+            // TODO: should the method be static or not?
+            state.writeBufferHelper.Flush(ref buffer, ref state);
+        }
+
         internal void CopyStateTo(CodedOutputStream output)
         {
             output.InternalState = state;