public void LengthCorrectAfterAllocAdvanceCommit() { PipeWriter writableBuffer = _pipe.Writer.WriteEmpty(10); writableBuffer.Commit(); Assert.Equal(10, _pipe.Length); }
// Must be called with _writeLock private void Append(ArraySegment <byte> data) { if (_completed) { return; } _outputWriter.Write(data); _outputWriter.Commit(); }
public void LengthNotChangeAfterReadAdvanceExamine() { PipeWriter writableBuffer = _pipe.Writer.WriteEmpty(10); writableBuffer.Commit(); writableBuffer.FlushAsync(); ReadResult result = _pipe.Reader.ReadAsync().GetResult(); _pipe.Reader.AdvanceTo(result.Buffer.Start, result.Buffer.End); Assert.Equal(10, _pipe.Length); }