Beispiel #1
0
 internal IEnumerable<SevenZipCompressionType> GetCompressions()
 {
     foreach (var coder in Coders)
     {
         var type = new SevenZipCompressionType();
         type.Coder = coder;
         if (coder.Method.Length == 3 && coder.Method[0] == 3 && coder.Method[1] == 1 && coder.Method[2] == 1)
         {
             type.CompressionType = CompressionType.LZMA;
         }
         else if (coder.Method.Length == 1 && coder.Method[0] == 33)
         {
             type.CompressionType = CompressionType.LZMA;
         }
         else if (coder.Method.Length == 3 && coder.Method[0] == 3 && coder.Method[1] == 4 && coder.Method[2] == 1)
         {
             type.CompressionType = CompressionType.PPMd;
         }
         else if (coder.Method.Length == 3 && coder.Method[0] == 4 && coder.Method[1] == 2 && coder.Method[2] == 2)
         {
             type.CompressionType = CompressionType.BZip2;
         }
         else if (coder.Method.Length == 4 && coder.Method[0] == 3 && coder.Method[1] == 3 && coder.Method[2] == 1 && coder.Method[3] == 3)
         {
             type.CompressionType = CompressionType.BCJ;
         }
         else if (coder.Method.Length == 4 && coder.Method[0] == 3 && coder.Method[1] == 3 && coder.Method[2] == 1 && coder.Method[3] == 0x1B)
         {
             type.CompressionType = CompressionType.BCJ2;
         }
         yield return type;
     }
 }
Beispiel #2
0
 internal IEnumerable <SevenZipCompressionType> GetCompressions()
 {
     foreach (var coder in Coders)
     {
         var type = new SevenZipCompressionType();
         type.Coder = coder;
         if (coder.Method.Length == 3 && coder.Method[0] == 3 && coder.Method[1] == 1 && coder.Method[2] == 1)
         {
             type.CompressionType = CompressionType.LZMA;
         }
         else if (coder.Method.Length == 1 && coder.Method[0] == 33)
         {
             type.CompressionType = CompressionType.LZMA;
         }
         else if (coder.Method.Length == 3 && coder.Method[0] == 3 && coder.Method[1] == 4 && coder.Method[2] == 1)
         {
             type.CompressionType = CompressionType.PPMd;
         }
         else if (coder.Method.Length == 3 && coder.Method[0] == 4 && coder.Method[1] == 2 && coder.Method[2] == 2)
         {
             type.CompressionType = CompressionType.BZip2;
         }
         else if (coder.Method.Length == 4 && coder.Method[0] == 3 && coder.Method[1] == 3 && coder.Method[2] == 1 && coder.Method[3] == 3)
         {
             type.CompressionType = CompressionType.BCJ;
         }
         else if (coder.Method.Length == 4 && coder.Method[0] == 3 && coder.Method[1] == 3 && coder.Method[2] == 1 && coder.Method[3] == 0x1B)
         {
             type.CompressionType = CompressionType.BCJ2;
         }
         yield return(type);
     }
 }