LoadNamespaces() public method

public LoadNamespaces ( IEnumerable data ) : void
data IEnumerable
return void
Beispiel #1
0
 public static bool LoadNamespaces(Wiki wiki, string filename)
 {
     if (!File.Exists(filename))
     {
         return false;
     }
     using (FileStream fs = new FileStream(filename, FileMode.Open))
     using (GZipStream gs = new GZipStream(fs, CompressionMode.Decompress))
     using (BinaryReader sr = new BinaryReader(gs))
     {
         List<byte> data = new List<byte>();
         int b;
         while ((b = sr.BaseStream.ReadByte()) != -1)
         {
             data.Add((byte)b);
         }
         wiki.LoadNamespaces(data);
     }
     return true;
 }