public void Zip_Deflate_Streamed_Skip()
 {
     using (Stream stream = new ForwardOnlyStream(File.OpenRead(Path.Combine(TEST_ARCHIVES_PATH, "Zip.deflate.dd.zip"))))
         using (IReader reader = ReaderFactory.Open(stream))
         {
             ResetScratch();
             int x = 0;
             while (reader.MoveToNextEntry())
             {
                 if (!reader.Entry.IsDirectory)
                 {
                     x++;
                     if (x % 2 == 0)
                     {
                         reader.WriteEntryToDirectory(SCRATCH_FILES_PATH,
                                                      new ExtractionOptions()
                         {
                             ExtractFullPath = true,
                             Overwrite       = true
                         });
                     }
                 }
             }
         }
 }
Exemple #2
0
        public void Issue_269_Double_Skip()
        {
            var path = Path.Combine(TEST_ARCHIVES_PATH, "PrePostHeaders.zip");

            using (Stream stream = new ForwardOnlyStream(File.OpenRead(path)))
                using (IReader reader = ReaderFactory.Open(stream))
                {
                    int count = 0;
                    while (reader.MoveToNextEntry())
                    {
                        count++;
                        if (!reader.Entry.IsDirectory)
                        {
                            if (count % 2 != 0)
                            {
                                reader.WriteEntryTo(Stream.Null);
                            }
                        }
                    }
                }
        }