From ecbb29d3548f93b2cb34e381ec8dbd7727c5680e Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 3 Jun 2020 14:22:40 +0200 Subject: [PATCH] add WriteContext.Flush() method --- csharp/src/Google.Protobuf/WriteContext.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/csharp/src/Google.Protobuf/WriteContext.cs b/csharp/src/Google.Protobuf/WriteContext.cs index c92bced132..c4d0343e47 100644 --- a/csharp/src/Google.Protobuf/WriteContext.cs +++ b/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;