public ZipEntryViewModel(ZipFileInfo parent, ZipArchiveEntry e)
        {
            this.parent = parent;
            totalSize   = e.Size;
            Name        = e.Key;
            getStream   = new Lazy <Stream>(delegate
            {
                var transferList = parent.GetTransferList();
                using (var srcStream = e.OpenEntryStream())
                {
                    if (Name.EndsWith(".new.dat"))
                    {
                        return(new BlockImgStream(srcStream, transferList));
                    }
                    if (Name.EndsWith(".new.dat.br"))
                    {
                        return(new BlockImgStream(
                                   new BrotliStream(srcStream, CompressionMode.Decompress), transferList));
                    }

                    return(TempFileStream.CreateFrom(srcStream, done => FileInfoBase.ReportProgress(done, totalSize)));
                }
            });
        }
Example #2
0
 public SharpCompressZipArchiveEntry(SharpCompress.Archives.Zip.ZipArchiveEntry entry)
 {
     BaseEntry = entry;
 }