This commit is contained in:
Adam Hathcock
2026-01-22 09:05:26 +00:00
parent db0bb8a30d
commit b9ed2b09c1
8 changed files with 27 additions and 19 deletions

View File

@@ -43,7 +43,10 @@ public class GZipEntry : Entry
yield return new GZipEntry(GZipFilePart.Create(stream, options.ArchiveEncoding));
}
internal static async IAsyncEnumerable<GZipEntry> GetEntriesAsync(Stream stream, OptionsBase options)
internal static async IAsyncEnumerable<GZipEntry> GetEntriesAsync(
Stream stream,
OptionsBase options
)
{
yield return new GZipEntry(await GZipFilePart.CreateAsync(stream, options.ArchiveEncoding));
}

View File

@@ -16,7 +16,7 @@ public abstract class Factory : IFactory
{
RegisterFactory(new ZipFactory());
RegisterFactory(new RarFactory());
RegisterFactory(new TarFactory());//put tar before most
RegisterFactory(new TarFactory()); //put tar before most
RegisterFactory(new GZipFactory());
RegisterFactory(new ArcFactory());
RegisterFactory(new ArjFactory());

View File

@@ -1,12 +1,11 @@
using System.IO;
using System.Threading;
namespace SharpCompress.Readers.GZip;
public partial class GZipReader
public partial class GZipReader
#if NET8_0_OR_GREATER
: IReaderOpenable
: IReaderOpenable
#endif
{
public static IAsyncReader OpenAsyncReader(
@@ -51,6 +50,7 @@ public partial class GZipReader
fileInfo.NotNull(nameof(fileInfo));
return OpenReader(fileInfo.OpenRead(), readerOptions);
}
public static IReader OpenReader(Stream stream, ReaderOptions? options = null)
{
stream.NotNull(nameof(stream));

View File

@@ -14,7 +14,9 @@ public partial class GZipReader : AbstractReader<GZipEntry, GZipVolume>
protected override IEnumerable<GZipEntry> GetEntries(Stream stream) =>
GZipEntry.GetEntries(stream, Options);
protected override IAsyncEnumerable<GZipEntry> GetEntriesAsync(Stream stream) {
protected override IAsyncEnumerable<GZipEntry> GetEntriesAsync(Stream stream)
{
return GZipEntry.GetEntriesAsync(stream, Options);
}
}