@@ -166,7 +166,7 @@ namespace Google.ProtocolBuffers
get
{
if (input != null)
- return input.Position - (bufferSize - bufferPos);
+ return input.Position - ((bufferSize + bufferSizeAfterLimit) - bufferPos);
return bufferPos;
}
@@ -125,7 +125,20 @@ namespace Google.ProtocolBuffers
#endregion
-
+
+ /// <summary>
+ /// Returns the current position in the stream, or the position in the output buffer
+ /// </summary>
+ public long Position
+ {
+ get
+ if (output != null)
+ return output.Position + position;
+ return position;
+ }
void ICodedOutputStream.WriteMessageStart() { }
void ICodedOutputStream.WriteMessageEnd() { Flush(); }