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

pull/288/head
csharptest 12 years ago committed by rogerk
parent 8c8a82a260
commit 0a0dd0333a
  1. 2
      src/ProtocolBuffers/CodedInputStream.cs
  2. 15
      src/ProtocolBuffers/CodedOutputStream.cs

@ -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(); }

Loading…
Cancel
Save