diff --git a/src/SharpCompress/Readers/Zip/ZipReader.Factory.cs b/src/SharpCompress/Readers/Zip/ZipReader.Factory.cs index c2ede05c..4a2b18f8 100644 --- a/src/SharpCompress/Readers/Zip/ZipReader.Factory.cs +++ b/src/SharpCompress/Readers/Zip/ZipReader.Factory.cs @@ -1,13 +1,41 @@ -#if NET8_0_OR_GREATER + +using System.Collections.Generic; using System.IO; using System.Threading; using System.Threading.Tasks; -using SharpCompress.Common; +using SharpCompress.Common.Zip; namespace SharpCompress.Readers.Zip; -public partial class ZipReader : IReaderOpenable +public partial class ZipReader +#if NET8_0_OR_GREATER + : IReaderOpenable +#endif { + + + /// + /// Opens a ZipReader for Non-seeking usage with a single volume + /// + /// + /// + /// + public static IZipReader OpenReader(Stream stream, ReaderOptions? readerOptions = null) + { + stream.NotNull(nameof(stream)); + return new ZipReader(stream, readerOptions ?? new ReaderOptions()); + } + + public static IZipReader OpenReader( + Stream stream, + ReaderOptions? options, + IEnumerable entries + ) + { + stream.NotNull(nameof(stream)); + return new ZipReader(stream, options ?? new ReaderOptions(), entries); + } + public static ValueTask OpenAsyncReader( string path, ReaderOptions? readerOptions = null, @@ -51,4 +79,3 @@ public partial class ZipReader : IReaderOpenable return OpenReader(fileInfo.OpenRead(), readerOptions); } } -#endif diff --git a/src/SharpCompress/Readers/Zip/ZipReader.cs b/src/SharpCompress/Readers/Zip/ZipReader.cs index be8d5143..22be2278 100644 --- a/src/SharpCompress/Readers/Zip/ZipReader.cs +++ b/src/SharpCompress/Readers/Zip/ZipReader.cs @@ -37,31 +37,6 @@ public partial class ZipReader : AbstractReader, IZipReader public override ZipVolume Volume { get; } - #region Open - - /// - /// Opens a ZipReader for Non-seeking usage with a single volume - /// - /// - /// - /// - public static IZipReader OpenReader(Stream stream, ReaderOptions? readerOptions = null) - { - stream.NotNull(nameof(stream)); - return new ZipReader(stream, readerOptions ?? new ReaderOptions()); - } - - public static IZipReader OpenReader( - Stream stream, - ReaderOptions? options, - IEnumerable entries - ) - { - stream.NotNull(nameof(stream)); - return new ZipReader(stream, options ?? new ReaderOptions(), entries); - } - - #endregion Open protected override IEnumerable GetEntries(Stream stream) {