protected override Stream DoGetFileStream(string path)
{
var file = FindFileInfo(path);
if (file == null)
{
throw new InvalidOperationException("File not found in archive: " + path);
}
Stream stream = new FileStream(ArchivePath, FileMode.Open, FileAccess.Read);
stream.Position = file.DataOffset;
if (file.DataCompressedSize > 0)
{
return new CustomDeflateStream(stream, file.DataUncompressedSize);
}
else
{
return new ArchiveSubstream(stream, file.DataUncompressedSize);
}
}