public static void FetchAllFromFile(string blubbzipFilePath, string blubbzipPassword, EFastBlubbZipLoadType loadType, out Dictionary<int, Stream> StreamList, out Dictionary<int, string> FileList, out Dictionary<int, BlubbZipEntry> EntryList) { FileList = new Dictionary<int, string>(); StreamList = new Dictionary<int, Stream>(); EntryList = new Dictionary<int, BlubbZipEntry>(); if (File.Exists(blubbzipFilePath) == false) throw new Exception("File not Found!\n" + blubbzipFilePath); using (FileStream fs = File.OpenRead(blubbzipFilePath)) { BlubbZipFile blubb = new BlubbZipFile(fs); blubb.Password = blubbzipPassword; for (int cz = 0; cz < blubb.Count; cz++) { if (blubb[cz].IsFile == false) continue; if ((loadType & EFastBlubbZipLoadType.Streams) > 0) StreamList.Add(cz, blubb.GetInputStream(cz)); if ((loadType & EFastBlubbZipLoadType.FileList) > 0) FileList.Add(cz, blubb[cz].Name.ToString().Replace("/", @"\")); if ((loadType & EFastBlubbZipLoadType.Entrys) > 0) EntryList.Add(cz, blubb[cz].Clone() as BlubbZipEntry); } blubb.Close(); } }
public static void FetchAllFromFile(string blubbzipFilePath, string blubbzipPassword, EFastBlubbZipLoadType loadType, out Dictionary <int, Stream> StreamList, out Dictionary <int, string> FileList, out Dictionary <int, BlubbZipEntry> EntryList) { FileList = new Dictionary <int, string>(); StreamList = new Dictionary <int, Stream>(); EntryList = new Dictionary <int, BlubbZipEntry>(); if (File.Exists(blubbzipFilePath) == false) { throw new Exception("File not Found!\n" + blubbzipFilePath); } using (FileStream fs = File.OpenRead(blubbzipFilePath)) { BlubbZipFile blubb = new BlubbZipFile(fs); blubb.Password = blubbzipPassword; for (int cz = 0; cz < blubb.Count; cz++) { if (blubb[cz].IsFile == false) { continue; } if ((loadType & EFastBlubbZipLoadType.Streams) > 0) { StreamList.Add(cz, blubb.GetInputStream(cz)); } if ((loadType & EFastBlubbZipLoadType.FileList) > 0) { FileList.Add(cz, blubb[cz].Name.ToString().Replace("/", @"\")); } if ((loadType & EFastBlubbZipLoadType.Entrys) > 0) { EntryList.Add(cz, blubb[cz].Clone() as BlubbZipEntry); } } blubb.Close(); } }