• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #region Copyright notice and license
2 // Protocol Buffers - Google's data interchange format
3 // Copyright 2008 Google Inc.  All rights reserved.
4 //
5 // Use of this source code is governed by a BSD-style
6 // license that can be found in the LICENSE file or at
7 // https://developers.google.com/open-source/licenses/bsd
8 #endregion
9 
10 namespace Google.Protobuf
11 {
12     // warning: this is a mutable struct, so it needs to be only passed as a ref!
13     internal struct WriterInternalState
14     {
15         // NOTE: the Span representing the current buffer is kept separate so that this doesn't have to be a ref struct and so it can
16         // be included in CodedOutputStream's internal state
17 
18         internal int limit;  // the size of the current buffer
19         internal int position;  // position in the current buffer
20 
21         internal WriteBufferHelper writeBufferHelper;
22 
23         // If non-null, the top level parse method was started with given coded output stream as an argument
24         // which also means we can potentially fallback to calling WriteTo(CodedOutputStream cos) if needed.
25         internal CodedOutputStream CodedOutputStream => writeBufferHelper.CodedOutputStream;
26     }
27 }