Exemplo n.º 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())));
        }
Exemplo n.º 2
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())));
 }