# System.IO.Pipelines

``` diff
 namespace System.IO.Pipelines {
     public abstract class PipeReader {
-        public virtual Stream AsStream();

+        public virtual Stream AsStream(bool leaveOpen = false);
+        public virtual Task CopyToAsync(PipeWriter destination, CancellationToken cancellationToken = default(CancellationToken));
     }
     public abstract class PipeWriter : IBufferWriter<byte> {
-        public virtual Stream AsStream();

+        public virtual Stream AsStream(bool leaveOpen = false);
     }
     public class StreamPipeReaderOptions {
-        public StreamPipeReaderOptions(MemoryPool<byte> pool = null, int bufferSize = 4096, int minimumReadSize = 1024);

+        public StreamPipeReaderOptions(MemoryPool<byte> pool = null, int bufferSize = 4096, int minimumReadSize = 1024, bool leaveOpen = false);
+        public bool LeaveOpen { get; }
     }
     public class StreamPipeWriterOptions {
-        public StreamPipeWriterOptions(MemoryPool<byte> pool = null, int minimumBufferSize = 4096);

+        public StreamPipeWriterOptions(MemoryPool<byte> pool = null, int minimumBufferSize = 4096, bool leaveOpen = false);
+        public bool LeaveOpen { get; }
     }
 }
```

