public SevenZipOutFileStream(FileInfo aFile, long aSize, ThreadIOPriority aPriority) : base(aFile, FileMode.Create, FileAccess.ReadWrite, WRITE_BUFFER_SIZE) { file = aFile; fileSize = aSize; if (fileSize > 0) { stream.SetLength(fileSize); stream.Flush(); } if (fileSize > BUFFER_SIZE) { lp = new IOPriority(aPriority); } }
public override void Dispose() { base.Dispose(); if (lp != null) { lp.Dispose(); lp = null; } if (!ok) { try { file.Delete(); } catch (Exception) { } } }