17 using System.IO.Compression;
27 private readonly ZipArchive _archive;
28 private readonly StreamWriter _writer;
46 if(!File.Exists(filename))
48 _archive = ZipFile.Open(filename, ZipArchiveMode.Create);
49 var entry = _archive.CreateEntry(zipEntry);
50 _writer =
new StreamWriter(entry.Open());
54 _archive = ZipFile.Open(filename, ZipArchiveMode.Update);
55 var entry = _archive.GetEntry(zipEntry);
56 var nonExisting = entry ==
null;
59 entry = _archive.CreateEntry(zipEntry);
61 _writer =
new StreamWriter(entry.Open());
66 _writer.BaseStream.Seek(0L, SeekOrigin.End);
78 public override void Write(
char value)
92 _writer.WriteLine(value);
107 protected override void Dispose(
bool disposing)
109 if (_writer ==
null || !disposing)