Example #1
0
 /// <summary>
 /// Constructor with a FileInfo object to an existing file.
 /// </summary>
 /// <param name="fileInfo"></param>
 /// <param name="options"></param>
 internal RarArchive(FileInfo fileInfo, RarOptions options)
 {
     if (!fileInfo.Exists)
     {
         throw new ArgumentException("File does not exist: " + fileInfo.FullName);
     }
     lazyVolumes = new LazyReadOnlyCollection <RarArchiveVolume>(RarArchiveVolumeFactory.GetParts(fileInfo, options));
     lazyEntries = new LazyReadOnlyCollection <RarArchiveEntry>(RarArchiveEntry.GetEntries(this, Volumes));
 }
Example #2
0
 /// <summary>
 /// Takes multiple seekable Streams for a multi-part archive
 /// </summary>
 /// <param name="streams"></param>
 /// <param name="options"></param>
 internal RarArchive(IEnumerable <Stream> streams, RarOptions options)
 {
     lazyVolumes = new LazyReadOnlyCollection <RarArchiveVolume>(RarArchiveVolumeFactory.GetParts(streams, options));
     lazyEntries = new LazyReadOnlyCollection <RarArchiveEntry>(RarArchiveEntry.GetEntries(this, Volumes));
 }