Description
https://learn.microsoft.com/en-us/dotnet/api/system.io.compression.deflatestream.basestream?view=net-7.0
https://learn.microsoft.com/en-us/dotnet/api/system.io.compression.gzipstream.basestream?view=net-7.0
https://learn.microsoft.com/en-us/dotnet/api/system.io.compression.brotlistream.basestream?view=net-7.0
The document says that getting BaseStream throws ObjectDisposedException when the underlying stream is closed. I believe the document is incorrect and current implement doesn't check the status of underlying stream. What I want to discuss here is what should BaseStream
return if the compressionStream itself is disposed:
a. Null. This is current behavior. If so, the property should be nullable.
b. Throws ObjectDisposedException.
c. The original underlying stream.
d. Undefined.
Some related facts:
The comments of BrotliStream.BaseStream
is backported from its document and the document is copied from GZipStream/DeflateStream's document.