Пример #1
0
        /// <summary>
        /// Constructor with a FileInfo object to an existing file.
        /// </summary>
        /// <param name="filePath"></param>
        /// <param name="options"></param>
        public static RarArchive Open(string filePath, ReaderOptions?options = null)
        {
            filePath.CheckNotNullOrEmpty(nameof(filePath));
            FileInfo fileInfo = new FileInfo(filePath);

            return(new RarArchive(new SourceStream(fileInfo, i => RarArchiveVolumeFactory.GetFilePart(i, fileInfo), options ?? new ReaderOptions())));
        }
Пример #2
0
 protected override IEnumerable<RarVolume> LoadVolumes(IEnumerable<Stream> streams)
 {
     return RarArchiveVolumeFactory.GetParts(streams, ReaderOptions);
 }
Пример #3
0
 protected override IEnumerable<RarVolume> LoadVolumes(FileInfo file)
 {
     return RarArchiveVolumeFactory.GetParts(file, ReaderOptions);
 }
Пример #4
0
 /// <summary>
 /// Constructor with a FileInfo object to an existing file.
 /// </summary>
 /// <param name="fileInfo"></param>
 /// <param name="options"></param>
 public static RarArchive Open(FileInfo fileInfo, ReaderOptions?options = null)
 {
     fileInfo.CheckNotNull(nameof(fileInfo));
     return(new RarArchive(new SourceStream(fileInfo, i => RarArchiveVolumeFactory.GetFilePart(i, fileInfo), options ?? new ReaderOptions())));
 }