public static IEnumerable <CompressedFileInfo> Entries(Stream stream, IProgress prog = null) { if (stream is GZipStream gzStream) { using var tar = new TarArchive(gzStream); return(tar.Entries(prog)); } else { using var gzStream2 = new GZipStream(stream, CompressionMode.Decompress); using var tar = new TarArchive(gzStream2); return(tar.Entries(prog)); } }