From 99b92ab09937879d70c06ffe03b18f3b725c9d19 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Wed, 11 Dec 2019 08:21:38 -0700 Subject: [PATCH 1/2] Document caution regarding AdvanceTo's side effect After calling `PipeReader.AdvanceTo`, the `ReadResult.Buffer` property's backing data is recycled, leading to indeterministic changes to not only the content but its `Length` property. This isn't particular predictable as a consumer and the docs didn't make it clear either. --- xml/System.IO.Pipelines/PipeReader.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/System.IO.Pipelines/PipeReader.xml b/xml/System.IO.Pipelines/PipeReader.xml index 63814a2fbf0..2ba575014ed 100644 --- a/xml/System.IO.Pipelines/PipeReader.xml +++ b/xml/System.IO.Pipelines/PipeReader.xml @@ -53,7 +53,7 @@ ## Remarks -The memory for the consumed data will be released and no longer available. The examined data communicates to the pipeline when it should signal more data is available. +The memory for the consumed data will be released and no longer available. The `ReadResult.Buffer` previously returned from `ReadAsync(CancellationToken)` must not be accessed after this call. The examined data communicates to the pipeline when it should signal more data is available. ]]> From ea22fa2852c5e80404669a2f7e8d90f41a17ef63 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 12 Dec 2019 08:31:04 -0700 Subject: [PATCH 2/2] Use xref's Co-Authored-By: Bill Wagner --- xml/System.IO.Pipelines/PipeReader.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/System.IO.Pipelines/PipeReader.xml b/xml/System.IO.Pipelines/PipeReader.xml index 2ba575014ed..5399c948f9a 100644 --- a/xml/System.IO.Pipelines/PipeReader.xml +++ b/xml/System.IO.Pipelines/PipeReader.xml @@ -53,7 +53,7 @@ ## Remarks -The memory for the consumed data will be released and no longer available. The `ReadResult.Buffer` previously returned from `ReadAsync(CancellationToken)` must not be accessed after this call. The examined data communicates to the pipeline when it should signal more data is available. +The memory for the consumed data will be released and no longer available. The previously returned from must not be accessed after this call. The examined data communicates to the pipeline when it should signal more data is available. ]]>