Exemplo n.º 1
0
 public static void processFile(IEnumerable<string> fileNameList, Stream zipFile, int compressionAmount, string password, Stream[] fileStreamList)
 {
     if (compressionAmount >= 0 && compressionAmount <= 9)
     {
         Class192 @class = new Class192();
         Stream23 stream = new Stream23(zipFile);
         stream.method_6(compressionAmount);
         if (password != null)
         {
             stream.method_2(password);
         }
         int num = 0;
         using (IEnumerator<string> enumerator = fileNameList.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 string current = enumerator.Current;
                 Class193 class2 = new Class193(current);
                 class2.method_19(DateTime.Now);
                 Stream stream2 = fileStreamList[num++];
                 byte[] array;
                 if (stream2 is MemoryStream)
                 {
                     array = (stream2 as MemoryStream).ToArray();
                 }
                 else
                 {
                     array = new byte[stream2.Length];
                     int num2 = stream2.Read(array, 0, array.Length);
                     if (num2 < array.Length)
                     {
                         Array.Resize<byte>(ref array, num2);
                     }
                 }
                 class2.method_22((long)array.Length);
                 @class.vmethod_1();
                 @class.vmethod_2(array);
                 class2.method_26(@class.vmethod_0());
                 stream.method_10(class2);
                 stream.Write(array, 0, array.Length);
             }
             goto IL_10D;
         }
         goto IL_102;
         IL_10D:
         stream.vmethod_0();
         stream.Close();
         return;
     }
     IL_102:
     throw new ArgumentException("Invalid compression rate.");
 }
Exemplo n.º 2
0
        public static void processFile(IEnumerable <string> fileNameList, Stream zipFile, int compressionAmount, string password, Stream[] fileStreamList)
        {
            if (compressionAmount >= 0 && compressionAmount <= 9)
            {
                Class192 @class = new Class192();
                Stream23 stream = new Stream23(zipFile);
                stream.method_6(compressionAmount);
                if (password != null)
                {
                    stream.method_2(password);
                }
                int num = 0;
                using (IEnumerator <string> enumerator = fileNameList.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        string   current = enumerator.Current;
                        Class193 class2  = new Class193(current);
                        class2.method_19(DateTime.Now);
                        Stream stream2 = fileStreamList[num++];
                        byte[] array;
                        if (stream2 is MemoryStream)
                        {
                            array = (stream2 as MemoryStream).ToArray();
                        }
                        else
                        {
                            array = new byte[stream2.Length];
                            int num2 = stream2.Read(array, 0, array.Length);
                            if (num2 < array.Length)
                            {
                                Array.Resize <byte>(ref array, num2);
                            }
                        }
                        class2.method_22((long)array.Length);
                        @class.vmethod_1();
                        @class.vmethod_2(array);
                        class2.method_26(@class.vmethod_0());
                        stream.method_10(class2);
                        stream.Write(array, 0, array.Length);
                    }
                    goto IL_10D;
                }
                goto IL_102;
IL_10D:
                stream.vmethod_0();
                stream.Close();
                return;
            }
IL_102:
            throw new ArgumentException("Invalid compression rate.");
        }