コード例 #1
0
 public static void WriteEntryTo(this RarReader reader, FileInfo filePath)
 {
     using (Stream stream = filePath.Open(FileMode.Create))
     {
         reader.WriteEntryTo(stream);
     }
 }
コード例 #2
0
 public static void WriteEntryTo(this RarReader reader, string filePath)
 {
     using (Stream stream = File.Open(filePath, FileMode.Create, FileAccess.Write))
     {
         reader.WriteEntryTo(stream);
     }
 }
コード例 #3
0
        /// <summary>
        /// Extract to specific file
        /// </summary>
        public static void WriteEntryToFile(this RarReader reader, string destinationFileName,
                                            ExtractOptions options = ExtractOptions.Overwrite)
        {
            FileMode fm = FileMode.Create;

            if (!options.HasFlag(ExtractOptions.Overwrite))
            {
                fm = FileMode.CreateNew;
            }
            using (FileStream fs = File.Open(destinationFileName, fm))
            {
                reader.WriteEntryTo(fs);
            }
        }