diff --git a/src/SharpCompress/IO/ProgressReportingStream.cs b/src/SharpCompress/IO/ProgressReportingStream.cs index 8bb45092..af768462 100644 --- a/src/SharpCompress/IO/ProgressReportingStream.cs +++ b/src/SharpCompress/IO/ProgressReportingStream.cs @@ -38,7 +38,7 @@ internal sealed class ProgressReportingStream : Stream public override bool CanSeek => _baseStream.CanSeek; - public override bool CanWrite => _baseStream.CanWrite; + public override bool CanWrite => false; public override long Length => _baseStream.Length; @@ -122,7 +122,9 @@ internal sealed class ProgressReportingStream : Stream public override void SetLength(long value) => _baseStream.SetLength(value); public override void Write(byte[] buffer, int offset, int count) => - _baseStream.Write(buffer, offset, count); + throw new NotSupportedException( + "ProgressReportingStream is designed for read operations to track compression progress." + ); private void ReportProgress() {