Override WriteAsync on the DefaultPipeWriter (dotnet/corefx#35484)
authorDavid Fowler <davidfowl@gmail.com>
Thu, 21 Feb 2019 23:31:23 +0000 (15:31 -0800)
committerGitHub <noreply@github.com>
Thu, 21 Feb 2019 23:31:23 +0000 (15:31 -0800)
commit2b0191a4106635b56aa66c843a527d7e6431607b
tree42c6b4bb46b9cea05cb32e05aa256a8b45db5a9d
parent7b7d89076e04232ea60261d1c782d27e52edd505
Override WriteAsync on the DefaultPipeWriter (dotnet/corefx#35484)

- Today we're using an extension method on IBufferWrite<T> to implement
copying the input buffer to the underlying PipeWriter. Luckily this
method is virtual so we can optimize using the Pipe's internal structures
directly rather than going through GetMemory and Advance

Commit migrated from https://github.com/dotnet/corefx/commit/a0bbeb7f2143a063eb5e944026787974362c8b3d
src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/Pipe.DefaultPipeWriter.cs
src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/Pipe.cs
src/libraries/System.IO.Pipelines/tests/PipePoolTests.nonnetstandard.cs
src/libraries/System.IO.Pipelines/tests/PipeWriterTests.cs