From 1e22b47fe1f9ef71f64ff5dc62123f67a49132d2 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Fri, 31 Oct 2025 11:23:30 +0000 Subject: [PATCH] some fixes --- .../Compressors/LZMA/LZipStream.cs | 2 +- .../Compressors/LZMA/LzmaDecoder.cs | 29 +++---------------- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/src/SharpCompress/Compressors/LZMA/LZipStream.cs b/src/SharpCompress/Compressors/LZMA/LZipStream.cs index 9b6eef57..e7059003 100644 --- a/src/SharpCompress/Compressors/LZMA/LZipStream.cs +++ b/src/SharpCompress/Compressors/LZMA/LZipStream.cs @@ -197,7 +197,7 @@ public sealed class LZipStream : Stream, IStreamStack byte[] buffer, int offset, int count, - CancellationToken cancellationToken = default + CancellationToken cancellationToken ) { cancellationToken.ThrowIfCancellationRequested(); diff --git a/src/SharpCompress/Compressors/LZMA/LzmaDecoder.cs b/src/SharpCompress/Compressors/LZMA/LzmaDecoder.cs index 4baa9061..1de9dc2f 100644 --- a/src/SharpCompress/Compressors/LZMA/LzmaDecoder.cs +++ b/src/SharpCompress/Compressors/LZMA/LzmaDecoder.cs @@ -1,6 +1,7 @@ #nullable disable using System; +using System.Diagnostics.CodeAnalysis; using System.IO; using SharpCompress.Compressors.LZMA.LZ; using SharpCompress.Compressors.LZMA.RangeCoder; @@ -199,6 +200,9 @@ public class Decoder : ICoder, ISetDecoderProperties // ,System.IO.Stream } } +#if !NETFRAMEWORK && !NETSTANDARD2_0 + [MemberNotNull(nameof(_outWindow))] +#endif private void CreateDictionary() { if (_dictionarySize < 0) @@ -470,29 +474,4 @@ public class Decoder : ICoder, ISetDecoderProperties // ,System.IO.Stream } _outWindow.Train(stream); } - - /* - public override bool CanRead { get { return true; }} - public override bool CanWrite { get { return true; }} - public override bool CanSeek { get { return true; }} - public override long Length { get { return 0; }} - public override long Position - { - get { return 0; } - set { } - } - public override void Flush() { } - public override int Read(byte[] buffer, int offset, int count) - { - return 0; - } - public override void Write(byte[] buffer, int offset, int count) - { - } - public override long Seek(long offset, System.IO.SeekOrigin origin) - { - return 0; - } - public override void SetLength(long value) {} - */ }