public static void WriteEntryTo(this RarReader reader, FileInfo filePath) { using (Stream stream = filePath.Open(FileMode.Create)) { reader.WriteEntryTo(stream); } }
public static void WriteEntryTo(this RarReader reader, string filePath) { using (Stream stream = File.Open(filePath, FileMode.Create, FileAccess.Write)) { reader.WriteEntryTo(stream); } }
/// <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); } }