using System.IO; using System.IO.Compression; namespace GitConverter.Lib.Converters {     public static class ConverterUtils     {         // existing helpers…         public static bool TryOpenArchiveEntryStream(string zipPath, string entryRelativePath, out Stream stream)         {             stream = null;             try             {                 var zip = ZipFile.OpenRead(zipPath);                 // normalize separators inside zip to '/'                 var normalized = entryRelativePath.Replace('\', '/');                 var entry = zip.Entries.FirstOrDefault(e =>                     string.Equals(e.FullName, normalized, StringComparison.OrdinalIgnoreCase));                 if (entry == null) { zip.Dispose(); return false; }                 // IMPORTANT: we must keep zip open while the entry stream is used                 stream = new NonClosingStreamWrapper(entry.Open(), zip);                 return true;             }             catch { stream = null; return false; }         }         private sealed class NonClosingStreamWrapper : Stream         {             private readonly Stream inner;             private readonly ZipArchive owner;             public NonClosingStreamWrapper(Stream inner, ZipArchive owner) { inner = inner; owner = owner; }             public override bool CanRead => inner.CanRead;             public override bool CanSeek => inner.CanSeek;             public override bool CanWrite => inner.CanWrite;             public override long Length => inner.Length;             public override long Position { get => inner.Position; set => inner.Position = value; }             public override void Flush() => inner.Flush();             public override int Read(byte[] buffer, int offset, int count) => inner.Read(buffer, offset, count);             public override long Seek(long offset, SeekOrigin origin) => inner.Seek(offset, origin);             public override void SetLength(long value) => inner.SetLength(value);             public override void Write(byte[] buffer, int offset, int count) => inner.Write(buffer, offset, count);             protected override void Dispose(bool disposing)             {                 try { inner.Dispose(); } finally { _owner.Dispose(); }                 base.Dispose(disposing);             }         }     } } ``