Commit 0a0dd033 authored by csharptest's avatar csharptest Committed by rogerk

Fix for bug in limited input stream's Position, Introduced Position on output stream

parent 8c8a82a2
...@@ -166,7 +166,7 @@ namespace Google.ProtocolBuffers ...@@ -166,7 +166,7 @@ namespace Google.ProtocolBuffers
get get
{ {
if (input != null) if (input != null)
return input.Position - (bufferSize - bufferPos); return input.Position - ((bufferSize + bufferSizeAfterLimit) - bufferPos);
return bufferPos; return bufferPos;
} }
} }
......
...@@ -125,7 +125,20 @@ namespace Google.ProtocolBuffers ...@@ -125,7 +125,20 @@ namespace Google.ProtocolBuffers
} }
#endregion #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.WriteMessageStart() { }
void ICodedOutputStream.WriteMessageEnd() { Flush(); } void ICodedOutputStream.WriteMessageEnd() { Flush(); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment