-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Open
Labels
Milestone
Description
This is related to overloads for classes which rely on DeflateStream and expose a CompressionLevel setting (here's a list for reference). Case in point: #1437.
I've been working on a project and kept wondering why GZipStream in particular would compress anything with the CompressionLevel set to None. A trip down to deflate revealed that it's just ignored:
// snip
public DeflateStream(Stream stream, CompressionLevel compressionLevel, bool leaveOpen)
: this(stream, compressionLevel, leaveOpen, false)
{
}
// snip
internal DeflateStream(Stream stream, CompressionLevel compressionLevel, bool leaveOpen, bool gzip)
: this(stream, CompressionMode.Compress, leaveOpen, gzip)
{
// ... what?
}Is there ... a technical reason for this? IMO the overload is really misleading. Compared to the MS API, this is a "breaking" change, is this documented somewhere?