public void Decompress(QizFileStream outputStream) { if (this.IsFolder) { return; } this.OutputStream = outputStream; this.archive.Extract(new[] { this.index }, 1, 0, this); //避免解压生成的文件大小为0的问题 this.OutputStream.BaseStream.Flush(); }
public void Decompress(string outputFilePath, bool preserveTimestamp = true) { if (this.IsFolder) { Directory.CreateDirectory(outputFilePath); return; } string directoryName = Path.GetDirectoryName(outputFilePath); if (!string.IsNullOrWhiteSpace(directoryName)) { Directory.CreateDirectory(directoryName); } this.OutputStream = new QizFileStream(outputFilePath, FileMode.Create, FileAccess.ReadWrite); this.archive.Extract(new[] { this.index }, 1, 0, this); //避免解压生成的文件大小为0的问题 this.OutputStream.Close(); if (preserveTimestamp) { File.SetLastWriteTime(outputFilePath, this.LastWriteTime); } }