Skip to content

Commit

Permalink
Update README.md - Correcting wrong descriptions (#91)
Browse files Browse the repository at this point in the history
Correcting wrong descriptions 
The `leaveOpen` means don't close/dispose the inner stream when
closing/disposing.
  • Loading branch information
mjebrahimi authored Jan 23, 2024
1 parent e4eb986 commit 0993527
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down
2 changes: 1 addition & 1 deletion Snappier/SnappyStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public SnappyStream(Stream stream, CompressionMode mode)
/// </summary>
/// <param name="stream">Source or destination stream.</param>
/// <param name="mode">Compression or decompression mode.</param>
/// <param name="leaveOpen">If true, close the stream when the SnappyStream is closed.</param>
/// <param name="leaveOpen">If true, leave the inner stream open when the SnappyStream is closed.</param>
/// <exception cref="ArgumentNullException"><paramref name="stream"/> is null.</exception>
/// <exception cref="ArgumentException">Stream read/write capability doesn't match with <paramref name="mode"/>.</exception>
/// <exception cref="ArgumentOutOfRangeException">Invalid <paramref name="mode"/>.</exception>
Expand Down

0 comments on commit 0993527

Please sign in to comment.