From 099352778270cab47b204a442c62fa5d7c878645 Mon Sep 17 00:00:00 2001 From: Mohammad Javad Ebrahimi Date: Tue, 23 Jan 2024 16:16:04 +0330 Subject: [PATCH] Update README.md - Correcting wrong descriptions (#91) Correcting wrong descriptions The `leaveOpen` means don't close/dispose the inner stream when closing/disposing. --- README.md | 4 ++-- Snappier/SnappyStream.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 79d50a0..7e5d8c7 100644 --- a/README.md +++ b/README.md @@ -136,11 +136,11 @@ public class Program // First, compression using var compressed = new MemoryStream(); - using (var compressor = new SnappyStream(compressed, CompressionMode.Compress, false)) { + using (var compressor = new SnappyStream(compressed, CompressionMode.Compress, true)) { await fileStream.CopyToAsync(compressor); // Disposing the compressor also flushes the buffers to the inner stream - // We pass false to the constructor above so that it doesn't dispose the inner stream + // We pass true to the constructor above so that it doesn't close/dispose the inner stream // Alternatively, we could call compressor.Flush() } diff --git a/Snappier/SnappyStream.cs b/Snappier/SnappyStream.cs index 8b03e1e..37367a4 100644 --- a/Snappier/SnappyStream.cs +++ b/Snappier/SnappyStream.cs @@ -51,7 +51,7 @@ public SnappyStream(Stream stream, CompressionMode mode) /// /// Source or destination stream. /// Compression or decompression mode. - /// If true, close the stream when the SnappyStream is closed. + /// If true, leave the inner stream open when the SnappyStream is closed. /// is null. /// Stream read/write capability doesn't match with . /// Invalid .