739. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 10/18/2018 2:02:09 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

739.1 Files compared

# Location File Last Modified
1 VIX_SIV_v3_0_patch_201_build_8.zip\v3.0_patch_201_build_8\common\ZFViewerServices\ViewerRender-2.2.6841.19565.zip\VIX.Viewer.Service Ionic.Zip.xml Mon Sep 24 17:06:24 2018 UTC
2 VIX_SIV_v3_0_patch_201_build_8.zip\v3.0_patch_201_build_8\common\ZFViewerServices\ViewerRender-2.2.6841.19565.zip\VIX.Viewer.Service Ionic.Zip.xml Wed Oct 17 17:00:06 2018 UTC

739.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 15 75720
Changed 14 28
Inserted 0 0
Removed 0 0

739.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

739.4 Active regular expressions

No regular expressions were active.

739.5 Comparison detail

  1   <?xml 
  2     version="1 .0"
  3   ?>
  4   <doc>
  5         
  6     <assembly>
  7              
  8      <name>
  9       Ionic.Zip
  10      </name>
  11          
  12     </assembly >
  13         
  14     <members>
  15              
  16      <member 
  17       name="T:Io nic.Zip.Zi pEntrySour ce"
  18      >
  19                    
  20       <summary>
  21                     An enum  that speci fies the s ource of t he ZipEntr y. 
  22                     
  23       </summary>
  24               
  25      </member>
  26              
  27      <member 
  28       name="F:Io nic.Zip.Zi pEntrySour ce.None"
  29      >
  30                    
  31       <summary>
  32                     Default  value.  In valid on a  bonafide  ZipEntry.
  33                     
  34       </summary>
  35               
  36      </member>
  37              
  38      <member 
  39       name="F:Io nic.Zip.Zi pEntrySour ce.FileSys tem"
  40      >
  41                    
  42       <summary>
  43                     The entr y was inst antiated b y calling  AddFile()  or another  method th at 
  44                     added an  entry fro m the file system.
  45                     
  46       </summary>
  47               
  48      </member>
  49              
  50      <member 
  51       name="F:Io nic.Zip.Zi pEntrySour ce.Stream"
  52      >
  53                    
  54       <summary>
  55                     The entr y was inst antiated v ia 
  56        <see 
  57         cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,S ystem.Stri ng)"
  58        />
  59         or
  60                     
  61        <see 
  62         cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,S ystem.IO.S tream)"
  63        />
  64         .
  65                     
  66       </summary>
  67               
  68      </member>
  69              
  70      <member 
  71       name="F:Io nic.Zip.Zi pEntrySour ce.ZipFile "
  72      >
  73                    
  74       <summary>
  75                     The ZipE ntry was i nstantiate d by readi ng a zipfi le.
  76                     
  77       </summary>
  78               
  79      </member>
  80              
  81      <member 
  82       name="F:Io nic.Zip.Zi pEntrySour ce.WriteDe legate"
  83      >
  84                    
  85       <summary>
  86                     The cont ent for th e ZipEntry  will be o r was prov ided by th e WriteDel egate.
  87                     
  88       </summary>
  89               
  90      </member>
  91              
  92      <member 
  93       name="F:Io nic.Zip.Zi pEntrySour ce.JitStre am"
  94      >
  95                    
  96       <summary>
  97                     The cont ent for th e ZipEntry  will be o btained fr om the str eam dispen sed by the  
  98        <c>
  99         OpenDelega te
  100        </c>
  101        .
  102                     The entr y was inst antiated v ia 
  103        <see 
  104         cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,I onic.Zip.O penDelegat e,Ionic.Zi p.CloseDel egate)"
  105        />
  106        .
  107                     
  108       </summary>
  109               
  110      </member>
  111              
  112      <member 
  113       name="F:Io nic.Zip.Zi pEntrySour ce.ZipOutp utStream"
  114      >
  115                    
  116       <summary>
  117                     The cont ent for th e ZipEntry  will be o r was obta ined from 
  118        <c>
  119         ZipOutputS tream
  120        </c>
  121        .
  122                     
  123       </summary>
  124               
  125      </member>
  126              
  127      <member 
  128       name="T:Io nic.Zip.Zi pOutputStr eam"
  129      >
  130                     
  131       <summary>
  132                        Provi des a stre am metapho r for gene rating zip  files.
  133                      
  134       </summary>
  135                    
  136                     
  137       <remarks>
  138                      
  139        <para>
  140                         This  class writ es zip fil es, as def ined in th
  141         <see 
  142          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  143         >
  144          specificat ion
  145                          for z ip files d escribed b y PKWare
  146         </see>
  147         .  The com pression f or this
  148                         imple mentation  is provide d by a man aged-code  version of  Zlib, inc luded with
  149                         DotNe tZip in th e classes  in the Ion ic.Zlib na mespace.
  150                       
  151        </para>
  152                     
  153                      
  154        <para>
  155                         This  class prov ides an al ternative  programmin g model to  the one e nabled by  the
  156                         
  157         <see 
  158          cref="T:Io nic.Zip.Zi pFile"
  159         />
  160          class. Us e this whe n creating  zip files , as an
  161                         alter native to  the 
  162         <see 
  163          cref="T:Io nic.Zip.Zi pFile"
  164         />
  165          class, wh en you wou ld like to  use a
  166                         
  167         <c>
  168          Stream
  169         </c>
  170          type to w rite the z ip file.
  171                       
  172        </para>
  173                     
  174                      
  175        <para>
  176                         Both  the 
  177         <c>
  178          ZipOutputS tream
  179         </c>
  180          class and  the 
  181         <c>
  182          ZipFile
  183         </c>
  184          class can  be used
  185                         to cr eate zip f iles. Both  of them s upport man y of the c ommon zip  features,
  186                         inclu ding Unico de, differ ent compre ssion leve ls, and ZI P64.   The y provide
  187                         very  similar pe rformance  when creat ing zip fi les.
  188                       
  189        </para>
  190                     
  191                      
  192        <para>
  193                         The 
  194         <c>
  195          ZipFile
  196         </c>
  197          class is  generally  easier to  use than
  198                         
  199         <c>
  200          ZipOutputS tream
  201         </c>
  202          and shoul d be consi dered a hi gher-level  interface .  For
  203                         examp le, when c reating a  zip file v ia calls t o the 
  204         <c>
  205          PutNextEnt ry()
  206         </c>
  207          and
  208                         
  209         <c>
  210          Write()
  211         </c>
  212          methods o n the 
  213         <c>
  214          ZipOutputS tream
  215         </c>
  216          class, th e caller i s
  217                         respo nsible for  opening t he file, r eading the  bytes fro m the file , writing
  218                         those  bytes int o the 
  219         <c>
  220          ZipOutputS tream
  221         </c>
  222         , setting  the attrib utes on th e
  223                         
  224         <c>
  225          ZipEntry
  226         </c>
  227         , and sett ing the cr eated, las t modified , and last  accessed
  228                         times tamps on t he zip ent ry. All of  these thi ngs are do ne automat ically by  a
  229                         call  to 
  230         <see 
  231          cref="M:Io nic.Zip.Zi pFile.AddF ile(System .String,Sy stem.Strin g)"
  232         >
  233          ZipFile.Ad dFile()
  234         </see>
  235         .
  236                         For t his reason , the 
  237         <c>
  238          ZipOutputS tream
  239         </c>
  240          is genera lly recomm ended for  use
  241                         only  when your  applicatio n emits ar bitrary da ta, not ne cessarily  data from  a
  242                         files ystem file , directly  into a zi p file, an d does so  using a 
  243         <c>
  244          Stream
  245         </c>
  246                         metap hor.
  247                       
  248        </para>
  249                     
  250                      
  251        <para>
  252                         Aside  from the  difference s in progr amming mod el, there  are other
  253                         diffe rences in  capability  between t he two cla sses.
  254                       
  255        </para>
  256                     
  257                      
  258        <list 
  259         type="bull et"
  260        >
  261                         
  262         <item>
  263                            
  264          <c>
  265           ZipFile
  266          </c>
  267           can be us ed to read  and extra ct zip fil es, in add ition to
  268                            cre ating zip  files. 
  269          <c>
  270           ZipOutputS tream
  271          </c>
  272           cannot re ad zip fil es. If you  want
  273                            to  use a stre am to read  zip files , check ou t the 
  274          <see 
  275           cref="T:Io nic.Zip.Zi pInputStre am"
  276          />
  277           class.
  278                          
  279         </item>
  280                      
  281                         
  282         <item>
  283                            
  284          <c>
  285           ZipOutputS tream
  286          </c>
  287           does not  support th e creation  of segmen ted or spa nned
  288                            zip  files.
  289                          
  290         </item>
  291                      
  292                         
  293         <item>
  294                            
  295          <c>
  296           ZipOutputS tream
  297          </c>
  298           cannot pr oduce a se lf-extract ing archiv e.
  299                          
  300         </item>
  301                       
  302        </list>
  303                     
  304                      
  305        <para>
  306                         Be aw are that t he 
  307         <c>
  308          ZipOutputS tream
  309         </c>
  310          class imp lements th
  311         <see 
  312          cref="T:Sy stem.IDisp osable"
  313         />
  314          interface .  In orde r for
  315                         
  316         <c>
  317          ZipOutputS tream
  318         </c>
  319          to produc e a valid  zip file,  you use us e it withi n
  320                         a usi ng clause  (
  321         <c>
  322          Using
  323         </c>
  324          in VB), o r call the  
  325         <c>
  326          Dispose()
  327         </c>
  328          method
  329                         expli citly.  Se e the exam ples for h ow to empl oy a using  clause.
  330                       
  331        </para>
  332                     
  333                      
  334        <para>
  335                         Also,  a note re garding co mpression  performanc e: On the  desktop .N ET
  336                         Frame work, DotN etZip can  use a mult i-threaded  compressi on impleme ntation
  337                         that  provides s ignificant  speed inc reases on  large file s, over 30 0k or so,
  338                         at th e cost of  increased  memory use  at runtim e.  (The o utput of t he
  339                         compr ession is  almost exa ctly the s ame size).   But, the  multi-thr eaded
  340                         appro ach incurs  a perform ance hit o n smaller  files. The re's no wa y for the
  341                         ZipOu tputStream  to know w hether par allel comp ression wi ll be bene ficial,
  342                         becau se the Zip OutputStre am does no t know how  much data  you will  write
  343                         throu gh the str eam.  You  may wish t o set the 
  344         <see 
  345          cref="P:Io nic.Zip.Zi pOutputStr eam.Parall elDeflateT hreshold"
  346         />
  347          property  to zero, i f you are  compressin g
  348                         large  files thr ough 
  349         <c>
  350          ZipOutputS tream
  351         </c>
  352         .  This wi ll cause p arallel
  353                         compr ession to  be used, a lways.
  354                       
  355        </para>
  356                      
  357       </remarks>
  358               
  359      </member>
  360              
  361      <member 
  362       name="M:Io nic.Zip.Zi pOutputStr eam.#ctor( System.IO. Stream)"
  363      >
  364                     
  365       <summary>
  366                        Creat e a ZipOut putStream,  wrapping  an existin g stream.
  367                      
  368       </summary>
  369                    
  370                     
  371       <remarks>
  372                      
  373        <para>
  374                         The 
  375         <see 
  376          cref="T:Io nic.Zip.Zi pFile"
  377         />
  378          class is  generally  easier to  use when c reating
  379                         zip f iles. The  ZipOutputS tream offe rs a diffe rent metap hor for cr eating a
  380                         zip f ile, based  on the 
  381         <see 
  382          cref="T:Sy stem.IO.St ream"
  383         />
  384          class.
  385                       
  386        </para>
  387                     
  388                      
  389       </remarks>
  390                    
  391                     
  392       <param 
  393        name="stre am"
  394       >
  395                      The str eam to wra p. It must  be writab le. This s tream will  be closed  at
  396                      the tim e the ZipO utputStrea m is close d.
  397                      
  398       </param>
  399                    
  400                     
  401       <example>
  402                     
  403                        This  example sh ows how to  create a  zip file,  using the
  404                        ZipOu tputStream  class.
  405                     
  406                      
  407        <code 
  408         lang="C#"
  409        >
  410                       private  void Zipu p()
  411                       {
  412                           if  (filesToZi p.Count ==  0)
  413                           {
  414                                System.Co nsole.Writ eLine("Not hing to do .");
  415                                return;
  416                           }
  417                      
  418                           usi ng (var ra w = File.O pen(_outpu tFileName,  FileMode. Create, Fi leAccess.R eadWrite ) )
  419                           {
  420                                using (va r output=  new ZipOut putStream( raw))
  421                                {
  422                                      output.Pas sword = " AI ";
  423                                    outpu t.Encrypti on = Encry ptionAlgor ithm.WinZi pAes256;
  424                      
  425                                    forea ch (string  inputFile Name in fi lesToZip)
  426                                    {
  427                                        S ystem.Cons ole.WriteL ine("file:  {0}", inp utFileName );
  428                      
  429                                        o utput.PutN extEntry(i nputFileNa me);
  430                                        u sing (var  input = Fi le.Open(in putFileNam e, FileMod e.Open, Fi leAccess.R ead, FileS hare.Read  | FileShar e.Write ))
  431                                        {
  432                                             byte[]  buffer= ne w byte[204 8];
  433                                             int n;
  434                                             while ( (n= input. Read(buffe r,0,buffer .Length))  &gt; 0)
  435                                             {
  436                                                 out put.Write( buffer,0,n );
  437                                             }
  438                                        }
  439                                    }
  440                                }
  441                           }
  442                       }
  443                       
  444        </code>
  445                     
  446                      
  447        <code 
  448         lang="VB"
  449        >
  450                       Private  Sub Zipup ()
  451                           Dim  outputFil eName As S tring = "X mlData.zip "
  452                           Dim  filesToZi p As Strin g() = Dire ctory.GetF iles(".",  "*.xml")
  453                           If  (filesToZi p.Length =  0) Then
  454                                Console.W riteLine(" Nothing to  do.")
  455                           Els e
  456                                Using raw  As FileSt ream = Fil e.Open(out putFileNam e, FileMod e.Create,  FileAccess .ReadWrite )
  457                                    Using  output As  ZipOutput Stream = N ew ZipOutp utStream(r aw)
  458                                          output.Pas sword = " AI "
  459                                        o utput.Encr yption = E ncryptionA lgorithm.W inZipAes25 6
  460                                        D im inputFi leName As  String
  461                                        F or Each in putFileNam e In files ToZip
  462                                             Console .WriteLine ("file: {0 }", inputF ileName)
  463                                             output. PutNextEnt ry(inputFi leName)
  464                                             Using i nput As Fi leStream =  File.Open (inputFile Name, File Mode.Open,  FileAcces s.Read, Fi leShare.Re adWrite)
  465                                                 Dim  n As Inte ger
  466                                                 Dim  buffer As  Byte() =  New Byte(2 048) {}
  467                                                 Do  While (n =  input.Rea d(buffer,  0, buffer. Length) &g t; 0)
  468                                                      output.Wr ite(buffer , 0, n)
  469                                                 Loo p
  470                                             End Usi ng
  471                                        N ext
  472                                    End U sing
  473                                End Using
  474                           End  If
  475                       End Sub
  476                       
  477        </code>
  478                      
  479       </example>
  480               
  481      </member>
  482              
  483      <member 
  484       name="M:Io nic.Zip.Zi pOutputStr eam.#ctor( System.Str ing)"
  485      >
  486                     
  487       <summary>
  488                        Creat e a ZipOut putStream  that write s to a fil esystem fi le.
  489                      
  490       </summary>
  491                    
  492                     
  493       <remarks>
  494                        The 
  495        <see 
  496         cref="T:Io nic.Zip.Zi pFile"
  497        />
  498         class is  generally  easier to  use when c reating
  499                        zip f iles. The  ZipOutputS tream offe rs a diffe rent metap hor for cr eating a
  500                        zip f ile, based  on the 
  501        <see 
  502         cref="T:Sy stem.IO.St ream"
  503        />
  504         class.
  505                      
  506       </remarks>
  507                    
  508                     
  509       <param 
  510        name="file Name"
  511       >
  512                        The n ame of the  zip file  to create.
  513                      
  514       </param>
  515                    
  516                     
  517       <example>
  518                     
  519                        This  example sh ows how to  create a  zip file,  using the
  520                        ZipOu tputStream  class.
  521                     
  522                      
  523        <code 
  524         lang="C#"
  525        >
  526                       private  void Zipu p()
  527                       {
  528                           if  (filesToZi p.Count ==  0)
  529                           {
  530                                System.Co nsole.Writ eLine("Not hing to do .");
  531                                return;
  532                           }
  533                      
  534                           usi ng (var ou tput= new  ZipOutputS tream(outp utFileName ))
  535                           {
  536                                 output.Pas sword = " AI ";
  537                                output.En cryption =  Encryptio nAlgorithm .WinZipAes 256;
  538                      
  539                                foreach ( string inp utFileName  in filesT oZip)
  540                                {
  541                                    Syste m.Console. WriteLine( "file: {0} ", inputFi leName);
  542                      
  543                                    outpu t.PutNextE ntry(input FileName);
  544                                    using  (var inpu t = File.O pen(inputF ileName, F ileMode.Op en, FileAc cess.Read,
  545                                                                    FileSh are.Read |  FileShare .Write ))
  546                                    {
  547                                        b yte[] buff er= new by te[2048];
  548                                        i nt n;
  549                                        w hile ((n=  input.Read (buffer,0, buffer.Len gth)) &gt;  0)
  550                                        {
  551                                             output. Write(buff er,0,n);
  552                                        }
  553                                    }
  554                                }
  555                           }
  556                       }
  557                       
  558        </code>
  559                     
  560                      
  561        <code 
  562         lang="VB"
  563        >
  564                       Private  Sub Zipup ()
  565                           Dim  outputFil eName As S tring = "X mlData.zip "
  566                           Dim  filesToZi p As Strin g() = Dire ctory.GetF iles(".",  "*.xml")
  567                           If  (filesToZi p.Length =  0) Then
  568                                Console.W riteLine(" Nothing to  do.")
  569                           Els e
  570                                Using out put As Zip OutputStre am = New Z ipOutputSt ream(outpu tFileName)
  571                                      output.Pas sword = " AI "
  572                                    outpu t.Encrypti on = Encry ptionAlgor ithm.WinZi pAes256
  573                                    Dim i nputFileNa me As Stri ng
  574                                    For E ach inputF ileName In  filesToZi p
  575                                        C onsole.Wri teLine("fi le: {0}",  inputFileN ame)
  576                                        o utput.PutN extEntry(i nputFileNa me)
  577                                        U sing input  As FileSt ream = Fil e.Open(inp utFileName , FileMode .Open, Fil eAccess.Re ad, FileSh are.ReadWr ite)
  578                                             Dim n A s Integer
  579                                             Dim buf fer As Byt e() = New  Byte(2048)  {}
  580                                             Do Whil e (n = inp ut.Read(bu ffer, 0, b uffer.Leng th) &gt; 0 )
  581                                                 out put.Write( buffer, 0,  n)
  582                                             Loop
  583                                        E nd Using
  584                                    Next
  585                                End Using
  586                           End  If
  587                       End Sub
  588                       
  589        </code>
  590                      
  591       </example>
  592               
  593      </member>
  594              
  595      <member 
  596       name="M:Io nic.Zip.Zi pOutputStr eam.#ctor( System.IO. Stream,Sys tem.Boolea n)"
  597      >
  598                     
  599       <summary>
  600                        Creat e a ZipOut putStream.
  601                      
  602       </summary>
  603                    
  604                     
  605       <remarks>
  606                        See t he documen tation for  the 
  607        <see 
  608         cref="M:Io nic.Zip.Zi pOutputStr eam.#ctor( System.IO. Stream)"
  609        >
  610         ZipOutputS tream(Stre am)
  611        </see>
  612                        const ructor for  an exampl e.
  613                      
  614       </remarks>
  615                    
  616                     
  617       <param 
  618        name="stre am"
  619       >
  620                        The s tream to w rap. It mu st be writ able.
  621                      
  622       </param>
  623                    
  624                     
  625       <param 
  626        name="leav eOpen"
  627       >
  628                        true  if the app lication w ould like  the stream
  629                        to re main open  after the 
  630        <c>
  631         ZipOutputS tream
  632        </c>
  633         has been  closed.
  634                      
  635       </param>
  636               
  637      </member>
  638              
  639      <member 
  640       name="M:Io nic.Zip.Zi pOutputStr eam.ToStri ng"
  641      >
  642                    
  643       <summary>
  644        Provides a  string re presentati on of the  instance.
  645       </summary>
  646                    
  647       <remarks>
  648                       
  649        <para>
  650                          This  can be us eful for d ebugging p urposes.
  651                        
  652        </para>
  653                     
  654       </remarks>
  655                    
  656       <returns>
  657        a string r epresentat ion of the  instance.
  658       </returns>
  659               
  660      </member>
  661              
  662      <member 
  663       name="M:Io nic.Zip.Zi pOutputStr eam.Contai nsEntry(Sy stem.Strin g)"
  664      >
  665                     
  666       <summary>
  667                        Retur ns true if  an entry  by the giv en name ha s already  been writt en
  668                        to th e ZipOutpu tStream.
  669                      
  670       </summary>
  671                    
  672                     
  673       <param 
  674        name="name "
  675       >
  676                        The n ame of the  entry to  scan for.
  677                      
  678       </param>
  679                    
  680                     
  681       <returns>
  682                      true if  an entry  by the giv en name ha s already  been writt en.
  683                      
  684       </returns>
  685               
  686      </member>
  687              
  688      <member 
  689       name="M:Io nic.Zip.Zi pOutputStr eam.Write( System.Byt e[],System .Int32,Sys tem.Int32) "
  690      >
  691                     
  692       <summary>
  693                        Write  the data  from the b uffer to t he stream.
  694                      
  695       </summary>
  696                    
  697                     
  698       <remarks>
  699                        As th e applicat ion writes  data into  this stre am, the da ta may be
  700                        compr essed and  encrypted  before bei ng written  out to th e underlyi ng
  701                        strea m, dependi ng on the  settings o f the 
  702        <see 
  703         cref="P:Io nic.Zip.Zi pOutputStr eam.Compre ssionLevel "
  704        />
  705                        and t he 
  706        <see 
  707         cref="P:Io nic.Zip.Zi pOutputStr eam.Encryp tion"
  708        />
  709         propertie s.
  710                      
  711       </remarks>
  712                    
  713                     
  714       <param 
  715        name="buff er"
  716       >
  717        The buffer  holding d ata to wri te to the  stream.
  718       </param>
  719                     
  720       <param 
  721        name="offs et"
  722       >
  723        the offset  within th at data ar ray to fin d the firs t byte to  write.
  724       </param>
  725                     
  726       <param 
  727        name="coun t"
  728       >
  729        the number  of bytes  to write.
  730       </param>
  731               
  732      </member>
  733              
  734      <member 
  735       name="M:Io nic.Zip.Zi pOutputStr eam.PutNex tEntry(Sys tem.String )"
  736      >
  737                     
  738       <summary>
  739                        Speci fy the nam e of the n ext entry  that will  be written  to the zi p file.
  740                      
  741       </summary>
  742                    
  743                     
  744       <remarks>
  745                      
  746        <para>
  747                         Call  this metho d just bef ore callin
  748         <see 
  749          cref="M:Io nic.Zip.Zi pOutputStr eam.Write( System.Byt e[],System .Int32,Sys tem.Int32) "
  750         />
  751         , to
  752                         speci fy the nam e of the e ntry that  the next s et of byte s written  to
  753                         the 
  754         <c>
  755          ZipOutputS tream
  756         </c>
  757          belongs t o. All sub sequent ca lls to 
  758         <c>
  759          Write
  760         </c>
  761         ,
  762                         until  the next  call to 
  763         <c>
  764          PutNextEnt ry
  765         </c>
  766         ,
  767                         will  be inserte d into the  named ent ry in the  zip file.
  768                       
  769        </para>
  770                     
  771                      
  772        <para>
  773                         If th
  774         <paramref 
  775          name="entr yName"
  776         />
  777          used in 
  778         <c>
  779          PutNextEnt ry()
  780         </c>
  781          ends in
  782                         a sla sh, then t he entry a dded is ma rked as a  directory.  Because d irectory
  783                         entri es do not  contain da ta, a call  to 
  784         <c>
  785          Write()
  786         </c>
  787         , before a n
  788                         inter vening add itional ca ll to 
  789         <c>
  790          PutNextEnt ry()
  791         </c>
  792         , will thr ow an
  793                         excep tion.
  794                       
  795        </para>
  796                     
  797                      
  798        <para>
  799                         If yo u don't ca ll 
  800         <c>
  801          Write()
  802         </c>
  803          between t wo calls t o
  804                         
  805         <c>
  806          PutNextEnt ry()
  807         </c>
  808         , the firs t entry is  inserted  into the z ip file as  a
  809                         file  of zero si ze.  This  may be wha t you want .
  810                       
  811        </para>
  812                     
  813                      
  814        <para>
  815                         Becau se 
  816         <c>
  817          PutNextEnt ry()
  818         </c>
  819          closes ou t the prio r entry, i f any, thi s
  820                         metho d may thro w if there  is a prob lem with t he prior e ntry.
  821                       
  822        </para>
  823                     
  824                      
  825        <para>
  826                         This  method ret urns the 
  827         <c>
  828          ZipEntry
  829         </c>
  830         .  You can  modify pu blic prope rties
  831                         on th
  832         <c>
  833          ZipEntry
  834         </c>
  835         , such as 
  836         <see 
  837          cref="P:Io nic.Zip.Zi pEntry.Enc ryption"
  838         />
  839        
  840         <see 
  841          cref="P:Io nic.Zip.Zi pEntry.Pas sword"
  842         />
  843         , and so o n, until t he first c all to
  844                         
  845         <c>
  846          ZipOutputS tream.Writ e()
  847         </c>
  848         , or until  the next  call to
  849                         
  850         <c>
  851          PutNextEnt ry()
  852         </c>
  853         .  If you  modify the  
  854         <c>
  855          ZipEntry
  856         </c>
  857          
  858         <em>
  859          after
  860         </em>
  861                         havin g called 
  862         <c>
  863          Write()
  864         </c>
  865         , you may  get a runt ime except ion, or yo u may
  866                         silen tly get an  invalid z ip archive .
  867                       
  868        </para>
  869                     
  870                      
  871       </remarks>
  872                    
  873                     
  874       <example>
  875                     
  876                        This  example sh ows how to  create a  zip file,  using the
  877                        
  878        <c>
  879         ZipOutputS tream
  880        </c>
  881         class.
  882                     
  883                      
  884        <code>
  885                       private  void Zipu p()
  886                       {
  887                           usi ng (FileSt ream fs ra w = File.O pen(_outpu tFileName,  FileMode. Create, Fi leAccess.R eadWrite ) )
  888                           {
  889                                using (va r output=  new ZipOut putStream( fs))
  890                                {
  891                                      output.Pas sword = " AI ";
  892                                    outpu t.Encrypti on = Encry ptionAlgor ithm.WinZi pAes256;
  893                                    outpu t.PutNextE ntry("entr y1.txt");
  894                                    byte[ ] buffer=  System.Tex t.Encoding .ASCII.Get Bytes("Thi s is the c ontent for  entry #1. ");
  895                                    outpu t.Write(bu ffer,0,buf fer.Length );
  896                                    outpu t.PutNextE ntry("entr y2.txt");   // this w ill be zer o length
  897                                    outpu t.PutNextE ntry("entr y3.txt");
  898                                    buffe r= System. Text.Encod ing.ASCII. GetBytes(" This is th e content  for entry  #3.");
  899                                    outpu t.Write(bu ffer,0,buf fer.Length );
  900                                }
  901                           }
  902                       }
  903                       
  904        </code>
  905                      
  906       </example>
  907                    
  908                     
  909       <param 
  910        name="entr yName"
  911       >
  912                        The n ame of the  entry to  be added,  including  any path t o be used
  913                        withi n the zip  file.
  914                      
  915       </param>
  916                    
  917                     
  918       <returns>
  919                        The Z ipEntry cr eated.
  920                      
  921       </returns>
  922                    
  923               
  924      </member>
  925              
  926      <member 
  927       name="M:Io nic.Zip.Zi pOutputStr eam.Dispos e(System.B oolean)"
  928      >
  929                     
  930       <summary>
  931                      Dispose  the strea m
  932                      
  933       </summary>
  934                    
  935                     
  936       <remarks>
  937                      
  938        <para>
  939                         This  method wri tes the Zi p Central  directory,  then clos es the str eam.  The
  940                         appli cation mus t call Dis pose() (or  Close) in  order to  produce a  valid zip  file.
  941                       
  942        </para>
  943                     
  944                      
  945        <para>
  946                         Typic ally the a pplication  will call  
  947         <c>
  948          Dispose()
  949         </c>
  950          implicitl y, via a 
  951         <c>
  952          using
  953         </c>
  954                         state ment in C# , or a 
  955         <c>
  956          Using
  957         </c>
  958          statement  in VB.
  959                       
  960        </para>
  961                     
  962                      
  963       </remarks>
  964                    
  965                     
  966       <param 
  967        name="disp osing"
  968       >
  969        set this t o true, al ways.
  970       </param>
  971               
  972      </member>
  973              
  974      <member 
  975       name="M:Io nic.Zip.Zi pOutputStr eam.Flush"
  976      >
  977                    
  978       <summary>
  979                     This is  a no-op.
  980                     
  981       </summary>
  982               
  983      </member>
  984              
  985      <member 
  986       name="M:Io nic.Zip.Zi pOutputStr eam.Read(S ystem.Byte [],System. Int32,Syst em.Int32)"
  987      >
  988                    
  989       <summary>
  990                     This met hod always  throws a  NotSupport edExceptio n.
  991                     
  992       </summary>
  993                    
  994       <param 
  995        name="buff er"
  996       >
  997        ignored
  998       </param>
  999                    
  1000       <param 
  1001        name="offs et"
  1002       >
  1003        ignored
  1004       </param>
  1005                    
  1006       <param 
  1007        name="coun t"
  1008       >
  1009        ignored
  1010       </param>
  1011                    
  1012       <returns>
  1013        nothing
  1014       </returns>
  1015               
  1016      </member>
  1017              
  1018      <member 
  1019       name="M:Io nic.Zip.Zi pOutputStr eam.Seek(S ystem.Int6 4,System.I O.SeekOrig in)"
  1020      >
  1021                    
  1022       <summary>
  1023                     This met hod always  throws a  NotSupport edExceptio n.
  1024                     
  1025       </summary>
  1026                    
  1027       <param 
  1028        name="offs et"
  1029       >
  1030        ignored
  1031       </param>
  1032                    
  1033       <param 
  1034        name="orig in"
  1035       >
  1036        ignored
  1037       </param>
  1038                    
  1039       <returns>
  1040        nothing
  1041       </returns>
  1042               
  1043      </member>
  1044              
  1045      <member 
  1046       name="M:Io nic.Zip.Zi pOutputStr eam.SetLen gth(System .Int64)"
  1047      >
  1048                    
  1049       <summary>
  1050                     This met hod always  throws a  NotSupport edExceptio n.
  1051                     
  1052       </summary>
  1053                    
  1054       <param 
  1055        name="valu e"
  1056       >
  1057        ignored
  1058       </param>
  1059               
  1060      </member>
  1061              
  1062      <member 
  1063       name="P:Io nic.Zip.Zi pOutputStr eam.Passwo rd"
  1064      >
  1065                     
  1066       <summary>
  1067                        Sets  the passwo rd to be u sed on the  
  1068        <c>
  1069         ZipOutputS tream
  1070        </c>
  1071         instance.
  1072                      
  1073       </summary>
  1074                    
  1075                     
  1076       <remarks>
  1077                     
  1078                      
  1079        <para>
  1080                         When  writing a  zip archiv e, this pa ssword is  applied to  the entri es, not
  1081                         to th e zip arch ive itself . It appli es to any 
  1082         <c>
  1083          ZipEntry
  1084         </c>
  1085          subsequen tly
  1086                         writt en to the 
  1087         <c>
  1088          ZipOutputS tream
  1089         </c>
  1090         .
  1091                       
  1092        </para>
  1093                     
  1094                      
  1095        <para>
  1096                         Using  a passwor d does not  encrypt o r protect  the "direc tory" of t he
  1097                         archi ve - the l ist of ent ries conta ined in th e archive.   If you s et the
  1098                         
  1099         <c>
  1100          Password
  1101         </c>
  1102          property,  the passw ord actual ly applies  to indivi dual
  1103                         entri es that ar e added to  the archi ve, subseq uent to th e setting  of this
  1104                         prope rty.  The  list of fi lenames in  the archi ve that is  eventuall y created
  1105                         will  appear in  clear text , but the  contents o f the indi vidual fil es are
  1106                         encry pted.  Thi s is how Z ip encrypt ion works.
  1107                       
  1108        </para>
  1109                     
  1110                      
  1111        <para>
  1112                         If yo u set this  property,  and then  add a set  of entries  to the ar chive via
  1113                         calls  to 
  1114         <c>
  1115          PutNextEnt ry
  1116         </c>
  1117         , then eac h entry is  encrypted  with that
  1118                         passw ord.  You  may also w ant to cha nge the pa ssword bet ween addin g
  1119                         diffe rent entri es. If you  set the p assword, a dd an entr y, then se t the
  1120                         passw ord to 
  1121         <c>
  1122          null
  1123         </c>
  1124          (
  1125         <c>
  1126          Nothing
  1127         </c>
  1128          in VB), a nd add ano ther entry , the
  1129                         first  entry is  encrypted  and the se cond is no t.
  1130                       
  1131        </para>
  1132                     
  1133                      
  1134        <para>
  1135                         When  setting th
  1136         <c>
  1137          Password
  1138         </c>
  1139         , you may  also want  to explici tly set th
  1140         <see 
  1141          cref="P:Io nic.Zip.Zi pOutputStr eam.Encryp tion"
  1142         />
  1143          property,  to specif y how to e ncrypt the  entries a dded
  1144                         to th e ZipFile.   If you s et the 
  1145         <c>
  1146          Password
  1147         </c>
  1148          to a non- null value  and do no t
  1149                         set 
  1150         <see 
  1151          cref="P:Io nic.Zip.Zi pOutputStr eam.Encryp tion"
  1152         />
  1153         , then PKZ ip 2.0 ("W eak") encr yption is  used.
  1154                         This  encryption  is relati vely weak  but is ver y interope rable. If
  1155                         you s et the pas sword to a  
  1156         <c>
  1157          null
  1158         </c>
  1159          value (
  1160         <c>
  1161          Nothing
  1162         </c>
  1163          in VB),
  1164                         
  1165         <c>
  1166          Encryption
  1167         </c>
  1168          is reset  to None.
  1169                       
  1170        </para>
  1171                     
  1172                      
  1173        <para>
  1174                         Speci al case: i f you wrap  a ZipOutp utStream a round a no n-seekable  stream,
  1175                         and u se encrypt ion, and e mit an ent ry of zero  bytes, th
  1176         <c>
  1177          Close()
  1178         </c>
  1179          or
  1180                         
  1181         <c>
  1182          PutNextEnt ry()
  1183         </c>
  1184          following  the entry  will thro w an excep tion.
  1185                       
  1186        </para>
  1187                     
  1188                      
  1189       </remarks>
  1190               
  1191      </member>
  1192              
  1193      <member 
  1194       name="P:Io nic.Zip.Zi pOutputStr eam.Encryp tion"
  1195      >
  1196                     
  1197       <summary>
  1198                        The E ncryption  to use for  entries a dded to th
  1199        <c>
  1200         ZipOutputS tream
  1201        </c>
  1202        .
  1203                      
  1204       </summary>
  1205                    
  1206                     
  1207       <remarks>
  1208                      
  1209        <para>
  1210                         The s pecified E ncryption  is applied  to the en tries subs equently
  1211                         writt en to the 
  1212         <c>
  1213          ZipOutputS tream
  1214         </c>
  1215          instance.
  1216                       
  1217        </para>
  1218                     
  1219                      
  1220        <para>
  1221                         If yo u set this  to someth ing other  than
  1222                         Encry ptionAlgor ithm.None,  you will  also need  to set the
  1223                         
  1224         <see 
  1225          cref="P:Io nic.Zip.Zi pOutputStr eam.Passwo rd"
  1226         />
  1227          to a non- null, non- empty valu e in
  1228                         order  to actual ly get enc ryption on  the entry .
  1229                       
  1230        </para>
  1231                     
  1232                      
  1233       </remarks>
  1234                    
  1235                     
  1236       <seealso 
  1237        cref="P:Io nic.Zip.Zi pOutputStr eam.Passwo rd"
  1238       >
  1239        ZipOutputS tream.Pass word
  1240       </seealso>
  1241                     
  1242       <seealso 
  1243        cref="P:Io nic.Zip.Zi pEntry.Enc ryption"
  1244       >
  1245        ZipEntry.E ncryption
  1246       </seealso>
  1247               
  1248      </member>
  1249              
  1250      <member 
  1251       name="P:Io nic.Zip.Zi pOutputStr eam.CodecB ufferSize"
  1252      >
  1253                     
  1254       <summary>
  1255                        Size  of the wor k buffer t o use for  the ZLIB c odec durin g compress ion.
  1256                      
  1257       </summary>
  1258                    
  1259                     
  1260       <remarks>
  1261                        Setti ng this ma y affect p erformance .  For lar ger files,  setting t his to a
  1262                        large r size may  improve p erformance , but I'm  not sure.   Sorry, I  don't
  1263                        curre ntly have  good recom mendations  on how to  set it.   You can te st it if
  1264                        you l ike.
  1265                      
  1266       </remarks>
  1267               
  1268      </member>
  1269              
  1270      <member 
  1271       name="P:Io nic.Zip.Zi pOutputStr eam.Strate gy"
  1272      >
  1273                     
  1274       <summary>
  1275                        The c ompression  strategy  to use for  all entri es.
  1276                      
  1277       </summary>
  1278                    
  1279                     
  1280       <remarks>
  1281                        Set t he Strateg y used by  the ZLIB-c ompatible  compressor , when com pressing
  1282                        data  for the en tries in t he zip arc hive. Diff erent comp ression st rategies
  1283                        work  better on  different  sorts of d ata. The s trategy pa rameter ca n affect
  1284                        the c ompression  ratio and  the speed  of compre ssion but  not the co rrectness
  1285                        of th e compress sion.  For  more info rmation se
  1286        <see 
  1287         cref="T:Io nic.Zlib.C ompression Strategy"
  1288        />
  1289        .
  1290                      
  1291       </remarks>
  1292               
  1293      </member>
  1294              
  1295      <member 
  1296       name="P:Io nic.Zip.Zi pOutputStr eam.Timest amp"
  1297      >
  1298                     
  1299       <summary>
  1300                        The t ype of tim estamp att ached to t he ZipEntr y.
  1301                      
  1302       </summary>
  1303                    
  1304                     
  1305       <remarks>
  1306                        Set t his in ord er to spec ify the ki nd of time stamp that  should be  emitted
  1307                        into  the zip fi le for eac h entry.
  1308                      
  1309       </remarks>
  1310               
  1311      </member>
  1312              
  1313      <member 
  1314       name="P:Io nic.Zip.Zi pOutputStr eam.Compre ssionLevel "
  1315      >
  1316                     
  1317       <summary>
  1318                        Sets  the compre ssion leve l to be us ed for ent ries subse quently ad ded to
  1319                        the z ip archive .
  1320                      
  1321       </summary>
  1322                    
  1323                     
  1324       <remarks>
  1325                       
  1326        <para>
  1327                          Vary ing the co mpression  level used  on entrie s can affe ct the
  1328                          size -vs-speed  tradeoff w hen compre ssion and  decompress ing data s treams
  1329                          or f iles.
  1330                        
  1331        </para>
  1332                     
  1333                       
  1334        <para>
  1335                          As w ith some o ther prope rties on t he 
  1336         <c>
  1337          ZipOutputS tream
  1338         </c>
  1339          class, li ke 
  1340         <see 
  1341          cref="P:Io nic.Zip.Zi pOutputStr eam.Passwo rd"
  1342         />
  1343         , and 
  1344         <see 
  1345          cref="P:Io nic.Zip.Zi pOutputStr eam.Encryp tion"
  1346         />
  1347         ,
  1348                          sett ing this p roperty on  a 
  1349         <c>
  1350          ZipOutputS tream
  1351         </c>
  1352                          inst ance will  cause the  specified 
  1353         <c>
  1354          Compressio nLevel
  1355         </c>
  1356          to be use d on all
  1357                          
  1358         <see 
  1359          cref="T:Io nic.Zip.Zi pEntry"
  1360         />
  1361          items tha t are subs equently a dded to th e
  1362                          
  1363         <c>
  1364          ZipOutputS tream
  1365         </c>
  1366          instance.
  1367                        
  1368        </para>
  1369                     
  1370                       
  1371        <para>
  1372                          If y ou do not  set this p roperty, t he default  compressi on level i s used,
  1373                          whic h normally  gives a g ood balanc e of compr ession eff iciency an d
  1374                          comp ression sp eed.  In s ome tests,  using 
  1375         <c>
  1376          BestCompre ssion
  1377         </c>
  1378          can
  1379                          doub le the tim e it takes  to compre ss, while  delivering  just a sm all
  1380                          incr ease in co mpression  efficiency .  This be havior wil l vary wit h the
  1381                          type  of data y ou compres s.  If you  are in do ubt, just  leave this  setting
  1382                          alon e, and acc ept the de fault.
  1383                        
  1384        </para>
  1385                      
  1386       </remarks>
  1387               
  1388      </member>
  1389              
  1390      <member 
  1391       name="P:Io nic.Zip.Zi pOutputStr eam.Compre ssionMetho d"
  1392      >
  1393                    
  1394       <summary>
  1395                       The co mpression  method use d on each  entry adde d to the Z ipOutputSt ream.
  1396                     
  1397       </summary>
  1398               
  1399      </member>
  1400              
  1401      <member 
  1402       name="P:Io nic.Zip.Zi pOutputStr eam.Commen t"
  1403      >
  1404                     
  1405       <summary>
  1406                        A com ment attac hed to the  zip archi ve.
  1407                      
  1408       </summary>
  1409                    
  1410                     
  1411       <remarks>
  1412                     
  1413                      
  1414        <para>
  1415                         The a pplication  sets this  property  to specify  a comment  to be emb edded
  1416                         into  the genera ted zip ar chive.
  1417                       
  1418        </para>
  1419                     
  1420                      
  1421        <para>
  1422                         Accor ding to 
  1423         <see 
  1424          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  1425         >
  1426          PKWARE's
  1427                          zip s pecificati on
  1428         </see>
  1429         , the comm ent is not  encrypted , even if  there is a
  1430                         passw ord set on  the zip f ile.
  1431                       
  1432        </para>
  1433                     
  1434                      
  1435        <para>
  1436                         The s pecificati on does no t describe  how to in dicate the  encoding  used
  1437                         on a  comment st ring. Many  "complian t" zip too ls and lib raries use
  1438                         IBM43 7 as the c ode page f or comment s; DotNetZ ip, too, f ollows tha t
  1439                         pract ice.  On t he other h and, there  are situa tions wher e you want  a
  1440                         Comme nt to be e ncoded wit h somethin g else, fo r example  using code  page
  1441                         950 " Big-5 Chin ese". To f ill that n eed, DotNe tZip will  encode the
  1442                         comme nt followi ng the sam e procedur e it follo ws for enc oding
  1443                         filen ames: (a)  if 
  1444         <see 
  1445          cref="P:Io nic.Zip.Zi pOutputStr eam.Altern ateEncodin gUsage"
  1446         />
  1447          is
  1448                         
  1449         <c>
  1450          Never
  1451         </c>
  1452         , it uses  the defaul t encoding  (IBM437).  (b) if 
  1453         <see 
  1454          cref="P:Io nic.Zip.Zi pOutputStr eam.Altern ateEncodin gUsage"
  1455         />
  1456          is 
  1457         <c>
  1458          Always
  1459         </c>
  1460         , it alway s uses the
  1461                         alter nate encod ing (
  1462         <see 
  1463          cref="P:Io nic.Zip.Zi pOutputStr eam.Altern ateEncodin g"
  1464         />
  1465         ). (c) if 
  1466         <see 
  1467          cref="P:Io nic.Zip.Zi pOutputStr eam.Altern ateEncodin gUsage"
  1468         />
  1469          is 
  1470         <c>
  1471          AsNecessar y
  1472         </c>
  1473         , it uses  the
  1474                         alter nate encod ing only i f the defa ult encodi ng is not  sufficient  for
  1475                         encod ing the co mment - in  other wor ds if deco ding the r esult does  not
  1476                         produ ce the ori ginal stri ng.  This  decision i s taken at  the time  of
  1477                         the c all to 
  1478         <c>
  1479          ZipFile.Sa ve()
  1480         </c>
  1481         .
  1482                       
  1483        </para>
  1484                     
  1485                      
  1486       </remarks>
  1487               
  1488      </member>
  1489              
  1490      <member 
  1491       name="P:Io nic.Zip.Zi pOutputStr eam.Enable Zip64"
  1492      >
  1493                     
  1494       <summary>
  1495                        Speci fy whether  to use ZI P64 extens ions when  saving a z ip archive .
  1496                      
  1497       </summary>
  1498                    
  1499                     
  1500       <remarks>
  1501                      
  1502        <para>
  1503                         The d efault val ue for the  property  is 
  1504         <see 
  1505          cref="F:Io nic.Zip.Zi p64Option. Never"
  1506         />
  1507        
  1508         <see 
  1509          cref="F:Io nic.Zip.Zi p64Option. AsNecessar y"
  1510         />
  1511          is
  1512                         safes t, in the  sense that  you will  not get an  Exception  if a
  1513                         pre-Z IP64 limit  is exceed ed.
  1514                       
  1515        </para>
  1516                     
  1517                      
  1518        <para>
  1519                         You m ust set th is propert y before c alling 
  1520         <c>
  1521          Write()
  1522         </c>
  1523         .
  1524                       
  1525        </para>
  1526                     
  1527                      
  1528       </remarks>
  1529               
  1530      </member>
  1531              
  1532      <member 
  1533       name="P:Io nic.Zip.Zi pOutputStr eam.Output UsedZip64"
  1534      >
  1535                     
  1536       <summary>
  1537                        Indic ates wheth er ZIP64 e xtensions  were used  when savin g the zip  archive.
  1538                      
  1539       </summary>
  1540                    
  1541                     
  1542       <remarks>
  1543                        The v alue is de fined only  after the  
  1544        <c>
  1545         ZipOutputS tream
  1546        </c>
  1547         has been  closed.
  1548                      
  1549       </remarks>
  1550               
  1551      </member>
  1552              
  1553      <member 
  1554       name="P:Io nic.Zip.Zi pOutputStr eam.Ignore Case"
  1555      >
  1556                     
  1557       <summary>
  1558                        Wheth er the Zip OutputStre am should  use case-i nsensitive  compariso ns when
  1559                        check ing for un iqueness o f zip entr ies.
  1560                      
  1561       </summary>
  1562                    
  1563                     
  1564       <remarks>
  1565                        
  1566        <para>
  1567                         Thoug h the zip  specificat ion doesn' t prohibit  zipfiles  with dupli cate
  1568                         entri es, Sane z ip files h ave no dup licates, a nd the Dot NetZip lib rary
  1569                         canno t create z ip files w ith duplic ate entrie s. If an a pplication  attempts
  1570                         to ca ll 
  1571         <see 
  1572          cref="M:Io nic.Zip.Zi pOutputStr eam.PutNex tEntry(Sys tem.String )"
  1573         />
  1574          with a na me that du plicates o ne
  1575                         alrea dy used wi thin the a rchive, th e library  will throw  an Except ion.
  1576                         
  1577        </para>
  1578                        
  1579        <para>
  1580                         This  property a llows the  applicatio n to speci fy whether  the
  1581                         ZipOu tputStream  instance  considers  ordinal ca se when ch ecking for
  1582                         uniqu eness of z ip entries .
  1583                         
  1584        </para>
  1585                      
  1586       </remarks>
  1587               
  1588      </member>
  1589              
  1590      <member 
  1591       name="P:Io nic.Zip.Zi pOutputStr eam.UseUni codeAsNece ssary"
  1592      >
  1593                     
  1594       <summary>
  1595                        Indic ates wheth er to enco de entry f ilenames a nd entry c omments us ing
  1596                        Unico de (UTF-8) .
  1597                      
  1598       </summary>
  1599                    
  1600                     
  1601       <remarks>
  1602                      
  1603        <para>
  1604                         
  1605         <see 
  1606          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  1607         >
  1608          The
  1609                          PKWar e zip spec ification
  1610         </see>
  1611          provides  for encodi ng file na mes and fi le
  1612                         comme nts in eit her the IB M437 code  page, or i n UTF-8.   This flag  selects
  1613                         the e ncoding ac cording to  that spec ification.   By defau lt, this f lag is
  1614                         false , and file names and  comments a re encoded  into the  zip file i n the
  1615                         IBM43 7 codepage .  Setting  this flag  to true w ill specif y that fil enames
  1616                         and c omments th at cannot  be encoded  with IBM4 37 will be  encoded w ith
  1617                         UTF-8 .
  1618                       
  1619        </para>
  1620                     
  1621                      
  1622        <para>
  1623                         Zip f iles creat ed with st rict adher ence to th e PKWare s pecificati on with
  1624                         respe ct to UTF- 8 encoding  can conta in entries  with file names cont aining
  1625                         any c ombination  of Unicod e characte rs, includ ing the fu ll range o f
  1626                         chara cters from  Chinese,  Latin, Heb rew, Greek , Cyrillic , and many  other
  1627                         alpha bets.  How ever, beca use at thi s time, th e UTF-8 po rtion of t he PKWare
  1628                         speci fication i s not broa dly suppor ted by oth er zip lib raries and
  1629                         utili ties, such  zip files  may not b e readable  by your f avorite zi p tool or
  1630                         archi ver. In ot her words,  interoper ability wi ll decreas e if you s et this
  1631                         flag  to true.
  1632                       
  1633        </para>
  1634                     
  1635                      
  1636        <para>
  1637                         In pa rticular,  Zip files  created wi th strict  adherence  to the PKW are
  1638                         speci fication w ith respec t to UTF-8  encoding  will not w ork well w ith
  1639                         Explo rer in Win dows XP or  Windows V ista, beca use Window s compress ed
  1640                         folde rs, as far  as I know , do not s upport UTF -8 in zip  files.  Vi sta can
  1641                         read  the zip fi les, but s hows the f ilenames i ncorrectly . Unpackin g from
  1642                         Windo ws Vista E xplorer wi ll result  in filenam es that ha ve rubbish
  1643                         chara cters in p lace of th e high-ord er UTF-8 b ytes.
  1644                       
  1645        </para>
  1646                     
  1647                      
  1648        <para>
  1649                         Also,  zip files  that use  UTF-8 enco ding will  not work w ell with J ava
  1650                         appli cations th at use the  java.util .zip class es, as of  v5.0 of th e Java
  1651                         runti me. The Ja va runtime  does not  correctly  implement  the PKWare
  1652                         speci fication i n this reg ard.
  1653                       
  1654        </para>
  1655                     
  1656                      
  1657        <para>
  1658                         As a  result, we  have the  unfortunat e situatio n that "co rrect" beh avior by
  1659                         the D otNetZip l ibrary wit h regard t o Unicode  encoding o f filename s during
  1660                         zip c reation wi ll result  in zip fil es that ar e readable  by strict ly
  1661                         compl iant and c urrent too ls (for ex ample the  most recen t release  of the
  1662                         comme rcial WinZ ip tool);  but these  zip files  will not b e readable  by
  1663                         vario us other t ools or li braries, i ncluding W indows Exp lorer.
  1664                       
  1665        </para>
  1666                     
  1667                      
  1668        <para>
  1669                         The D otNetZip l ibrary can  read and  write zip  files with  UTF8-enco ded
  1670                         entri es, accord ing to the  PKware sp ec.  If yo u use DotN etZip for  both
  1671                         creat ing and re ading the  zip file,  and you us e UTF-8, t here will  be no
  1672                         loss  of informa tion in th e filename s. For exa mple, usin g a self-e xtractor
  1673                         creat ed by this  library w ill allow  you to unp ack files  correctly  with no
  1674                         loss  of informa tion in th e filename s.
  1675                       
  1676        </para>
  1677                     
  1678                      
  1679        <para>
  1680                         If yo u do not s et this fl ag, it wil l remain f alse.  If  this flag  is false,
  1681                         the 
  1682         <c>
  1683          ZipOutputS tream
  1684         </c>
  1685          will enco de all fil enames and  comments  using
  1686                         the I BM437 code page.  Thi s can caus e "loss of  informati on" on som e
  1687                         filen ames, but  the result ing zipfil e will be  more inter operable w ith other
  1688                         utili ties. As a n example  of the los s of infor mation, di acritics c an be
  1689                         lost.   The o-ti lde charac ter will b e down-cod ed to plai n o.  The  c with a
  1690                         cedil la (Unicod e 0xE7) us ed in Port ugese will  be downco ded to a c .
  1691                         Likew ise, the O -stroke ch aracter (U nicode 248 ), used in  Danish an d
  1692                         Norwe gian, will  be down-c oded to pl ain o. Chi nese chara cters cann ot be
  1693                         repre sented in  codepage I BM437; whe n using th e default  encoding,  Chinese
  1694                         chara cters in f ilenames w ill be rep resented a s ?. These  are all e xamples
  1695                         of "i nformation  loss".
  1696                       
  1697        </para>
  1698                     
  1699                      
  1700        <para>
  1701                         The l oss of inf ormation a ssociated  to the use  of the IB M437 encod ing is
  1702                         incon venient, a nd can als o lead to  runtime er rors. For  example, u sing
  1703                         IBM43 7, any seq uence of 4  Chinese c haracters  will be en coded as ? ???.  If
  1704                         your  applicatio n creates 
  1705         <c>
  1706          ZipOutputS tream
  1707         </c>
  1708         , does not  set the
  1709                         encod ing, then  adds two f iles, each  with name s of four  Chinese ch aracters
  1710                         each,  this will  result in  a duplica te filenam e exceptio n.  In the  case
  1711                         where  you add a  single fi le with a  name conta ining four  Chinese
  1712                         chara cters, the  zipfile w ill save p roperly, b ut extract ing that f ile
  1713                         later , with any  zip tool,  will resu lt in an e rror, beca use the qu estion
  1714                         mark  is not leg al for use  within fi lenames on  Windows.   These are  just a
  1715                         few e xamples of  the probl ems associ ated to lo ss of info rmation.
  1716                       
  1717        </para>
  1718                     
  1719                      
  1720        <para>
  1721                         This  flag is in dependent  of the enc oding of t he content  within th e entries
  1722                         in th e zip file . Think of  the zip f ile as a c ontainer -  it suppor ts an
  1723                         encod ing.  With in the con tainer are  other "co ntainers"  - the file  entries
  1724                         thems elves.  Th e encoding  within th ose entrie s is indep endent of  the
  1725                         encod ing of the  zip archi ve contain er for tho se entries .
  1726                       
  1727        </para>
  1728                     
  1729                      
  1730        <para>
  1731                         Rathe r than spe cify the e ncoding in  a binary  fashion us ing this f lag, an
  1732                         appli cation can  specify a n arbitrar y encoding  via the 
  1733         <see 
  1734          cref="P:Io nic.Zip.Zi pOutputStr eam.Provis ionalAlter nateEncodi ng"
  1735         />
  1736          property.   Setting  the encodi ng
  1737                         expli citly when  creating  zip archiv es will re sult in no n-complian t zip
  1738                         files  that, cur iously, ar e fairly i nteroperab le.  The c hallenge i s, the
  1739                         PKWar e specific ation does  not provi de for a w ay to spec ify that a n entry
  1740                         in a  zip archiv e uses a c ode page t hat is nei ther IBM43 7 nor UTF- 8.
  1741                         There fore if yo u set the  encoding e xplicitly  when creat ing a zip  archive,
  1742                         you m ust take c are upon r eading the  zip archi ve to use  the same c ode page.
  1743                         If yo u get it w rong, the  behavior i s undefine d and may  result in  incorrect
  1744                         filen ames, exce ptions, st omach upse t, hair lo ss, and ac ne.
  1745                       
  1746        </para>
  1747                      
  1748       </remarks>
  1749                     
  1750       <seealso 
  1751        cref="P:Io nic.Zip.Zi pOutputStr eam.Provis ionalAlter nateEncodi ng"
  1752       />
  1753               
  1754      </member>
  1755              
  1756      <member 
  1757       name="P:Io nic.Zip.Zi pOutputStr eam.Provis ionalAlter nateEncodi ng"
  1758      >
  1759                     
  1760       <summary>
  1761                        The t ext encodi ng to use  when emitt ing entrie s into the  zip archi ve, for
  1762                        those  entries w hose filen ames or co mments can not be enc oded with  the
  1763                        defau lt (IBM437 ) encoding .
  1764                      
  1765       </summary>
  1766                    
  1767                     
  1768       <remarks>
  1769                      
  1770        <para>
  1771                         In 
  1772         <see 
  1773          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  1774         >
  1775          its
  1776                          zip s pecificati on
  1777         </see>
  1778         , PKWare d escribes t wo options  for encod ing
  1779                         filen ames and c omments: u sing IBM43 7 or UTF-8 .  But, so me archivi ng tools
  1780                         or li braries do  not follo w the spec ification,  and inste ad encode
  1781                         chara cters usin g the syst em default  code page .  For exa mple, WinR AR when
  1782                         run o n a machin e in Shang hai may en code filen ames with  the Big-5  Chinese
  1783                         (950)  code page .  This be havior is  contrary t o the Zip  specificat ion, but
  1784                         it oc curs anywa y.
  1785                       
  1786        </para>
  1787                     
  1788                      
  1789        <para>
  1790                         When  using DotN etZip to w rite zip a rchives th at will be  read by o ne of
  1791                         these  other arc hivers, se t this pro perty to s pecify the  code page  to use
  1792                         when  encoding t he 
  1793         <see 
  1794          cref="P:Io nic.Zip.Zi pEntry.Fil eName"
  1795         />
  1796          and 
  1797         <see 
  1798          cref="P:Io nic.Zip.Zi pEntry.Com ment"
  1799         />
  1800          for each 
  1801         <c>
  1802          ZipEntry
  1803         </c>
  1804          in the zi p file, fo r
  1805                         value s that can not be enc oded with  the defaul t codepage  for zip f iles,
  1806                         IBM43 7.  This i s why this  property  is "provis ional".  I n all case s, IBM437
  1807                         is us ed where p ossible, i n other wo rds, where  no loss o f data wou ld
  1808                         resul t. It is p ossible, t herefore,  to have a  given entr y with a
  1809                         
  1810         <c>
  1811          Comment
  1812         </c>
  1813          encoded i n IBM437 a nd a 
  1814         <c>
  1815          FileName
  1816         </c>
  1817          encoded w ith the
  1818                         speci fied "prov isional" c odepage.
  1819                       
  1820        </para>
  1821                     
  1822                      
  1823        <para>
  1824                         Be aw are that a  zip file  created af ter you've  explicitl y set the
  1825                         
  1826         <c>
  1827          Provisiona lAlternate Encoding
  1828         </c>
  1829          property  to a value  other tha n
  1830                         IBM43 7 may not  be complia nt to the  PKWare spe cification , and may  not be
  1831                         reada ble by com pliant arc hivers.  O n the othe r hand, ma ny (most?)
  1832                         archi vers are n on-complia nt and can  read zip  files crea ted in arb itrary
  1833                         code  pages.  Th e trick is  to use or  specify t he proper  codepage w hen
  1834                         readi ng the zip .
  1835                       
  1836        </para>
  1837                     
  1838                      
  1839        <para>
  1840                         When  creating a  zip archi ve using t his librar y, it is p ossible to  change
  1841                         the v alue of 
  1842         <c>
  1843          Provisiona lAlternate Encoding
  1844         </c>
  1845          between e ach entry  you
  1846                         add,  and betwee n adding e ntries and  the call  to 
  1847         <c>
  1848          Close()
  1849         </c>
  1850         . Don't do
  1851                         this.  It will l ikely resu lt in a zi pfile that  is not re adable.  F or best
  1852                         inter operabilit y, either  leave 
  1853         <c>
  1854          Provisiona lAlternate Encoding
  1855         </c>
  1856                         alone , or speci fy it only  once, bef ore adding  any entri es to the
  1857                         
  1858         <c>
  1859          ZipOutputS tream
  1860         </c>
  1861          instance.   There is  one excep tion to th is
  1862                         recom mendation,  described  later.
  1863                       
  1864        </para>
  1865                     
  1866                      
  1867        <para>
  1868                         When  using an a rbitrary,  non-UTF8 c ode page f or encodin g, there i s no
  1869                         stand ard way fo r the crea tor applic ation - wh ether DotN etZip, Win Zip,
  1870                         WinRa r, or some thing else  - to form ally speci fy in the  zip file w hich
  1871                         codep age has be en used fo r the entr ies. As a  result, re aders of z ip files
  1872                         are n ot able to  inspect t he zip fil e and dete rmine the  codepage t hat was
  1873                         used  for the en tries cont ained with in it.  It  is left t o the appl ication
  1874                         or us er to dete rmine the  necessary  codepage w hen readin g zip file s encoded
  1875                         this  way.  If y ou use an  incorrect  codepage w hen readin g a zipfil e, you
  1876                         will  get entrie s with fil enames tha t are inco rrect, and  the incor rect
  1877                         filen ames may e ven contai n characte rs that ar e not lega l for use  within
  1878                         filen ames in Wi ndows. Ext racting en tries with  illegal c haracters  in the
  1879                         filen ames will  lead to ex ceptions.  It's too b ad, but th is is just  the way
  1880                         thing s are with  code page s in zip f iles. Cave at Emptor.
  1881                       
  1882        </para>
  1883                     
  1884                      
  1885        <para>
  1886                         One p ossible ap proach for  specifyin g the code  page for  a given zi p file is
  1887                         to de scribe the  code page  in a huma n-readable  form in t he Zip com ment. For
  1888                         examp le, the co mment may  read "Entr ies in thi s archive  are encode d in the
  1889                         Big5  code page" .  For max imum inter operabilit y, the zip  comment i n this
  1890                         case  should be  encoded in  the defau lt, IBM437  code page .  In this  case,
  1891                         the z ip comment  is encode d using a  different  page than  the filena mes.  To
  1892                         do th is, Specif
  1893         <c>
  1894          Provisiona lAlternate Encoding
  1895         </c>
  1896          to your d esired
  1897                         regio n-specific  code page , once bef ore adding  any entri es, and th en set
  1898                         the 
  1899         <see 
  1900          cref="P:Io nic.Zip.Zi pOutputStr eam.Commen t"
  1901         />
  1902          property  and reset
  1903                         
  1904         <c>
  1905          Provisiona lAlternate Encoding
  1906         </c>
  1907          to IBM437  before ca lling 
  1908         <c>
  1909          Close()
  1910         </c>
  1911         .
  1912                       
  1913        </para>
  1914                      
  1915       </remarks>
  1916               
  1917      </member>
  1918              
  1919      <member 
  1920       name="P:Io nic.Zip.Zi pOutputStr eam.Altern ateEncodin g"
  1921      >
  1922                    
  1923       <summary>
  1924                       A Text  Encoding  to use whe n encoding  the filen ames and c omments fo r
  1925                       all th e ZipEntry  items, du ring a Zip File.Save( ) operatio n.
  1926                     
  1927       </summary>
  1928                    
  1929       <remarks>
  1930                       
  1931        <para>
  1932                          Whet her the en coding spe cified her e is used  during the  save depe nds
  1933                          on 
  1934         <see 
  1935          cref="P:Io nic.Zip.Zi pOutputStr eam.Altern ateEncodin gUsage"
  1936         />
  1937         .
  1938                        
  1939        </para>
  1940                     
  1941       </remarks>
  1942               
  1943      </member>
  1944              
  1945      <member 
  1946       name="P:Io nic.Zip.Zi pOutputStr eam.Altern ateEncodin gUsage"
  1947      >
  1948                    
  1949       <summary>
  1950                       A flag  that tell s if and w hen this i nstance sh ould apply
  1951                       Altern ateEncodin g to encod e the file names and  comments a ssociated  to
  1952                       of Zip Entry obje cts contai ned within  this inst ance.
  1953                     
  1954       </summary>
  1955               
  1956      </member>
  1957              
  1958      <member 
  1959       name="P:Io nic.Zip.Zi pOutputStr eam.Defaul tEncoding"
  1960      >
  1961                    
  1962       <summary>
  1963                     The defa ult text e ncoding us ed in zip  archives.   It is num eric 437,  also
  1964                     known as  IBM437.
  1965                     
  1966       </summary>
  1967                    
  1968       <seealso 
  1969        cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  1970       />
  1971               
  1972      </member>
  1973              
  1974      <member 
  1975       name="P:Io nic.Zip.Zi pOutputStr eam.Parall elDeflateT hreshold"
  1976      >
  1977                     
  1978       <summary>
  1979                        The s ize thresh old for an  entry, ab ove which  a parallel  deflate i s used.
  1980                      
  1981       </summary>
  1982                    
  1983                     
  1984       <remarks>
  1985                     
  1986                        
  1987        <para>
  1988                           Dot NetZip wil l use mult iple threa ds to comp ress any Z ipEntry, w hen
  1989                           the  
  1990         <c>
  1991          Compressio nMethod
  1992         </c>
  1993          is Deflat e, and if  the entry  is
  1994                           lar ger than t he given s ize.  Zero  means "al ways use p arallel
  1995                           def late", whi le -1 mean s "never u se paralle l deflate" .
  1996                         
  1997        </para>
  1998                     
  1999                        
  2000        <para>
  2001                           If  the entry  size canno t be known  before co mpression,  as with a ny entry
  2002                           add ed via a Z ipOutputSt ream, then  Parallel  deflate wi ll never b e
  2003                           per formed, un less the v alue of th is propert y is zero.
  2004                         
  2005        </para>
  2006                     
  2007                        
  2008        <para>
  2009                           A p arallel de flate oper ations wil l speed up  the compr ession of
  2010                           lar ge files,  on compute rs with mu ltiple CPU s or multi ple CPU
  2011                           cor es.  For f iles above  1mb, on a  dual core  or dual-c pu (2p)
  2012                           mac hine, the  time requi red to com press the  file can b e 70% of t he
  2013                           sin gle-thread ed deflate .  For ver y large fi les on 4p  machines t he
  2014                           com pression c an be done  in 30% of  the norma l time.  T he downsid e
  2015                           is  that paral lel deflat e consumes  extra mem ory during  the defla te,
  2016                           and  the defla tion is sl ightly les s effectiv e.
  2017                         
  2018        </para>
  2019                     
  2020                        
  2021        <para>
  2022                           Par allel defl ate tends  to not be  as effecti ve as sing le-threade d deflate
  2023                           bec ause the o riginal da ta stream  is split i nto multip le indepen dent
  2024                           buf fers, each  of which  is compres sed in par allel.  Bu t because  they are
  2025                           tre ated indep endently,  there is n o opportun ity to sha re compres sion
  2026                           dic tionaries,  and addit ional fram ing bytes  must be ad ded to the  output
  2027                           str eam.  For  that reaso n, a defla ted stream  may be sl ightly lar ger when
  2028                           com pressed us ing parall el deflate , as compa red to a t raditional
  2029                           sin gle-thread ed deflate . For file s of about  512k, the  increase  over the
  2030                           nor mal deflat e is as mu ch as 5% o f the tota l compress ed size. F or larger
  2031                           fil es, the di fference c an be as s mall as 0. 1%.
  2032                         
  2033        </para>
  2034                     
  2035                        
  2036        <para>
  2037                           Mul ti-threade d compress ion does n ot give as  much an a dvantage w hen using
  2038                           Enc ryption. T his is pri marily bec ause encry ption tend s to slow  down
  2039                           the  entire pi peline. Al so, multi- threaded c ompression  gives les s of an
  2040                           adv antage whe n using lo wer compre ssion leve ls, for ex ample 
  2041         <see 
  2042          cref="F:Io nic.Zlib.C ompression Level.Best Speed"
  2043         />
  2044         .  You may  have to p erform
  2045                           som e tests to  determine  the best  approach f or your si tuation.
  2046                         
  2047        </para>
  2048                     
  2049                        
  2050        <para>
  2051                           The  default v alue for t his proper ty is -1,  which mean s parallel
  2052                           com pression w ill not be  performed  unless yo u set it t o zero.
  2053                         
  2054        </para>
  2055                     
  2056                      
  2057       </remarks>
  2058               
  2059      </member>
  2060              
  2061      <member 
  2062       name="P:Io nic.Zip.Zi pOutputStr eam.Parall elDeflateM axBufferPa irs"
  2063      >
  2064                     
  2065       <summary>
  2066                        The m aximum num ber of buf fer pairs  to use whe n performi ng
  2067                        paral lel compre ssion.
  2068                      
  2069       </summary>
  2070                    
  2071                     
  2072       <remarks>
  2073                      
  2074        <para>
  2075                         This  property s ets an upp er limit o n the numb er of memo ry
  2076                         buffe r pairs to  create wh en perform ing parall el
  2077                         compr ession.  T he impleme ntation of  the paral lel
  2078                         compr ession str eam alloca tes multip le buffers  to
  2079                         facil itate para llel compr ession.  A s each buf fer fills  up,
  2080                         the s tream uses  
  2081         <see 
  2082          cref="M:Sy stem.Threa ding.Threa dPool.Queu eUserWorkI tem(System .Threading .WaitCallb ack)"
  2083         >
  2084                          Threa dPool.Queu eUserWorkI tem()
  2085         </see>
  2086          to compre ss those
  2087                         buffe rs in a ba ckground t hreadpool  thread. Af ter a buff er
  2088                         is co mpressed,  it is re-o rdered and  written t o the outp ut
  2089                         strea m.
  2090                       
  2091        </para>
  2092                     
  2093                      
  2094        <para>
  2095                         A hig her number  of buffer  pairs ena bles a hig her degree  of
  2096                         paral lelism, wh ich tends  to increas e the spee d of compr ession on
  2097                         multi -cpu compu ters.  On  the other  hand, a hi gher numbe r of buffe r
  2098                         pairs  also impl ies a larg er memory  consumptio n, more ac tive worke r
  2099                         threa ds, and a  higher cpu  utilizati on for any  compressi on. This
  2100                         prope rty enable s the appl ication to  limit its  memory co nsumption  and
  2101                         CPU u tilization  behavior  depending  on require ments.
  2102                       
  2103        </para>
  2104                     
  2105                      
  2106        <para>
  2107                         For e ach compre ssion "tas k" that oc curs in pa rallel, th ere are 2
  2108                         buffe rs allocat ed: one fo r input an d one for  output.  T his proper ty
  2109                         sets  a limit fo r the numb er of pair s.  The to tal amount  of storag e
  2110                         space  allocated  for buffe ring will  then be (N *S*2), whe re N is th e
  2111                         numbe r of buffe r pairs, S  is the si ze of each  buffer (
  2112         <see 
  2113          cref="P:Io nic.Zip.Zi pOutputStr eam.CodecB ufferSize"
  2114         />
  2115         ).  By def ault, DotN etZip allo cates 4 bu ffer
  2116                         pairs  per CPU c ore, so if  your mach ine has 4  cores, and  you retai n
  2117                         the d efault buf fer size o f 128k, th en the
  2118                         Paral lelDeflate OutputStre am will us e 4 * 4 *  2 * 128kb  of buffer
  2119                         memor y in total , or 4mb,  in blocks  of 128kb.   If you th en set thi s
  2120                         prope rty to 8,  then the n umber will  be 8 * 2  * 128kb of  buffer
  2121                         memor y, or 2mb.
  2122                       
  2123        </para>
  2124                     
  2125                      
  2126        <para>
  2127                         CPU u tilization  will also  go up wit h addition al buffers , because  a
  2128                         large r number o f buffer p airs allow s a larger  number of  backgroun d
  2129                         threa ds to comp ress in pa rallel. If  you find  that paral lel
  2130                         compr ession is  consuming  too much m emory or C PU, you ca n adjust t his
  2131                         value  downward.
  2132                       
  2133        </para>
  2134                     
  2135                      
  2136        <para>
  2137                         The d efault val ue is 16.  Different  values may  deliver b etter or
  2138                         worse  results,  depending  on your pr iorities a nd the dyn amic
  2139                         perfo rmance cha racteristi cs of your  storage a nd compute  resources .
  2140                       
  2141        </para>
  2142                     
  2143                      
  2144        <para>
  2145                         This  property i s not the  number of  buffer pai rs to use;  it is an
  2146                         upper  limit. An  illustrat ion: Suppo se you hav e an appli cation tha t
  2147                         uses  the defaul t value of  this prop erty (whic h is 16),  and it run s
  2148                         on a  machine wi th 2 CPU c ores. In t hat case,  DotNetZip  will alloc ate
  2149                         4 buf fer pairs  per CPU co re, for a  total of 8  pairs.  T he upper
  2150                         limit  specified  by this p roperty ha s no effec t.
  2151                       
  2152        </para>
  2153                     
  2154                      
  2155        <para>
  2156                         The a pplication  can set t his value  at any tim e, but it  is
  2157                         effec tive only  if set bef ore callin g
  2158                         
  2159         <c>
  2160          ZipOutputS tream.Writ e()
  2161         </c>
  2162          for the f irst time.
  2163                       
  2164        </para>
  2165                      
  2166       </remarks>
  2167                    
  2168                     
  2169       <seealso 
  2170        cref="P:Io nic.Zip.Zi pOutputStr eam.Parall elDeflateT hreshold"
  2171       />
  2172                    
  2173               
  2174      </member>
  2175              
  2176      <member 
  2177       name="P:Io nic.Zip.Zi pOutputStr eam.CanRea d"
  2178      >
  2179                    
  2180       <summary>
  2181                     Always r eturns fal se.
  2182                     
  2183       </summary>
  2184               
  2185      </member>
  2186              
  2187      <member 
  2188       name="P:Io nic.Zip.Zi pOutputStr eam.CanSee k"
  2189      >
  2190                    
  2191       <summary>
  2192                     Always r eturns fal se.
  2193                     
  2194       </summary>
  2195               
  2196      </member>
  2197              
  2198      <member 
  2199       name="P:Io nic.Zip.Zi pOutputStr eam.CanWri te"
  2200      >
  2201                    
  2202       <summary>
  2203                     Always r eturns tru e.
  2204                     
  2205       </summary>
  2206               
  2207      </member>
  2208              
  2209      <member 
  2210       name="P:Io nic.Zip.Zi pOutputStr eam.Length "
  2211      >
  2212                    
  2213       <summary>
  2214                     Always r eturns a N otSupporte dException .
  2215                     
  2216       </summary>
  2217               
  2218      </member>
  2219              
  2220      <member 
  2221       name="P:Io nic.Zip.Zi pOutputStr eam.Positi on"
  2222      >
  2223                    
  2224       <summary>
  2225                     Setting  this prope rty always  returns a  NotSuppor tedExcepti on. Gettin g it
  2226                     returns  the value  of the Pos ition on t he underly ing stream .
  2227                     
  2228       </summary>
  2229               
  2230      </member>
  2231              
  2232      <member 
  2233       name="T:Io nic.Zip.Zi pInputStre am"
  2234      >
  2235                     
  2236       <summary>
  2237                        Provi des a stre am metapho r for read ing zip fi les.
  2238                      
  2239       </summary>
  2240                    
  2241                     
  2242       <remarks>
  2243                      
  2244        <para>
  2245                         This  class prov ides an al ternative  programmin g model fo r reading  zip files  to
  2246                         the o ne enabled  by the 
  2247         <see 
  2248          cref="T:Io nic.Zip.Zi pFile"
  2249         />
  2250          class.  U se this wh en reading  zip
  2251                         files , as an al ternative  to the 
  2252         <see 
  2253          cref="T:Io nic.Zip.Zi pFile"
  2254         />
  2255          class, wh en you wou ld
  2256                         like  to use a S tream clas s to read  the file.
  2257                       
  2258        </para>
  2259                     
  2260                      
  2261        <para>
  2262                         Some  applicatio n designs  require a  readable s tream for  input. Thi s stream c an
  2263                         be us ed to read  a zip fil e, and ext ract entri es.
  2264                       
  2265        </para>
  2266                     
  2267                      
  2268        <para>
  2269                         Both  the 
  2270         <c>
  2271          ZipInputSt ream
  2272         </c>
  2273          class and  the 
  2274         <c>
  2275          ZipFile
  2276         </c>
  2277          class can  be used
  2278                         to re ad and ext ract zip f iles.  Bot h of them  support ma ny of the  common zip
  2279                         featu res, inclu ding Unico de, differ ent compre ssion leve ls, and ZI P64.  The
  2280                         progr amming mod els differ . For exam ple, when  extracting  entries v ia calls t o
  2281                         the 
  2282         <c>
  2283          GetNextEnt ry()
  2284         </c>
  2285          and 
  2286         <c>
  2287          Read()
  2288         </c>
  2289          methods o n the
  2290                         
  2291         <c>
  2292          ZipInputSt ream
  2293         </c>
  2294          class, th e caller i s responsi ble for cr eating the  file,
  2295                         writi ng the byt es into th e file, se tting the  attributes  on the fi le, and
  2296                         setti ng the cre ated, last  modified,  and last  accessed t imestamps  on the
  2297                         file.  All of th ese things  are done  automatica lly by a c all to 
  2298         <see 
  2299          cref="M:Io nic.Zip.Zi pEntry.Ext ract"
  2300         >
  2301          ZipEntry.E xtract()
  2302         </see>
  2303         .  For thi s reason,  the
  2304                         
  2305         <c>
  2306          ZipInputSt ream
  2307         </c>
  2308          is genera lly recomm ended for  when your  applicatio n wants
  2309                         to ex tract the  data, with out storin g that dat a into a f ile.
  2310                       
  2311        </para>
  2312                     
  2313                      
  2314        <para>
  2315                         Aside  from the  obvious di fferences  in program ming model , there ar e some
  2316                         diffe rences in  capability  between t he 
  2317         <c>
  2318          ZipFile
  2319         </c>
  2320          class and  the
  2321                         
  2322         <c>
  2323          ZipInputSt ream
  2324         </c>
  2325          class.
  2326                       
  2327        </para>
  2328                     
  2329                      
  2330        <list 
  2331         type="bull et"
  2332        >
  2333                         
  2334         <item>
  2335                            
  2336          <c>
  2337           ZipFile
  2338          </c>
  2339           can be us ed to crea te or upda te zip fil es, or rea d and
  2340                            ext ract zip f iles. 
  2341          <c>
  2342           ZipInputSt ream
  2343          </c>
  2344           can be us ed only to  read and
  2345                            ext ract zip f iles. If y ou want to  use a str eam to cre ate zip fi les, check
  2346                            out  the 
  2347          <see 
  2348           cref="T:Io nic.Zip.Zi pOutputStr eam"
  2349          />
  2350          .
  2351                          
  2352         </item>
  2353                      
  2354                         
  2355         <item>
  2356                            
  2357          <c>
  2358           ZipInputSt ream
  2359          </c>
  2360           cannot re ad segment ed or span ned
  2361                            zip  files.
  2362                          
  2363         </item>
  2364                      
  2365                         
  2366         <item>
  2367                            
  2368          <c>
  2369           ZipInputSt ream
  2370          </c>
  2371           will not  read Zip f ile commen ts.
  2372                          
  2373         </item>
  2374                      
  2375                         
  2376         <item>
  2377                            Whe n reading  larger fil es, 
  2378          <c>
  2379           ZipInputSt ream
  2380          </c>
  2381           will alwa ys underpe rform
  2382                            
  2383          <c>
  2384           ZipFile
  2385          </c>
  2386          . This is  because th
  2387          <c>
  2388           ZipInputSt ream
  2389          </c>
  2390           does a fu ll scan on  the
  2391                            zip  file, whi le the 
  2392          <c>
  2393           ZipFile
  2394          </c>
  2395           class rea ds the cen tral direc tory of th e
  2396                            zip  file.
  2397                          
  2398         </item>
  2399                      
  2400                       
  2401        </list>
  2402                     
  2403                      
  2404       </remarks>
  2405               
  2406      </member>
  2407              
  2408      <member 
  2409       name="M:Io nic.Zip.Zi pInputStre am.#ctor(S ystem.IO.S tream)"
  2410      >
  2411                     
  2412       <summary>
  2413                        Creat e a 
  2414        <c>
  2415         ZipInputSt ream
  2416        </c>
  2417        , wrapping  it around  an existi ng stream.
  2418                      
  2419       </summary>
  2420                    
  2421                     
  2422       <remarks>
  2423                     
  2424                      
  2425        <para>
  2426                         While  the 
  2427         <see 
  2428          cref="T:Io nic.Zip.Zi pFile"
  2429         />
  2430          class is  generally  easier
  2431                         to us e, this cl ass provid es an alte rnative to  those
  2432                         appli cations th at want to  read from  a zipfile  directly,
  2433                         using  a 
  2434         <see 
  2435          cref="T:Sy stem.IO.St ream"
  2436         />
  2437         .
  2438                       
  2439        </para>
  2440                     
  2441                      
  2442        <para>
  2443                         Both  the 
  2444         <c>
  2445          ZipInputSt ream
  2446         </c>
  2447          class and  the 
  2448         <c>
  2449          ZipFile
  2450         </c>
  2451          class can  be used
  2452                         to re ad and ext ract zip f iles.  Bot h of them  support ma ny of the  common zip
  2453                         featu res, inclu ding Unico de, differ ent compre ssion leve ls, and ZI P64.  The
  2454                         progr amming mod els differ . For exam ple, when  extracting  entries v ia calls t o
  2455                         the 
  2456         <c>
  2457          GetNextEnt ry()
  2458         </c>
  2459          and 
  2460         <c>
  2461          Read()
  2462         </c>
  2463          methods o n the
  2464                         
  2465         <c>
  2466          ZipInputSt ream
  2467         </c>
  2468          class, th e caller i s responsi ble for cr eating the  file,
  2469                         writi ng the byt es into th e file, se tting the  attributes  on the fi le, and
  2470                         setti ng the cre ated, last  modified,  and last  accessed t imestamps  on the
  2471                         file.  All of th ese things  are done  automatica lly by a c all to 
  2472         <see 
  2473          cref="M:Io nic.Zip.Zi pEntry.Ext ract"
  2474         >
  2475          ZipEntry.E xtract()
  2476         </see>
  2477         .  For thi s reason,  the
  2478                         
  2479         <c>
  2480          ZipInputSt ream
  2481         </c>
  2482          is genera lly recomm ended for  when your  applicatio n wants
  2483                         to ex tract the  data, with out storin g that dat a into a f ile.
  2484                       
  2485        </para>
  2486                     
  2487                      
  2488        <para>
  2489                         Aside  from the  obvious di fferences  in program ming model , there ar e some
  2490                         diffe rences in  capability  between t he 
  2491         <c>
  2492          ZipFile
  2493         </c>
  2494          class and  the
  2495                         
  2496         <c>
  2497          ZipInputSt ream
  2498         </c>
  2499          class.
  2500                       
  2501        </para>
  2502                     
  2503                      
  2504        <list 
  2505         type="bull et"
  2506        >
  2507                         
  2508         <item>
  2509                          
  2510          <c>
  2511           ZipFile
  2512          </c>
  2513           can be us ed to crea te or upda te zip fil es, or rea d and extr act
  2514                          zip f iles. 
  2515          <c>
  2516           ZipInputSt ream
  2517          </c>
  2518           can be us ed only to  read and  extract zi p
  2519                            fil es. If you  want to u se a strea m to creat e zip file s, check o ut the 
  2520          <see 
  2521           cref="T:Io nic.Zip.Zi pOutputStr eam"
  2522          />
  2523          .
  2524                          
  2525         </item>
  2526                      
  2527                         
  2528         <item>
  2529                            
  2530          <c>
  2531           ZipInputSt ream
  2532          </c>
  2533           cannot re ad segment ed or span ned
  2534                            zip  files.
  2535                          
  2536         </item>
  2537                      
  2538                         
  2539         <item>
  2540                            
  2541          <c>
  2542           ZipInputSt ream
  2543          </c>
  2544           will not  read Zip f ile commen ts.
  2545                          
  2546         </item>
  2547                      
  2548                         
  2549         <item>
  2550                            Whe n reading  larger fil es, 
  2551          <c>
  2552           ZipInputSt ream
  2553          </c>
  2554           will alwa ys underpe rform
  2555                            
  2556          <c>
  2557           ZipFile
  2558          </c>
  2559          . This is  because th
  2560          <c>
  2561           ZipInputSt ream
  2562          </c>
  2563           does a fu ll scan on  the
  2564                            zip  file, whi le the 
  2565          <c>
  2566           ZipFile
  2567          </c>
  2568           class rea ds the cen tral direc tory of th e
  2569                            zip  file.
  2570                          
  2571         </item>
  2572                      
  2573                       
  2574        </list>
  2575                     
  2576                      
  2577       </remarks>
  2578                    
  2579                     
  2580       <param 
  2581        name="stre am"
  2582       >
  2583                        The s tream to r ead. It mu st be read able. This  stream wi ll be clos ed at
  2584                        the t ime the 
  2585        <c>
  2586         ZipInputSt ream
  2587        </c>
  2588         is closed .
  2589                      
  2590       </param>
  2591                    
  2592                     
  2593       <example>
  2594                     
  2595                        This  example sh ows how to  read a zi p file, an d extract  entries, u sing the
  2596                        
  2597        <c>
  2598         ZipInputSt ream
  2599        </c>
  2600         class.
  2601                     
  2602                      
  2603        <code 
  2604         lang="C#"
  2605        >
  2606                       private  void Unzi p()
  2607                       {
  2608                           byt e[] buffer = new byte [2048];
  2609                           int  n;
  2610                           usi ng (var ra w = File.O pen(inputF ileName, F ileMode.Op en, FileAc cess.Read) )
  2611                           {
  2612                                using (va r input= n ew ZipInpu tStream(ra w))
  2613                                {
  2614                                    ZipEn try e;
  2615                                    while  (( e = in put.GetNex tEntry())  != null)
  2616                                    {
  2617                                        i f (e.IsDir ectory) co ntinue;
  2618                                        s tring outp utPath = P ath.Combin e(extractD ir, e.File Name);
  2619                                        u sing (var  output = F ile.Open(o utputPath,  FileMode. Create, Fi leAccess.R eadWrite))
  2620                                        {
  2621                                             while ( (n= input. Read(buffe r, 0, buff er.Length) ) &gt; 0)
  2622                                             {
  2623                                                 out put.Write( buffer,0,n );
  2624                                             }
  2625                                        }
  2626                                    }
  2627                                }
  2628                           }
  2629                       }
  2630                       
  2631        </code>
  2632                     
  2633                      
  2634        <code 
  2635         lang="VB"
  2636        >
  2637                       Private  Sub UnZip ()
  2638                           Dim  inputFile Name As St ring = "My Archive.zi p"
  2639                           Dim  extractDi r As Strin g = "extra ct"
  2640                           Dim  buffer As  Byte() =  New Byte(2 048) {}
  2641                           Usi ng raw As  FileStream  = File.Op en(inputFi leName, Fi leMode.Ope n, FileAcc ess.Read)
  2642                                Using inp ut As ZipI nputStream  = New Zip InputStrea m(raw)
  2643                                    Dim e  As ZipEnt ry
  2644                                    Do Wh ile (Not e  = input.G etNextEntr y Is Nothi ng)
  2645                                        I f Not e.Is Directory  Then
  2646                                             Using o utput As F ileStream  = File.Ope n(Path.Com bine(extra ctDir, e.F ileName),  _
  2647                                                                                        FileMode .Create, F ileAccess. ReadWrite)
  2648                                                 Dim  n As Inte ger
  2649                                                 Do  While (n =  input.Rea d(buffer,  0, buffer. Length) &g t; 0)
  2650                                                      output.Wr ite(buffer , 0, n)
  2651                                                 Loo p
  2652                                             End Usi ng
  2653                                        E nd If
  2654                                    Loop
  2655                                End Using
  2656                           End  Using
  2657                       End Sub
  2658                       
  2659        </code>
  2660                      
  2661       </example>
  2662               
  2663      </member>
  2664              
  2665      <member 
  2666       name="M:Io nic.Zip.Zi pInputStre am.#ctor(S ystem.Stri ng)"
  2667      >
  2668                     
  2669       <summary>
  2670                        Creat e a 
  2671        <c>
  2672         ZipInputSt ream
  2673        </c>
  2674        , given th e name of  an existin g zip file .
  2675                      
  2676       </summary>
  2677                    
  2678                     
  2679       <remarks>
  2680                     
  2681                      
  2682        <para>
  2683                         This  constructo r opens a 
  2684         <c>
  2685          FileStream
  2686         </c>
  2687          for the g iven zipfi le, and
  2688                         wraps  a 
  2689         <c>
  2690          ZipInputSt ream
  2691         </c>
  2692          around th at.  See t he documen tation for  the
  2693                         
  2694         <see 
  2695          cref="M:Io nic.Zip.Zi pInputStre am.#ctor(S ystem.IO.S tream)"
  2696         />
  2697          construct or for ful l details.
  2698                       
  2699        </para>
  2700                     
  2701                      
  2702        <para>
  2703                         While  the 
  2704         <see 
  2705          cref="T:Io nic.Zip.Zi pFile"
  2706         />
  2707          class is  generally  easier
  2708                         to us e, this cl ass provid es an alte rnative to  those
  2709                         appli cations th at want to  read from  a zipfile  directly,
  2710                         using  a 
  2711         <see 
  2712          cref="T:Sy stem.IO.St ream"
  2713         />
  2714         .
  2715                       
  2716        </para>
  2717                     
  2718                      
  2719       </remarks>
  2720                    
  2721                     
  2722       <param 
  2723        name="file Name"
  2724       >
  2725                        The n ame of the  filesyste m file to  read.
  2726                      
  2727       </param>
  2728                    
  2729                     
  2730       <example>
  2731                     
  2732                        This  example sh ows how to  read a zi p file, an d extract  entries, u sing the
  2733                        
  2734        <c>
  2735         ZipInputSt ream
  2736        </c>
  2737         class.
  2738                     
  2739                      
  2740        <code 
  2741         lang="C#"
  2742        >
  2743                       private  void Unzi p()
  2744                       {
  2745                           byt e[] buffer = new byte [2048];
  2746                           int  n;
  2747                           usi ng (var in put= new Z ipInputStr eam(inputF ileName))
  2748                           {
  2749                                ZipEntry  e;
  2750                                while ((  e = input. GetNextEnt ry()) != n ull)
  2751                                {
  2752                                    if (e .IsDirecto ry) contin ue;
  2753                                    strin g outputPa th = Path. Combine(ex tractDir,  e.FileName );
  2754                                    using  (var outp ut = File. Open(outpu tPath, Fil eMode.Crea te, FileAc cess.ReadW rite))
  2755                                    {
  2756                                        w hile ((n=  input.Read (buffer, 0 , buffer.L ength)) &g t; 0)
  2757                                        {
  2758                                             output. Write(buff er,0,n);
  2759                                        }
  2760                                    }
  2761                                }
  2762                           }
  2763                       }
  2764                       
  2765        </code>
  2766                     
  2767                      
  2768        <code 
  2769         lang="VB"
  2770        >
  2771                       Private  Sub UnZip ()
  2772                           Dim  inputFile Name As St ring = "My Archive.zi p"
  2773                           Dim  extractDi r As Strin g = "extra ct"
  2774                           Dim  buffer As  Byte() =  New Byte(2 048) {}
  2775                           Usi ng input A s ZipInput Stream = N ew ZipInpu tStream(in putFileNam e)
  2776                                Dim e As  ZipEntry
  2777                                Do While  (Not e = i nput.GetNe xtEntry Is  Nothing)
  2778                                    If No t e.IsDire ctory Then
  2779                                        U sing outpu t As FileS tream = Fi le.Open(Pa th.Combine (extractDi r, e.FileN ame), _
  2780                                                                                   Fi leMode.Cre ate, FileA ccess.Read Write)
  2781                                             Dim n A s Integer
  2782                                             Do Whil e (n = inp ut.Read(bu ffer, 0, b uffer.Leng th) &gt; 0 )
  2783                                                 out put.Write( buffer, 0,  n)
  2784                                             Loop
  2785                                        E nd Using
  2786                                    End I f
  2787                                Loop
  2788                           End  Using
  2789                       End Sub
  2790                       
  2791        </code>
  2792                      
  2793       </example>
  2794               
  2795      </member>
  2796              
  2797      <member 
  2798       name="M:Io nic.Zip.Zi pInputStre am.#ctor(S ystem.IO.S tream,Syst em.Boolean )"
  2799      >
  2800                     
  2801       <summary>
  2802                        Creat e a 
  2803        <c>
  2804         ZipInputSt ream
  2805        </c>
  2806        , explicit ly specify ing whethe r to
  2807                        keep  the underl ying strea m open.
  2808                      
  2809       </summary>
  2810                    
  2811                     
  2812       <remarks>
  2813                        See t he documen tation for  the 
  2814        <see 
  2815         cref="M:Io nic.Zip.Zi pInputStre am.#ctor(S ystem.IO.S tream)"
  2816        >
  2817         ZipInputSt ream(Strea m)
  2818        </see>
  2819                        const ructor for  a discuss ion of the  class, an d an examp le of how  to use the  class.
  2820                      
  2821       </remarks>
  2822                    
  2823                     
  2824       <param 
  2825        name="stre am"
  2826       >
  2827                        The s tream to r ead from.  It must be  readable.
  2828                      
  2829       </param>
  2830                    
  2831                     
  2832       <param 
  2833        name="leav eOpen"
  2834       >
  2835                        true  if the app lication w ould like  the stream
  2836                        to re main open  after the 
  2837        <c>
  2838         ZipInputSt ream
  2839        </c>
  2840         has been  closed.
  2841                      
  2842       </param>
  2843               
  2844      </member>
  2845              
  2846      <member 
  2847       name="M:Io nic.Zip.Zi pInputStre am.ToStrin g"
  2848      >
  2849                    
  2850       <summary>
  2851        Provides a  string re presentati on of the  instance.
  2852       </summary>
  2853                    
  2854       <remarks>
  2855                       
  2856        <para>
  2857                          This  can be us eful for d ebugging p urposes.
  2858                        
  2859        </para>
  2860                     
  2861       </remarks>
  2862                    
  2863       <returns>
  2864        a string r epresentat ion of the  instance.
  2865       </returns>
  2866               
  2867      </member>
  2868              
  2869      <member 
  2870       name="M:Io nic.Zip.Zi pInputStre am.Read(Sy stem.Byte[ ],System.I nt32,Syste m.Int32)"
  2871      >
  2872                     
  2873       <summary>
  2874                        Read  the data f rom the st ream into  the buffer .
  2875                      
  2876       </summary>
  2877                    
  2878                     
  2879       <remarks>
  2880                      
  2881        <para>
  2882                         The d ata for th e zipentry  will be d ecrypted a nd uncompr essed, as
  2883                         neces sary, befo re being c opied into  the buffe r.
  2884                       
  2885        </para>
  2886                     
  2887                      
  2888        <para>
  2889                         You m ust set th
  2890         <see 
  2891          cref="P:Io nic.Zip.Zi pInputStre am.Passwor d"
  2892         />
  2893          property  before cal ling
  2894                         
  2895         <c>
  2896          Read()
  2897         </c>
  2898          the first  time for  an encrypt ed entry.   To determ ine if an
  2899                         entry  is encryp ted and re quires a p assword, c heck the 
  2900         <see 
  2901          cref="P:Io nic.Zip.Zi pEntry.Enc ryption"
  2902         >
  2903          ZipEntry.E ncryption
  2904         </see>
  2905          property.
  2906                       
  2907        </para>
  2908                      
  2909       </remarks>
  2910                    
  2911                     
  2912       <param 
  2913        name="buff er"
  2914       >
  2915        The buffer  to hold t he data re ad from th e stream.
  2916       </param>
  2917                     
  2918       <param 
  2919        name="offs et"
  2920       >
  2921        the offset  within th e buffer t o copy the  first byt e read.
  2922       </param>
  2923                     
  2924       <param 
  2925        name="coun t"
  2926       >
  2927        the number  of bytes  to read.
  2928       </param>
  2929                     
  2930       <returns>
  2931        the number  of bytes  read, afte r decrypti on and dec ompression .
  2932       </returns>
  2933               
  2934      </member>
  2935              
  2936      <member 
  2937       name="M:Io nic.Zip.Zi pInputStre am.GetNext Entry"
  2938      >
  2939                     
  2940       <summary>
  2941                        Read  the next e ntry from  the zip fi le.
  2942                      
  2943       </summary>
  2944                    
  2945                     
  2946       <remarks>
  2947                      
  2948        <para>
  2949                         Call  this metho d just bef ore callin
  2950         <see 
  2951          cref="M:Io nic.Zip.Zi pInputStre am.Read(Sy stem.Byte[ ],System.I nt32,Syste m.Int32)"
  2952         />
  2953         ,
  2954                         to po sition the  pointer i n the zip  file to th e next ent ry that ca n be
  2955                         read.   Subseque nt calls t
  2956         <c>
  2957          Read()
  2958         </c>
  2959         , will dec rypt and d ecompress  the
  2960                         data  in the zip  file, unt il 
  2961         <c>
  2962          Read()
  2963         </c>
  2964          returns 0 .
  2965                       
  2966        </para>
  2967                     
  2968                      
  2969        <para>
  2970                         Each  time you c all 
  2971         <c>
  2972          GetNextEnt ry()
  2973         </c>
  2974         , the poin ter in the  wrapped
  2975                         strea m is moved  to the ne xt entry i n the zip  file.  If  you call 
  2976         <see 
  2977          cref="M:Io nic.Zip.Zi pInputStre am.Seek(Sy stem.Int64 ,System.IO .SeekOrigi n)"
  2978         />
  2979         , and thus  re-positi on the poi nter withi n
  2980                         the f ile, you w ill need t o call 
  2981         <c>
  2982          GetNextEnt ry()
  2983         </c>
  2984          again, to  insure
  2985                         that  the file p ointer is  positioned  at the be ginning of  a zip ent ry.
  2986                       
  2987        </para>
  2988                     
  2989                      
  2990        <para>
  2991                         This  method ret urns the 
  2992         <c>
  2993          ZipEntry
  2994         </c>
  2995         . Using a  stream app roach, you  will
  2996                         read  the raw by tes for an  entry in  a zip file  via calls  to 
  2997         <c>
  2998          Read()
  2999         </c>
  3000         .
  3001                         Alter natively,  you can ex tract an e ntry into  a file, or  a stream,  by
  3002                         calli ng 
  3003         <see 
  3004          cref="M:Io nic.Zip.Zi pEntry.Ext ract"
  3005         />
  3006         , or one o f its sibl ings.
  3007                       
  3008        </para>
  3009                     
  3010                      
  3011       </remarks>
  3012                    
  3013                     
  3014       <returns>
  3015                        The 
  3016        <c>
  3017         ZipEntry
  3018        </c>
  3019         read. Ret urns null  (or Nothin g in VB) i f there ar e no more
  3020                        entri es in the  zip file.
  3021                      
  3022       </returns>
  3023                    
  3024               
  3025      </member>
  3026              
  3027      <member 
  3028       name="M:Io nic.Zip.Zi pInputStre am.Dispose (System.Bo olean)"
  3029      >
  3030                     
  3031       <summary>
  3032                        Dispo se the str eam.
  3033                      
  3034       </summary>
  3035                    
  3036                     
  3037       <remarks>
  3038                      
  3039        <para>
  3040                         This  method dis poses the  ZipInputSt ream.  It  may also c lose the
  3041                         under lying stre am, depend ing on whi ch constru ctor was u sed.
  3042                       
  3043        </para>
  3044                     
  3045                      
  3046        <para>
  3047                         Typic ally the a pplication  will call  
  3048         <c>
  3049          Dispose()
  3050         </c>
  3051          implicitl y, via
  3052                         a 
  3053         <c>
  3054          using
  3055         </c>
  3056          statement  in C#, or  a 
  3057         <c>
  3058          Using
  3059         </c>
  3060          statement  in VB.
  3061                       
  3062        </para>
  3063                     
  3064                        
  3065        <para>
  3066                           App lication c ode won't  call this  code direc tly.  This  method ma y
  3067                           be  invoked in  two disti nct scenar ios.  If d isposing = = true, th e
  3068                           met hod has be en called  directly o r indirect ly by a us er's code,
  3069                           for  example v ia the pub lic Dispos e() method . In this  case, both
  3070                           man aged and u nmanaged r esources c an be refe renced and  disposed.
  3071                           If  disposing  == false,  the method  has been  called by  the runtim e
  3072                           fro m inside t he object  finalizer  and this m ethod shou ld not
  3073                           ref erence oth er objects ; in that  case only  unmanaged  resources
  3074                           mus t be refer enced or d isposed.
  3075                         
  3076        </para>
  3077                      
  3078       </remarks>
  3079                    
  3080                     
  3081       <param 
  3082        name="disp osing"
  3083       >
  3084                        true  if the Dis pose metho d was invo ked by use r code.
  3085                      
  3086       </param>
  3087               
  3088      </member>
  3089              
  3090      <member 
  3091       name="M:Io nic.Zip.Zi pInputStre am.Flush"
  3092      >
  3093                    
  3094       <summary>
  3095                     This is  a no-op.
  3096                     
  3097       </summary>
  3098               
  3099      </member>
  3100              
  3101      <member 
  3102       name="M:Io nic.Zip.Zi pInputStre am.Write(S ystem.Byte [],System. Int32,Syst em.Int32)"
  3103      >
  3104                    
  3105       <summary>
  3106                     This met hod always  throws a  NotSupport edExceptio n.
  3107                     
  3108       </summary>
  3109                    
  3110       <param 
  3111        name="buff er"
  3112       >
  3113        ignored
  3114       </param>
  3115                    
  3116       <param 
  3117        name="offs et"
  3118       >
  3119        ignored
  3120       </param>
  3121                    
  3122       <param 
  3123        name="coun t"
  3124       >
  3125        ignored
  3126       </param>
  3127               
  3128      </member>
  3129              
  3130      <member 
  3131       name="M:Io nic.Zip.Zi pInputStre am.Seek(Sy stem.Int64 ,System.IO .SeekOrigi n)"
  3132      >
  3133                     
  3134       <summary>
  3135                        This  method see ks in the  underlying  stream.
  3136                      
  3137       </summary>
  3138                    
  3139                     
  3140       <remarks>
  3141                      
  3142        <para>
  3143                         Call  this metho d if you w ant to see k around w ithin the  zip file f or random  access.
  3144                       
  3145        </para>
  3146                     
  3147                      
  3148        <para>
  3149                         Appli cations ca n intermix  calls to 
  3150         <c>
  3151          Seek()
  3152         </c>
  3153          with call s to 
  3154         <see 
  3155          cref="M:Io nic.Zip.Zi pInputStre am.GetNext Entry"
  3156         />
  3157         .  After a  call to 
  3158         <c>
  3159          Seek()
  3160         </c>
  3161         ,
  3162                         
  3163         <c>
  3164          GetNextEnt ry()
  3165         </c>
  3166          will get  the next 
  3167         <c>
  3168          ZipEntry
  3169         </c>
  3170          that fall s after
  3171                         the c urrent pos ition in t he input s tream. You 're on you r own for  finding
  3172                         out j ust where  to seek in  the strea m, to get  to the var ious entri es.
  3173                       
  3174        </para>
  3175                     
  3176                      
  3177       </remarks>
  3178                    
  3179                     
  3180       <param 
  3181        name="offs et"
  3182       >
  3183        the offset  point to  seek to
  3184       </param>
  3185                     
  3186       <param 
  3187        name="orig in"
  3188       >
  3189        the refere nce point  from which  to seek
  3190       </param>
  3191                     
  3192       <returns>
  3193        The new po sition
  3194       </returns>
  3195               
  3196      </member>
  3197              
  3198      <member 
  3199       name="M:Io nic.Zip.Zi pInputStre am.SetLeng th(System. Int64)"
  3200      >
  3201                    
  3202       <summary>
  3203                     This met hod always  throws a  NotSupport edExceptio n.
  3204                     
  3205       </summary>
  3206                    
  3207       <param 
  3208        name="valu e"
  3209       >
  3210        ignored
  3211       </param>
  3212               
  3213      </member>
  3214              
  3215      <member 
  3216       name="P:Io nic.Zip.Zi pInputStre am.Provisi onalAltern ateEncodin g"
  3217      >
  3218                     
  3219       <summary>
  3220                        The t ext encodi ng to use  when readi ng entries  into the  zip archiv e, for
  3221                        those  entries w hose filen ames or co mments can not be enc oded with  the
  3222                        defau lt (IBM437 ) encoding .
  3223                      
  3224       </summary>
  3225                    
  3226                     
  3227       <remarks>
  3228                      
  3229        <para>
  3230                         In 
  3231         <see 
  3232          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  3233         >
  3234          its
  3235                          zip s pecificati on
  3236         </see>
  3237         , PKWare d escribes t wo options  for encod ing
  3238                         filen ames and c omments: u sing IBM43 7 or UTF-8 .  But, so me archivi ng tools
  3239                         or li braries do  not follo w the spec ification,  and inste ad encode
  3240                         chara cters usin g the syst em default  code page .  For exa mple, WinR AR when
  3241                         run o n a machin e in Shang hai may en code filen ames with  the Big-5  Chinese
  3242                         (950)  code page .  This be havior is  contrary t o the Zip  specificat ion, but
  3243                         it oc curs anywa y.
  3244                       
  3245        </para>
  3246                     
  3247                      
  3248        <para>
  3249                         When  using DotN etZip to r ead zip ar chives tha t use some thing othe r than
  3250                         UTF-8  or IBM437 , set this  property  to specify  the code  page to us e when
  3251                         readi ng encoded  filenames  and comme nts for ea ch 
  3252         <c>
  3253          ZipEntry
  3254         </c>
  3255          in the zi p
  3256                         file.
  3257                       
  3258        </para>
  3259                     
  3260                      
  3261        <para>
  3262                         This  property i s "provisi onal". Whe n the entr y in the z ip archive  is not
  3263                         expli citly mark ed as usin g UTF-8, t hen IBM437  is used t o decode f ilenames
  3264                         and c omments. I f a loss o f data wou ld result  from using  IBM436 -
  3265                         speci fically wh en encodin g and deco ding is no t reflexiv e - the co depage
  3266                         speci fied here  is used. I t is possi ble, there fore, to h ave a give n entry
  3267                         with 
  3268         <c>
  3269          Comment
  3270         </c>
  3271          encoded i n IBM437 a nd a 
  3272         <c>
  3273          FileName
  3274         </c>
  3275          encoded w ith
  3276                         the s pecified " provisiona l" codepag e.
  3277                       
  3278        </para>
  3279                     
  3280                      
  3281        <para>
  3282                         When  a zip file  uses an a rbitrary,  non-UTF8 c ode page f or encodin g, there
  3283                         is no  standard  way for th e reader a pplication  - whether  DotNetZip , WinZip,
  3284                         WinRa r, or some thing else  - to know  which cod epage has  been used  for the
  3285                         entri es. Reader s of zip f iles are n ot able to  inspect t he zip fil e and
  3286                         deter mine the c odepage th at was use d for the  entries co ntained wi thin it.
  3287                         It is  left to t he applica tion or us er to dete rmine the  necessary  codepage
  3288                         when  reading zi p files en coded this  way.  If  you use an  incorrect  codepage
  3289                         when  reading a  zipfile, y ou will ge t entries  with filen ames that  are
  3290                         incor rect, and  the incorr ect filena mes may ev en contain  character s that
  3291                         are n ot legal f or use wit hin filena mes in Win dows. Extr acting ent ries with
  3292                         illeg al charact ers in the  filenames  will lead  to except ions. It's  too bad,
  3293                         but t his is jus t the way  things are  with code  pages in  zip files.  Caveat
  3294                         Empto r.
  3295                       
  3296        </para>
  3297                     
  3298                      
  3299       </remarks>
  3300               
  3301      </member>
  3302              
  3303      <member 
  3304       name="P:Io nic.Zip.Zi pInputStre am.CodecBu fferSize"
  3305      >
  3306                     
  3307       <summary>
  3308                        Size  of the wor k buffer t o use for  the ZLIB c odec durin g decompre ssion.
  3309                      
  3310       </summary>
  3311                    
  3312                     
  3313       <remarks>
  3314                        Setti ng this af fects the  performanc e and memo ry efficie ncy of com pression
  3315                        and d ecompressi on.  For l arger file s, setting  this to a  larger si ze may
  3316                        impro ve perform ance, but  the exact  numbers va ry dependi ng on avai lable
  3317                        memor y, and a b unch of ot her variab les. I don 't have go od firm
  3318                        recom mendations  on how to  set it.   You'll hav e to test  it yoursel f. Or
  3319                        just  leave it a lone and a ccept the  default.
  3320                      
  3321       </remarks>
  3322               
  3323      </member>
  3324              
  3325      <member 
  3326       name="P:Io nic.Zip.Zi pInputStre am.Passwor d"
  3327      >
  3328                     
  3329       <summary>
  3330                        Sets  the passwo rd to be u sed on the  
  3331        <c>
  3332         ZipInputSt ream
  3333        </c>
  3334         instance.
  3335                      
  3336       </summary>
  3337                    
  3338                     
  3339       <remarks>
  3340                     
  3341                      
  3342        <para>
  3343                         When  reading a  zip archiv e, this pa ssword is  used to re ad and dec rypt the
  3344                         entri es that ar e encrypte d within t he zip fil e. When en tries with in a zip
  3345                         file  use differ ent passwo rds, set t he appropr iate passw ord for th e entry
  3346                         befor e the firs t call to 
  3347         <c>
  3348          Read()
  3349         </c>
  3350          for each  entry.
  3351                       
  3352        </para>
  3353                     
  3354                      
  3355        <para>
  3356                         When  reading an  entry tha t is not e ncrypted,  the value  of this pr operty is
  3357                         ignor ed.
  3358                       
  3359        </para>
  3360                     
  3361                      
  3362       </remarks>
  3363                    
  3364                     
  3365       <example>
  3366                     
  3367                        This  example us es the Zip InputStrea m to read  and extrac t entries  from a
  3368                        zip f ile, using  a potenti ally diffe rent passw ord for ea ch entry.
  3369                     
  3370                      
  3371        <code 
  3372         lang="C#"
  3373        >
  3374                       byte[]  buffer= ne w byte[204 8];
  3375                       int n;
  3376                       using ( var raw =  File.Open( _inputFile Name, File Mode.Open,  FileAcces s.Read ))
  3377                       {
  3378                           usi ng (var in put= new Z ipInputStr eam(raw))
  3379                           {
  3380                                ZipEntry  e;
  3381                                while ((  e = input. GetNextEnt ry()) != n ull)
  3382                                {
  3383                                    input .Password  = Password ForEntry(e .FileName) ;
  3384                                    if (e .IsDirecto ry) contin ue;
  3385                                    strin g outputPa th = Path. Combine(_e xtractDir,  e.FileNam e);
  3386                                    using  (var outp ut = File. Open(outpu tPath, Fil eMode.Crea te, FileAc cess.ReadW rite))
  3387                                    {
  3388                                        w hile ((n=  input.Read (buffer,0, buffer.Len gth)) > 0)
  3389                                        {
  3390                                             output. Write(buff er,0,n);
  3391                                        }
  3392                                    }
  3393                                }
  3394                           }
  3395                       }
  3396                      
  3397                       
  3398        </code>
  3399                      
  3400       </example>
  3401               
  3402      </member>
  3403              
  3404      <member 
  3405       name="P:Io nic.Zip.Zi pInputStre am.CanRead "
  3406      >
  3407                    
  3408       <summary>
  3409                     Always r eturns tru e.
  3410                     
  3411       </summary>
  3412               
  3413      </member>
  3414              
  3415      <member 
  3416       name="P:Io nic.Zip.Zi pInputStre am.CanSeek "
  3417      >
  3418                    
  3419       <summary>
  3420                     Returns  the value  of 
  3421        <c>
  3422         CanSeek
  3423        </c>
  3424         for the u nderlying  (wrapped)  stream.
  3425                     
  3426       </summary>
  3427               
  3428      </member>
  3429              
  3430      <member 
  3431       name="P:Io nic.Zip.Zi pInputStre am.CanWrit e"
  3432      >
  3433                    
  3434       <summary>
  3435                     Always r eturns fal se.
  3436                     
  3437       </summary>
  3438               
  3439      </member>
  3440              
  3441      <member 
  3442       name="P:Io nic.Zip.Zi pInputStre am.Length"
  3443      >
  3444                    
  3445       <summary>
  3446                     Returns  the length  of the un derlying s tream.
  3447                     
  3448       </summary>
  3449               
  3450      </member>
  3451              
  3452      <member 
  3453       name="P:Io nic.Zip.Zi pInputStre am.Positio n"
  3454      >
  3455                    
  3456       <summary>
  3457                     Gets or  sets the p osition of  the under lying stre am.
  3458                     
  3459       </summary>
  3460                    
  3461       <remarks>
  3462                     Setting  the positi on is equi valent to  calling 
  3463        <c>
  3464         Seek(value , SeekOrig in.Begin)
  3465        </c>
  3466        .
  3467                     
  3468       </remarks>
  3469               
  3470      </member>
  3471              
  3472      <member 
  3473       name="M:Io nic.Zip.Zi pSegmented Stream.For Update(Sys tem.String ,System.UI nt32)"
  3474      >
  3475                    
  3476       <summary>
  3477                       Sort-o f like a f actory met hod, ForUp date is us ed only wh en
  3478                       the ap plication  needs to u pdate the  zip entry  metadata f or
  3479                       a segm ented zip  file, when  the start ing segmen t is earli er
  3480                       than t he ending  segment, f or a parti cular entr y.
  3481                     
  3482       </summary>
  3483                    
  3484       <remarks>
  3485                       
  3486        <para>
  3487                          The  update is  always con tiguous, n ever rolls  over.  As  a
  3488                          resu lt, this m ethod does n't need t o return a  ZSS; it c an
  3489                          simp ly return  a FileStre am.  That' s why it's  "sort of"
  3490                          like  a Factory  method.
  3491                        
  3492        </para>
  3493                       
  3494        <para>
  3495                          Call er must Cl ose/Dispos e the stre am object  returned b y
  3496                          this  method.
  3497                        
  3498        </para>
  3499                     
  3500       </remarks>
  3501               
  3502      </member>
  3503              
  3504      <member 
  3505       name="M:Io nic.Zip.Zi pSegmented Stream.Rea d(System.B yte[],Syst em.Int32,S ystem.Int3 2)"
  3506      >
  3507                    
  3508       <summary>
  3509                     Read fro m the stre am
  3510                     
  3511       </summary>
  3512                    
  3513       <param 
  3514        name="buff er"
  3515       >
  3516        the buffer  to read
  3517       </param>
  3518                    
  3519       <param 
  3520        name="offs et"
  3521       >
  3522        the offset  at which  to start
  3523       </param>
  3524                    
  3525       <param 
  3526        name="coun t"
  3527       >
  3528        the number  of bytes  to read
  3529       </param>
  3530                    
  3531       <returns>
  3532        the number  of bytes  actually r ead
  3533       </returns>
  3534               
  3535      </member>
  3536              
  3537      <member 
  3538       name="M:Io nic.Zip.Zi pSegmented Stream.Wri te(System. Byte[],Sys tem.Int32, System.Int 32)"
  3539      >
  3540                    
  3541       <summary>
  3542                     Write to  the strea m.
  3543                     
  3544       </summary>
  3545                    
  3546       <param 
  3547        name="buff er"
  3548       >
  3549        the buffer  from whic h to write
  3550       </param>
  3551                    
  3552       <param 
  3553        name="offs et"
  3554       >
  3555        the offset  at which  to start w riting
  3556       </param>
  3557                    
  3558       <param 
  3559        name="coun t"
  3560       >
  3561        the number  of bytes  to write
  3562       </param>
  3563               
  3564      </member>
  3565              
  3566      <member 
  3567       name="P:Io nic.Zip.Zi pSegmented Stream.Cur rentName"
  3568      >
  3569                    
  3570       <summary>
  3571                       Name o f the file system fil e correspo nding to t he current  segment.
  3572                     
  3573       </summary>
  3574                    
  3575       <remarks>
  3576                       
  3577        <para>
  3578                          The  name is no t always t he name cu rrently be ing used i n the
  3579                          file system.  W hen rwMode  is RwMode .Write, th e filesyst em file ha s a
  3580                          temp orary name  until the  stream is  closed or  until the  next segm ent is
  3581                          star ted.
  3582                        
  3583        </para>
  3584                     
  3585       </remarks>
  3586               
  3587      </member>
  3588              
  3589      <member 
  3590       name="T:Io nic.Zip.Co mHelper"
  3591      >
  3592                    
  3593       <summary>
  3594                     This cla ss exposes  a set of  COM-access ible wrapp ers for st atic
  3595                     methods  available  on the Zip File class .  You don 't need th is
  3596                     class un less you a re using D otNetZip f rom a COM  environmen t.
  3597                     
  3598       </summary>
  3599               
  3600      </member>
  3601              
  3602      <member 
  3603       name="M:Io nic.Zip.Co mHelper.Is ZipFile(Sy stem.Strin g)"
  3604      >
  3605                    
  3606       <summary>
  3607                      A wrapp er for 
  3608        <see 
  3609         cref="M:Io nic.Zip.Zi pFile.IsZi pFile(Syst em.String) "
  3610        >
  3611         ZipFile.Is ZipFile(st ring)
  3612        </see>
  3613                     
  3614       </summary>
  3615                    
  3616       <param 
  3617        name="file name"
  3618       >
  3619        The filena me to of t he zip fil e to check .
  3620       </param>
  3621                    
  3622       <returns>
  3623        true if th e file con tains a va lid zip fi le.
  3624       </returns>
  3625               
  3626      </member>
  3627              
  3628      <member 
  3629       name="M:Io nic.Zip.Co mHelper.Is ZipFileWit hExtract(S ystem.Stri ng)"
  3630      >
  3631                    
  3632       <summary>
  3633                      A wrapp er for 
  3634        <see 
  3635         cref="M:Io nic.Zip.Zi pFile.IsZi pFile(Syst em.String, System.Boo lean)"
  3636        >
  3637         ZipFile.Is ZipFile(st ring, bool )
  3638        </see>
  3639                     
  3640       </summary>
  3641                    
  3642       <remarks>
  3643                     We canno t use "ove rloaded" M ethod name s in COM i nterop.
  3644                     So, here , we use a  unique na me.
  3645                     
  3646       </remarks>
  3647                    
  3648       <param 
  3649        name="file name"
  3650       >
  3651        The filena me to of t he zip fil e to check .
  3652       </param>
  3653                    
  3654       <returns>
  3655        true if th e file con tains a va lid zip fi le.
  3656       </returns>
  3657               
  3658      </member>
  3659              
  3660      <member 
  3661       name="M:Io nic.Zip.Co mHelper.Ch eckZip(Sys tem.String )"
  3662      >
  3663                     
  3664       <summary>
  3665                       A wrap per for 
  3666        <see 
  3667         cref="M:Io nic.Zip.Zi pFile.Chec kZip(Syste m.String)"
  3668        >
  3669         ZipFile.Ch eckZip(str ing)
  3670        </see>
  3671                      
  3672       </summary>
  3673                     
  3674       <param 
  3675        name="file name"
  3676       >
  3677        The filena me to of t he zip fil e to check .
  3678       </param>
  3679                    
  3680                     
  3681       <returns>
  3682        true if th e named zi p file che cks OK. Ot herwise, f alse. 
  3683       </returns>
  3684               
  3685      </member>
  3686              
  3687      <member 
  3688       name="M:Io nic.Zip.Co mHelper.Ch eckZipPass word(Syste m.String,S ystem.Stri ng)"
  3689      >
  3690                     
  3691       <summary>
  3692                       A COM- friendly w rapper for  the stati c method 
  3693        <see 
  3694         cref="M:Io nic.Zip.Zi pFile.Chec kZipPasswo rd(System. String,Sys tem.String )"
  3695        />
  3696        .
  3697                      
  3698       </summary>
  3699                    
  3700                     
  3701       <param 
  3702        name="file name"
  3703       >
  3704        The filena me to of t he zip fil e to check .
  3705       </param>
  3706                    
  3707                     
  3708       <param 
  3709        name="pass word"
  3710       >
  3711        The passwo rd to chec k.
  3712       </param>
  3713                    
  3714                     
  3715       <returns>
  3716        true if th e named zi p file che cks OK. Ot herwise, f alse. 
  3717       </returns>
  3718               
  3719      </member>
  3720              
  3721      <member 
  3722       name="M:Io nic.Zip.Co mHelper.Fi xZipDirect ory(System .String)"
  3723      >
  3724                    
  3725       <summary>
  3726                      A wrapp er for 
  3727        <see 
  3728         cref="M:Io nic.Zip.Zi pFile.FixZ ipDirector y(System.S tring)"
  3729        >
  3730         ZipFile.Fi xZipDirect ory(string )
  3731        </see>
  3732                     
  3733       </summary>
  3734                    
  3735       <param 
  3736        name="file name"
  3737       >
  3738        The filena me to of t he zip fil e to fix.
  3739       </param>
  3740               
  3741      </member>
  3742              
  3743      <member 
  3744       name="M:Io nic.Zip.Co mHelper.Ge tZipLibrar yVersion"
  3745      >
  3746                    
  3747       <summary>
  3748                      A wrapp er for 
  3749        <see 
  3750         cref="P:Io nic.Zip.Zi pFile.Libr aryVersion "
  3751        >
  3752         ZipFile.Li braryVersi on
  3753        </see>
  3754                     
  3755       </summary>
  3756                    
  3757       <returns>
  3758                      the ver sion numbe r on the D otNetZip a ssembly, f ormatted a s a string .
  3759                     
  3760       </returns>
  3761               
  3762      </member>
  3763              
  3764      <member 
  3765       name="T:Io nic.Zip.Zi pErrorActi on"
  3766      >
  3767                     
  3768       <summary>
  3769                      An enum  providing  the optio ns when an  error occ urs during  opening o r reading
  3770                      of a fi le or dire ctory that  is being  saved to a  zip file.  
  3771                      
  3772       </summary>
  3773                    
  3774                     
  3775       <remarks>
  3776                       
  3777        <para>
  3778                          This  enum desc ribes the  actions th at the lib rary can t ake when a n error oc curs
  3779                          open ing or rea ding a fil e, as it i s being sa ved into a  Zip archi ve. 
  3780                        
  3781        </para>
  3782                     
  3783                       
  3784        <para>
  3785                           In  some cases  an error  will occur  when DotN etZip trie s to open  a file to  be
  3786                           add ed to the  zip archiv e.  In oth er cases,  an error m ight occur  after the
  3787                           fil e has been  successfu lly opened , while Do tNetZip is  reading t he file.
  3788                        
  3789        </para>
  3790                      
  3791                       
  3792        <para>
  3793                          The  first prob lem might  occur when  calling A ddDirector y() on a d irectory
  3794                          that  contains  a Clipper  .dbf file;  the file  is locked  by Clipper  and
  3795                          cann ot be open ed by anot her proces s. An exam ple of the  second pr oblem is
  3796                          the  ERROR_LOCK _VIOLATION  that resu lts when a  file is o pened by a nother
  3797                          proc ess, but n ot locked,  and a ran ge lock ha s been tak en on the  file.
  3798                          Micr osoft Outl ook takes  range lock s on .PST  files.
  3799                        
  3800        </para>
  3801                      
  3802       </remarks>
  3803               
  3804      </member>
  3805              
  3806      <member 
  3807       name="F:Io nic.Zip.Zi pErrorActi on.Throw"
  3808      >
  3809                    
  3810       <summary>
  3811                     Throw an  exception  when an e rror occur s while zi pping.  Th is is the  default
  3812                     behavior .  (For CO M clients,  this is a  0 (zero). )
  3813                     
  3814       </summary>
  3815               
  3816      </member>
  3817              
  3818      <member 
  3819       name="F:Io nic.Zip.Zi pErrorActi on.Skip"
  3820      >
  3821                    
  3822       <summary>
  3823                     When an  error occu rs during  zipping, f or example  a file ca nnot be op ened,
  3824                     skip the  file caus ing the er ror, and c ontinue zi pping.  (F or COM cli ents,
  3825                     this is  a 1.)
  3826                     
  3827       </summary>
  3828               
  3829      </member>
  3830              
  3831      <member 
  3832       name="F:Io nic.Zip.Zi pErrorActi on.Retry"
  3833      >
  3834                    
  3835       <summary>
  3836                     When an  error occu rs during  zipping, f or example  a file ca nnot be op ened,
  3837                     retry th e operatio n that cau sed the er ror. Be ca reful with  this opti on. If
  3838                     the erro r is not t emporary,  the librar y will ret ry forever .  (For CO M
  3839                     clients,  this is a  2.)
  3840                     
  3841       </summary>
  3842               
  3843      </member>
  3844              
  3845      <member 
  3846       name="F:Io nic.Zip.Zi pErrorActi on.InvokeE rrorEvent"
  3847      >
  3848                    
  3849       <summary>
  3850                     When an  error occu rs, invoke  the zipEr ror event.   The even t type use d is
  3851                     
  3852        <see 
  3853         cref="F:Io nic.Zip.Zi pProgressE ventType.E rror_Savin g"
  3854        />
  3855        .  A typic al use of  this optio n:
  3856                     a GUI ap plication  may wish t o pop up a  dialog to  allow the  user to v iew the
  3857                     error th at occurre d, and cho ose an app ropriate a ction.  Af ter your
  3858                     processi ng in the  error even t, if you  want to sk ip the fil e, set 
  3859        <see 
  3860         cref="P:Io nic.Zip.Zi pEntry.Zip ErrorActio n"
  3861        />
  3862         on the
  3863                     
  3864        <c>
  3865         ZipProgres sEventArgs .CurrentEn try
  3866        </c>
  3867         to 
  3868        <c>
  3869         Skip
  3870        </c>
  3871        .  If you  want the
  3872                     exceptio n to be th rown, set 
  3873        <c>
  3874         ZipErrorAc tion
  3875        </c>
  3876         on the 
  3877        <c>
  3878         CurrentEnt ry
  3879        </c>
  3880                     to 
  3881        <c>
  3882         Throw
  3883        </c>
  3884        .  If you  want to ca ncel the z ip, set
  3885                     
  3886        <c>
  3887         ZipProgres sEventArgs .Cancel
  3888        </c>
  3889         to true.   Cancellin g differs  from using
  3890                     Skip in  that a can cel will n ot save an y further  entries, i f there ar e any.
  3891                     (For COM  clients,  the value  of this en um is a 3. )
  3892                     
  3893       </summary>
  3894               
  3895      </member>
  3896              
  3897      <member 
  3898       name="T:Io nic.Zip.En cryptionAl gorithm"
  3899      >
  3900                     
  3901       <summary>
  3902                      An enum  that prov ides the v arious enc ryption al gorithms s upported b y this
  3903                      library .
  3904                      
  3905       </summary>
  3906                    
  3907                     
  3908       <remarks>
  3909                     
  3910                      
  3911        <para>
  3912                         
  3913         <c>
  3914          PkzipWeak
  3915         </c>
  3916          implies t he use of  Zip 2.0 en cryption,  which is k nown to be
  3917                         weak  and subver tible.
  3918                       
  3919        </para>
  3920                     
  3921                      
  3922        <para>
  3923                         A not e on inter operabilit y: Values  of 
  3924         <c>
  3925          PkzipWeak
  3926         </c>
  3927          and 
  3928         <c>
  3929          None
  3930         </c>
  3931          are
  3932                         speci fied in 
  3933         <see 
  3934          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  3935         >
  3936          PKWARE's z ip
  3937                          speci fication
  3938         </see>
  3939         , and are  considered  to be "st andard".   Zip archiv es
  3940                         produ ced using  these opti ons will b e interope rable with  many othe r zip tool s
  3941                         and l ibraries,  including  Windows Ex plorer.
  3942                       
  3943        </para>
  3944                     
  3945                      
  3946        <para>
  3947                         Value s of 
  3948         <c>
  3949          WinZipAes1 28
  3950         </c>
  3951          and 
  3952         <c>
  3953          WinZipAes2 56
  3954         </c>
  3955          are not p art of the  Zip
  3956                         speci fication,  but rather  imply the  use of a  vendor-spe cific exte nsion from
  3957                         WinZi p. If you  want to pr oduce inte roperable  Zip archiv es, do not  use these
  3958                         value s.  For ex ample, if  you produc e a zip ar chive usin g WinZipAe s256, you
  3959                         will  be able to  open it i n Windows  Explorer o n Windows  XP and Vis ta, but yo u
  3960                         will  not be abl e to extra ct entries ; trying t his will l ead to an  "unspecifi ed
  3961                         error ". For thi s reason,  some peopl e have sai d that a z ip archive  that uses
  3962                         WinZi p's AES en cryption i s not actu ally a zip  archive a t all.  A  zip archiv e
  3963                         produ ced this w ay will be  readable  with the W inZip tool  (Version  11 and
  3964                         beyon d).
  3965                       
  3966        </para>
  3967                     
  3968                      
  3969        <para>
  3970                         There  are other  third-par ty tools a nd librari es, both c ommercial  and
  3971                         other wise, that  support W inZip's AE S encrypti on. These  will be ab le to read
  3972                         AES-e ncrypted z ip archive s produced  by DotNet Zip, and c onversely  applicatio ns
  3973                         that  use DotNet Zip to rea d zip arch ives will  be able to  read AES- encrypted
  3974                         archi ves produc ed by thos e tools or  libraries .  Consult  the docum entation f or
  3975                         those  other too ls and lib raries to  find out i f WinZip's  AES encry ption is
  3976                         suppo rted.
  3977                       
  3978        </para>
  3979                     
  3980                      
  3981        <para>
  3982                         In ca se you car e: Accordi ng to 
  3983         <see 
  3984          href="http ://www.win zip.com/ae s_info.htm "
  3985         >
  3986          the WinZip  specifica tion
  3987         </see>
  3988         , the
  3989                         actua l AES key  used is de rived from  the 
  3990         <see 
  3991          cref="P:Io nic.Zip.Zi pEntry.Pas sword"
  3992         />
  3993          via an
  3994                         algor ithm that  complies w ith 
  3995         <see 
  3996          href="http ://www.iet f.org/rfc/ rfc2898.tx t"
  3997         >
  3998          RFC 2898
  3999         </see>
  4000         , using an  iteration
  4001                         count  of 1000.   The algor ithm is so metimes re ferred to  as PBKDF2,  which sta nds
  4002                         for " Password B ased Key D erivation  Function # 2".
  4003                       
  4004        </para>
  4005                     
  4006                      
  4007        <para>
  4008                         A wor d about pa ssword str ength and  length: Th e AES encr yption tec hnology is
  4009                         very  good, but  any system  is only a s secure a s the weak est link.   If you wa nt
  4010                         to se cure your  data, be s ure to use  a passwor d that is  hard to gu ess.  To m ake
  4011                         it ha rder to gu ess (incre ase its "e ntropy"),  you should  make it l onger.  If
  4012                         you u se normal  characters  from an A SCII keybo ard, a pas sword of l ength 20 w ill
  4013                         be st rong enoug h that it  will be im possible t o guess.   For more i nformation  on
  4014                         that,  I'd encou rage you t o read 
  4015         <see 
  4016          href="http ://www.red kestrel.co .uk/Articl es/RandomP asswordStr ength.html "
  4017         >
  4018          this
  4019                          artic le.
  4020         </see>
  4021                       
  4022        </para>
  4023                     
  4024                      
  4025        <para>
  4026                         The W inZip AES  algorithms  are not s upported w ith the ve rsion of D otNetZip t hat
  4027                         runs  on the .NE T Compact  Framework.   This is  because .N ET CF lack s the
  4028                         HMACS HA1 class  that is re quired for  producing  the archi ve.
  4029                       
  4030        </para>
  4031                      
  4032       </remarks>
  4033               
  4034      </member>
  4035              
  4036      <member 
  4037       name="F:Io nic.Zip.En cryptionAl gorithm.No ne"
  4038      >
  4039                    
  4040       <summary>
  4041                     No encry ption at a ll.
  4042                     
  4043       </summary>
  4044               
  4045      </member>
  4046              
  4047      <member 
  4048       name="F:Io nic.Zip.En cryptionAl gorithm.Pk zipWeak"
  4049      >
  4050                    
  4051       <summary>
  4052                     Traditio nal or Cla ssic pkzip  encryptio n.
  4053                     
  4054       </summary>
  4055               
  4056      </member>
  4057              
  4058      <member 
  4059       name="F:Io nic.Zip.En cryptionAl gorithm.Wi nZipAes128 "
  4060      >
  4061                    
  4062       <summary>
  4063                     WinZip A ES encrypt ion (128 k ey bits).
  4064                     
  4065       </summary>
  4066               
  4067      </member>
  4068              
  4069      <member 
  4070       name="F:Io nic.Zip.En cryptionAl gorithm.Wi nZipAes256 "
  4071      >
  4072                    
  4073       <summary>
  4074                     WinZip A ES encrypt ion (256 k ey bits).
  4075                     
  4076       </summary>
  4077               
  4078      </member>
  4079              
  4080      <member 
  4081       name="F:Io nic.Zip.En cryptionAl gorithm.Un supported"
  4082      >
  4083                    
  4084       <summary>
  4085                     An encry ption algo rithm that  is not su pported by  DotNetZip .
  4086                     
  4087       </summary>
  4088               
  4089      </member>
  4090              
  4091      <member 
  4092       name="T:Io nic.Zip.Ex tractExist ingFileAct ion"
  4093      >
  4094                     
  4095       <summary>
  4096                      An enum  for the o ptions whe n extracti ng an entr y would ov erwrite an  existing  file. 
  4097                      
  4098       </summary>
  4099                     
  4100                     
  4101       <remarks>
  4102                        
  4103        <para>
  4104                           Thi s enum des cribes the  actions t hat the li brary can  take when  an
  4105                           
  4106         <c>
  4107          Extract()
  4108         </c>
  4109          or 
  4110         <c>
  4111          ExtractWit hPassword( )
  4112         </c>
  4113          method is  called to  extract a n
  4114                           ent ry to a fi lesystem,  and the ex traction w ould overw rite an ex isting fil esystem
  4115                           fil e.
  4116                         
  4117        </para>
  4118                      
  4119       </remarks>
  4120                    
  4121               
  4122      </member>
  4123              
  4124      <member 
  4125       name="F:Io nic.Zip.Ex tractExist ingFileAct ion.Throw"
  4126      >
  4127                    
  4128       <summary>
  4129                     Throw an  exception  when extr action wou ld overwri te an exis ting file.  (For
  4130                     COM clie nts, this  is a 0 (ze ro).)
  4131                     
  4132       </summary>
  4133               
  4134      </member>
  4135              
  4136      <member 
  4137       name="F:Io nic.Zip.Ex tractExist ingFileAct ion.Overwr iteSilentl y"
  4138      >
  4139                    
  4140       <summary>
  4141                     When ext raction wo uld overwr ite an exi sting file , overwrit e the file  silently.
  4142                     The over write will  happen ev en if the  target fil e is marke d as read- only.
  4143                     (For COM  clients,  this is a  1.)
  4144                     
  4145       </summary>
  4146               
  4147      </member>
  4148              
  4149      <member 
  4150       name="F:Io nic.Zip.Ex tractExist ingFileAct ion.DoNotO verwrite"
  4151      >
  4152                    
  4153       <summary>
  4154                     When ext raction wo uld overwr ite an exi sting file , don't ov erwrite th e file, si lently. 
  4155                     (For COM  clients,  this is a  2.)
  4156                     
  4157       </summary>
  4158               
  4159      </member>
  4160              
  4161      <member 
  4162       name="F:Io nic.Zip.Ex tractExist ingFileAct ion.Invoke ExtractPro gressEvent "
  4163      >
  4164                    
  4165       <summary>
  4166                     When ext raction wo uld overwr ite an exi sting file , invoke t he Extract Progress
  4167                     event, u sing an ev ent type o
  4168        <see 
  4169         cref="F:Io nic.Zip.Zi pProgressE ventType.E xtracting_ ExtractEnt ryWouldOve rwrite"
  4170        />
  4171        .  In
  4172                     this way , the appl ication ca n decide,  just-in-ti me, whethe r to overw rite the
  4173                     file. Fo r example,  a GUI app lication m ay wish to  pop up a  dialog to  allow
  4174                     the user  to choose . You may  want to ex amine the 
  4175        <see 
  4176         cref="P:Io nic.Zip.Ex tractProgr essEventAr gs.Extract Location"
  4177        />
  4178         property  before mak ing
  4179                     the deci sion. If,  after your  processin g in the E xtract pro gress even t, you
  4180                     want to  NOT extrac t the file , set 
  4181        <see 
  4182         cref="P:Io nic.Zip.Zi pEntry.Ext ractExisti ngFile"
  4183        />
  4184                     on the 
  4185        <c>
  4186         ZipProgres sEventArgs .CurrentEn try
  4187        </c>
  4188         to 
  4189        <c>
  4190         DoNotOverw rite
  4191        </c>
  4192        .
  4193                     If you d o want to  extract th e file, se
  4194        <c>
  4195         ZipEntry.E xtractExis tingFile
  4196        </c>
  4197                     to 
  4198        <c>
  4199         OverwriteS ilently
  4200        </c>
  4201        .  If you  want to ca ncel the E xtraction,  set
  4202                     
  4203        <c>
  4204         ZipProgres sEventArgs .Cancel
  4205        </c>
  4206         to true.   Cancellin g differs  from using
  4207                     DoNotOve rwrite in  that a can cel will n ot extract  any furth er entries , if
  4208                     there ar e any.  (F or COM cli ents, the  value of t his enum i s a 3.)
  4209                     
  4210       </summary>
  4211               
  4212      </member>
  4213              
  4214      <member 
  4215       name="T:Io nic.Logica lConjuncti on"
  4216      >
  4217                    
  4218       <summary>
  4219                     Enumerat es the opt ions for a  logical c onjunction . This enu m is inten ded for us e
  4220                     internal ly by the  FileSelect or class.
  4221                     
  4222       </summary>
  4223               
  4224      </member>
  4225              
  4226      <member 
  4227       name="T:Io nic.FileSe lector"
  4228      >
  4229                     
  4230       <summary>
  4231                        FileS elector en capsulates  logic tha t selects  files from  a source  - a zip fi le
  4232                        or th e filesyst em - based  on a set  of criteri a.  This c lass is us ed interna lly
  4233                        by th e DotNetZi p library,  in partic ular for t he AddSele ctedFiles( ) methods.
  4234                        This  class can  also be us ed indepen dently of  the zip ca pability i n DotNetZi p.
  4235                      
  4236       </summary>
  4237                    
  4238                     
  4239       <remarks>
  4240                     
  4241                      
  4242        <para>
  4243                         The F ileSelecto r class is  used inte rnally by  the ZipFil e class fo r selectin g
  4244                         files  for inclu sion into  the ZipFil e, when th
  4245         <see 
  4246          cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String,Sys tem.String )"
  4247         />
  4248          method, o r one of
  4249                         its o verloads,  is called.   It's als o used for  the 
  4250         <see 
  4251          cref="M:Io nic.Zip.Zi pFile.Extr actSelecte dEntries(S ystem.Stri ng)"
  4252         />
  4253          methods.   Typically , an
  4254                         appli cation tha t creates  or manipul ates Zip a rchives wi ll not dir ectly
  4255                         inter act with t he FileSel ector clas s.
  4256                       
  4257        </para>
  4258                     
  4259                      
  4260        <para>
  4261                         Some  applicatio ns may wis h to use t he FileSel ector clas s directly , to
  4262                         selec t files fr om disk vo lumes base d on a set  of criter ia, withou t creating  or
  4263                         query ing Zip ar chives.  T he file se lection cr iteria inc lude: a pa ttern to
  4264                         match  the filen ame; the l ast modifi ed, create d, or last  accessed  time of th e
  4265                         file;  the size  of the fil e; and the  attribute s of the f ile.
  4266                       
  4267        </para>
  4268                     
  4269                      
  4270        <para>
  4271                         Consu lt the doc umentation  for 
  4272         <see 
  4273          cref="P:Io nic.FileSe lector.Sel ectionCrit eria"
  4274         />
  4275                         for m ore inform ation on s pecifying  the select ion criter ia.
  4276                       
  4277        </para>
  4278                     
  4279                      
  4280       </remarks>
  4281               
  4282      </member>
  4283              
  4284      <member 
  4285       name="M:Io nic.FileSe lector.#ct or(System. String)"
  4286      >
  4287                     
  4288       <summary>
  4289                        Const ructor tha t allows t he caller  to specify  file sele ction crit eria.
  4290                      
  4291       </summary>
  4292                    
  4293                     
  4294       <remarks>
  4295                      
  4296        <para>
  4297                         This  constructo r allows t he caller  to specify  a set of  criteria f or
  4298                         selec tion of fi les.
  4299                       
  4300        </para>
  4301                     
  4302                      
  4303        <para>
  4304                         See 
  4305         <see 
  4306          cref="P:Io nic.FileSe lector.Sel ectionCrit eria"
  4307         />
  4308          for a des cription o f
  4309                         the s yntax of t he selecti onCriteria  string.
  4310                       
  4311        </para>
  4312                     
  4313                      
  4314        <para>
  4315                         By de fault the  FileSelect or will tr averse NTF S Reparse  Points.  T o
  4316                         chang e this, us
  4317         <see 
  4318          cref="M:Io nic.FileSe lector.#ct or(System. String,Sys tem.Boolea n)"
  4319         >
  4320          FileSelect or(String,  bool)
  4321         </see>
  4322         .
  4323                       
  4324        </para>
  4325                      
  4326       </remarks>
  4327                    
  4328                     
  4329       <param 
  4330        name="sele ctionCrite ria"
  4331       >
  4332        The criter ia for fil e selectio n.
  4333       </param>
  4334               
  4335      </member>
  4336              
  4337      <member 
  4338       name="M:Io nic.FileSe lector.#ct or(System. String,Sys tem.Boolea n)"
  4339      >
  4340                     
  4341       <summary>
  4342                        Const ructor tha t allows t he caller  to specify  file sele ction crit eria.
  4343                      
  4344       </summary>
  4345                    
  4346                     
  4347       <remarks>
  4348                      
  4349        <para>
  4350                         This  constructo r allows t he caller  to specify  a set of  criteria f or
  4351                         selec tion of fi les.
  4352                       
  4353        </para>
  4354                     
  4355                      
  4356        <para>
  4357                         See 
  4358         <see 
  4359          cref="P:Io nic.FileSe lector.Sel ectionCrit eria"
  4360         />
  4361          for a des cription o f
  4362                         the s yntax of t he selecti onCriteria  string.
  4363                       
  4364        </para>
  4365                      
  4366       </remarks>
  4367                    
  4368                     
  4369       <param 
  4370        name="sele ctionCrite ria"
  4371       >
  4372        The criter ia for fil e selectio n.
  4373       </param>
  4374                     
  4375       <param 
  4376        name="trav erseDirect oryReparse Points"
  4377       >
  4378                      whether  to traver se NTFS re parse poin ts (juncti ons).
  4379                      
  4380       </param>
  4381               
  4382      </member>
  4383              
  4384      <member 
  4385       name="M:Io nic.FileSe lector.ToS tring"
  4386      >
  4387                    
  4388       <summary>
  4389                     Returns  a string r epresentat ion of the  FileSelec tor object .
  4390                     
  4391       </summary>
  4392                    
  4393       <returns>
  4394        The string  represent ation of t he boolean  logic sta tement of  the file
  4395                     selectio n criteria  for this  instance. 
  4396       </returns>
  4397               
  4398      </member>
  4399              
  4400      <member 
  4401       name="M:Io nic.FileSe lector.Sel ectFiles(S ystem.Stri ng)"
  4402      >
  4403                     
  4404       <summary>
  4405                        Retur ns the nam es of the  files in t he specifi ed directo ry
  4406                        that  fit the se lection cr iteria spe cified in  the FileSe lector.
  4407                      
  4408       </summary>
  4409                    
  4410                     
  4411       <remarks>
  4412                        This  is equival ent to cal ling 
  4413        <see 
  4414         cref="M:Io nic.FileSe lector.Sel ectFiles(S ystem.Stri ng,System. Boolean)"
  4415        />
  4416                        with  recurseDir ectories =  false.
  4417                      
  4418       </remarks>
  4419                    
  4420                     
  4421       <param 
  4422        name="dire ctory"
  4423       >
  4424                        The n ame of the  directory  over whic h to apply  the FileS elector
  4425                        crite ria.
  4426                      
  4427       </param>
  4428                    
  4429                     
  4430       <returns>
  4431                        A col lection of  strings c ontaining  fully-qual ified path names of f iles
  4432                        that  match the  criteria s pecified i n the File Selector i nstance.
  4433                      
  4434       </returns>
  4435               
  4436      </member>
  4437              
  4438      <member 
  4439       name="M:Io nic.FileSe lector.Sel ectFiles(S ystem.Stri ng,System. Boolean)"
  4440      >
  4441                     
  4442       <summary>
  4443                        Retur ns the nam es of the  files in t he specifi ed directo ry that fi t the
  4444                        selec tion crite ria specif ied in the  FileSelec tor, optio nally recu rsing
  4445                        throu gh subdire ctories.
  4446                      
  4447       </summary>
  4448                    
  4449                     
  4450       <remarks>
  4451                        This  method app lies the f ile select ion criter ia contain ed in the
  4452                        FileS elector to  the files  contained  in the gi ven direct ory, and
  4453                        retur ns the nam es of file s that con form to th e criteria .
  4454                      
  4455       </remarks>
  4456                    
  4457                     
  4458       <param 
  4459        name="dire ctory"
  4460       >
  4461                        The n ame of the  directory  over whic h to apply  the FileS elector
  4462                        crite ria.
  4463                      
  4464       </param>
  4465                    
  4466                     
  4467       <param 
  4468        name="recu rseDirecto ries"
  4469       >
  4470                        Wheth er to recu rse throug h subdirec tories whe n applying  the file
  4471                        selec tion crite ria.
  4472                      
  4473       </param>
  4474                    
  4475                     
  4476       <returns>
  4477                        A col lection of  strings c ontaining  fully-qual ified path names of f iles
  4478                        that  match the  criteria s pecified i n the File Selector i nstance.
  4479                      
  4480       </returns>
  4481               
  4482      </member>
  4483              
  4484      <member 
  4485       name="M:Io nic.FileSe lector.Sel ectEntries (Ionic.Zip .ZipFile)"
  4486      >
  4487                     
  4488       <summary>
  4489                      Retriev e the ZipE ntry items  in the Zi pFile that  conform t o the spec ified crit eria.
  4490                      
  4491       </summary>
  4492                     
  4493       <remarks>
  4494                     
  4495                      
  4496        <para>
  4497                       This me thod appli es the cri teria set  in the Fil eSelector  instance ( as describ ed in
  4498                       the 
  4499         <see 
  4500          cref="P:Io nic.FileSe lector.Sel ectionCrit eria"
  4501         />
  4502         ) to the s pecified Z ipFile.  U sing this
  4503                       method,  for examp le, you ca n retrieve  all entri es from th e given Zi pFile that
  4504                       have fi lenames en ding in .t xt.
  4505                       
  4506        </para>
  4507                     
  4508                      
  4509        <para>
  4510                       Normall y, applica tions woul d not call  this meth od directl y.  This m ethod is u sed
  4511                       by the  ZipFile cl ass.
  4512                       
  4513        </para>
  4514                     
  4515                      
  4516        <para>
  4517                       Using t he appropr iate Selec tionCriter ia, you ca n retrieve  entries b ased on si ze,
  4518                       time, a nd attribu tes. See 
  4519         <see 
  4520          cref="P:Io nic.FileSe lector.Sel ectionCrit eria"
  4521         />
  4522          for a
  4523                       descrip tion of th e syntax o f the Sele ctionCrite ria string .
  4524                       
  4525        </para>
  4526                     
  4527                      
  4528       </remarks>
  4529                    
  4530                     
  4531       <param 
  4532        name="zip"
  4533       >
  4534        The ZipFil e from whi ch to retr ieve entri es.
  4535       </param>
  4536                    
  4537                     
  4538       <returns>
  4539        a collecti on of ZipE ntry objec ts that co nform to t he criteri a.
  4540       </returns>
  4541               
  4542      </member>
  4543              
  4544      <member 
  4545       name="M:Io nic.FileSe lector.Sel ectEntries (Ionic.Zip .ZipFile,S ystem.Stri ng)"
  4546      >
  4547                     
  4548       <summary>
  4549                      Retriev e the ZipE ntry items  in the Zi pFile that  conform t o the spec ified crit eria.
  4550                      
  4551       </summary>
  4552                     
  4553       <remarks>
  4554                     
  4555                      
  4556        <para>
  4557                       This me thod appli es the cri teria set  in the Fil eSelector  instance ( as describ ed in
  4558                       the 
  4559         <see 
  4560          cref="P:Io nic.FileSe lector.Sel ectionCrit eria"
  4561         />
  4562         ) to the s pecified Z ipFile.  U sing this
  4563                       method,  for examp le, you ca n retrieve  all entri es from th e given Zi pFile that
  4564                       have fi lenames en ding in .t xt.
  4565                       
  4566        </para>
  4567                     
  4568                      
  4569        <para>
  4570                       Normall y, applica tions woul d not call  this meth od directl y.  This m ethod is u sed
  4571                       by the  ZipFile cl ass.
  4572                       
  4573        </para>
  4574                     
  4575                      
  4576        <para>
  4577                       This ov erload all ows the se lection of  ZipEntry  instances  from the Z ipFile to  be restric ted
  4578                       to entr ies contai ned within  a particu lar direct ory in the  ZipFile.
  4579                       
  4580        </para>
  4581                     
  4582                      
  4583        <para>
  4584                       Using t he appropr iate Selec tionCriter ia, you ca n retrieve  entries b ased on si ze,
  4585                       time, a nd attribu tes. See 
  4586         <see 
  4587          cref="P:Io nic.FileSe lector.Sel ectionCrit eria"
  4588         />
  4589          for a
  4590                       descrip tion of th e syntax o f the Sele ctionCrite ria string .
  4591                       
  4592        </para>
  4593                     
  4594                      
  4595       </remarks>
  4596                    
  4597                     
  4598       <param 
  4599        name="zip"
  4600       >
  4601        The ZipFil e from whi ch to retr ieve entri es.
  4602       </param>
  4603                    
  4604                     
  4605       <param 
  4606        name="dire ctoryPathI nArchive"
  4607       >
  4608                      the dir ectory in  the archiv e from whi ch to sele ct entries . If null,  then
  4609                      all dir ectories i n the arch ive are us ed.
  4610                      
  4611       </param>
  4612                    
  4613                     
  4614       <returns>
  4615        a collecti on of ZipE ntry objec ts that co nform to t he criteri a.
  4616       </returns>
  4617               
  4618      </member>
  4619              
  4620      <member 
  4621       name="P:Io nic.FileSe lector.Sel ectionCrit eria"
  4622      >
  4623                     
  4624       <summary>
  4625                        The s tring spec ifying whi ch files t o include  when retri eving.
  4626                      
  4627       </summary>
  4628                     
  4629       <remarks>
  4630                     
  4631                      
  4632        <para>
  4633                         Speci fy the cri teria in s tatements  of 3 eleme nts: a nou n, an oper ator,
  4634                         and a  value.  C onsider th e string " name != *. doc" .  Th e noun is
  4635                         "name ".  The op erator is  "!=", impl ying "Not  Equal".  T he value i s
  4636                         "*.do c".  That  criterion,  in Englis h, says "a ll files w ith a name  that
  4637                         does  not end in  the .doc  extension. "
  4638                       
  4639        </para>
  4640                     
  4641                      
  4642        <para>
  4643                         Suppo rted nouns  include " name" (or  "filename" ) for the  filename;
  4644                         "atim e", "mtime ", and "ct ime" for l ast access  time, las t modfied  time,
  4645                         and c reated tim e of the f ile, respe ctively; " attributes " (or "att rs")
  4646                         for t he file at tributes;  "size" (or  "length")  for the f ile length
  4647                         (unco mpressed);  and "type " for the  type of ob ject, eith er a file  or a
  4648                         direc tory.  The  "attribut es", "type ", and "na me" nouns  all suppor t =
  4649                         and ! = as opera tors.  The  "size", " atime", "m time", and  "ctime" n ouns
  4650                         suppo rt = and ! =, and &gt ;, &gt;=,  &lt;, &lt; = as well.   The time s are
  4651                         taken  to be exp ressed in  local time .
  4652                       
  4653        </para>
  4654                     
  4655                      
  4656        <para>
  4657                         Speci fy values  for the fi le attribu tes as a s tring with  one or mo re of
  4658                         the c haracters  H,R,S,A,I, L in any o rder, impl ying file  attributes  of
  4659                         Hidde n, ReadOnl y, System,  Archive,  NotContext Indexed, a nd Reparse Point
  4660                         (symb olic link)  respectiv ely.
  4661                       
  4662        </para>
  4663                     
  4664                      
  4665        <para>
  4666                         To sp ecify a ti me, use YY YY-MM-DD-H H:mm:ss or  YYYY/MM/D D-HH:mm:ss  as
  4667                         the f ormat.  If  you omit  the HH:mm: ss portion , it is as sumed to b e
  4668                         00:00 :00 (midni ght).
  4669                       
  4670        </para>
  4671                     
  4672                      
  4673        <para>
  4674                         The v alue for a  size crit erion is e xpressed i n integer  quantities  of
  4675                         bytes , kilobyte s (use k o r kb after  the numbe r), megaby tes (m or  mb),
  4676                         or gi gabytes (g  or gb).
  4677                       
  4678        </para>
  4679                     
  4680                      
  4681        <para>
  4682                         The v alue for a  name is a  pattern t o match ag ainst the  filename,
  4683                         poten tially inc luding wil dcards.  T he pattern  follows C MD.exe glo b
  4684                         rules : * implie s one or m ore of any  character , while ?   implies o ne
  4685                         chara cter.  If  the name p attern con tains any  slashes, i t is match ed to
  4686                         the e ntire file name, incl uding the  path; othe rwise, it  is matched
  4687                         again st only th e filename  without t he path.   This means  a pattern  of
  4688                         "*\*. *" matches  all files  one direc tory level  deep, whi le a patte rn of
  4689                         "*.*"  matches a ll files i n all dire ctories.
  4690                       
  4691        </para>
  4692                     
  4693                      
  4694        <para>
  4695                         To sp ecify a na me pattern  that incl udes space s, use sin gle quotes
  4696                         aroun d the patt ern.  A pa ttern of " '* *.*'" w ill match  all files  that
  4697                         have  spaces in  the filena me.  The f ull criter ia string  for that w ould
  4698                         be "n ame = '* * .*'" .
  4699                       
  4700        </para>
  4701                     
  4702                      
  4703        <para>
  4704                         The v alue for a  type crit erion is e ither F (i mplying a  file) or D
  4705                         (impl ying a dir ectory).
  4706                       
  4707        </para>
  4708                     
  4709                      
  4710        <para>
  4711                         Some  examples:
  4712                       
  4713        </para>
  4714                     
  4715                      
  4716        <list 
  4717         type="tabl e"
  4718        >
  4719                         
  4720         <listheade r>
  4721                            
  4722          <term>
  4723           criteria
  4724          </term>
  4725                            
  4726          <descripti on>
  4727           Files retr ieved
  4728          </descript ion>
  4729                          
  4730         </listhead er>
  4731                      
  4732                         
  4733         <item>
  4734                            
  4735          <term>
  4736           name != *. xls 
  4737          </term>
  4738                            
  4739          <descripti on>
  4740           any file w ith an ext ension tha t is not . xls
  4741                             
  4742          </descript ion>
  4743                          
  4744         </item>
  4745                      
  4746                         
  4747         <item>
  4748                            
  4749          <term>
  4750           name = *.m p3 
  4751          </term>
  4752                            
  4753          <descripti on>
  4754           any file w ith a .mp3  extension .
  4755                             
  4756          </descript ion>
  4757                          
  4758         </item>
  4759                      
  4760                         
  4761         <item>
  4762                            
  4763          <term>
  4764           *.mp3
  4765          </term>
  4766                            
  4767          <descripti on>
  4768           (same as a bove) any  file with  a .mp3 ext ension.
  4769                             
  4770          </descript ion>
  4771                          
  4772         </item>
  4773                      
  4774                         
  4775         <item>
  4776                            
  4777          <term>
  4778           attributes  = A 
  4779          </term>
  4780                            
  4781          <descripti on>
  4782           all files  whose attr ibutes inc lude the A rchive bit .
  4783                             
  4784          </descript ion>
  4785                          
  4786         </item>
  4787                      
  4788                         
  4789         <item>
  4790                            
  4791          <term>
  4792           attributes  != H 
  4793          </term>
  4794                            
  4795          <descripti on>
  4796           all files  whose attr ibutes do  not includ e the Hidd en bit.
  4797                             
  4798          </descript ion>
  4799                          
  4800         </item>
  4801                      
  4802                         
  4803         <item>
  4804                            
  4805          <term>
  4806           mtime &gt;  2009-01-0 1
  4807          </term>
  4808                            
  4809          <descripti on>
  4810           all files  with a las t modified  time afte r January  1st, 2009.
  4811                             
  4812          </descript ion>
  4813                          
  4814         </item>
  4815                      
  4816                         
  4817         <item>
  4818                            
  4819          <term>
  4820           ctime &gt;  2009/01/0 1-03:00:00
  4821          </term>
  4822                            
  4823          <descripti on>
  4824           all files  with a cre ated time  after 3am  (local tim e),
  4825                             on  January 1s t, 2009.
  4826                             
  4827          </descript ion>
  4828                          
  4829         </item>
  4830                      
  4831                         
  4832         <item>
  4833                            
  4834          <term>
  4835           size &gt;  2gb
  4836          </term>
  4837                            
  4838          <descripti on>
  4839           all files  whose unco mpressed s ize is gre ater than  2gb.
  4840                             
  4841          </descript ion>
  4842                          
  4843         </item>
  4844                      
  4845                         
  4846         <item>
  4847                            
  4848          <term>
  4849           type = D
  4850          </term>
  4851                            
  4852          <descripti on>
  4853           all direct ories in t he filesys tem. 
  4854          </descript ion>
  4855                          
  4856         </item>
  4857                      
  4858                       
  4859        </list>
  4860                     
  4861                      
  4862        <para>
  4863                         You c an combine  criteria  with the c onjunction s AND, OR,  and XOR.  Using
  4864                         a str ing like " name = *.t xt AND siz e &gt;= 10 0k" for th e
  4865                         selec tionCriter ia retriev es entries  whose nam es end in  .txt, and  whose
  4866                         uncom pressed si ze is grea ter than o r equal to  100 kilob ytes.
  4867                       
  4868        </para>
  4869                     
  4870                      
  4871        <para>
  4872                         For m ore comple x combinat ions of cr iteria, yo u can use  parenthesi s to
  4873                         group  clauses i n the bool ean logic.   Absent p arenthesis , the
  4874                         prece dence of t he criteri on atoms i s determin ed by orde r of
  4875                         appea rance.  Un like the C # language , the AND  conjunctio n does not  take
  4876                         prece ndence ove r the logi cal OR.  T his is imp ortant onl y in strin gs
  4877                         that  contain 3  or more cr iterion at oms.  In o ther words , "name =  *.txt
  4878                         and s ize &gt; 1 000 or att ributes =  H" implies  "((name =  *.txt AND  size
  4879                         &gt;  1000) OR a ttributes  = H)" whil e "attribu tes = H OR  name = *. txt
  4880                         and s ize &gt; 1 000" evalu ates to "( (attribute s = H OR n ame = *.tx t)
  4881                         AND s ize &gt; 1 000)".  Wh en in doub t, use par enthesis.
  4882                       
  4883        </para>
  4884                     
  4885                      
  4886        <para>
  4887                         Using  time prop erties req uires some  extra car e. If you  want to
  4888                         retri eve all en tries that  were last  updated o n 2009 Feb ruary 14,
  4889                         speci fy "mtime  &gt;= 2009 -02-14 AND  mtime &lt ; 2009-02- 15".  Read  this
  4890                         to sa y: all fil es updated  after 12: 00am on Fe bruary 14t h, until
  4891                         12:00 am on Febr uary 15th.   You can  use the sa me bracket ing approa ch to
  4892                         speci fy any tim e period -  a year, a  month, a  week, and  so on.
  4893                       
  4894        </para>
  4895                     
  4896                      
  4897        <para>
  4898                         The s yntax allo ws one spe cial case:  if you pr ovide a st ring with  no
  4899                         space s, it is t reated as  a pattern  to match f or the fil ename.
  4900                         There fore a str ing like " *.xls" wil l be equiv alent to s pecifying  "name
  4901                         = *.x ls".  This  "shorthan d" notatio n does not  work with  compound
  4902                         crite ria.
  4903                       
  4904        </para>
  4905                     
  4906                      
  4907        <para>
  4908                         There  is no log ic in this  class tha t insures  that the i nclusion
  4909                         crite ria are in ternally c onsistent.   For exam ple, it's  possible t o
  4910                         speci fy criteri a that say s the file  must have  a size of  less than  100
  4911                         bytes , as well  as a size  that is gr eater than  1000 byte s.  Obviou sly
  4912                         no fi le will ev er satisfy  such crit eria, but  this class  does not  check
  4913                         for o r detect s uch incons istencies.
  4914                       
  4915        </para>
  4916                     
  4917                      
  4918       </remarks>
  4919                    
  4920                     
  4921       <exception  
  4922        cref="T:Sy stem.Excep tion"
  4923       >
  4924                        Throw n in the s etter if t he value h as an inva lid syntax .
  4925                      
  4926       </exceptio n>
  4927               
  4928      </member>
  4929              
  4930      <member 
  4931       name="P:Io nic.FileSe lector.Tra verseRepar sePoints"
  4932      >
  4933                    
  4934       <summary>
  4935                      Indicat es whether  searches  will trave rse NTFS r eparse poi nts, like  Junctions.
  4936                     
  4937       </summary>
  4938               
  4939      </member>
  4940              
  4941      <member 
  4942       name="T:Io nic.EnumUt il"
  4943      >
  4944                    
  4945       <summary>
  4946                     Summary  descriptio n for Enum Util.
  4947                     
  4948       </summary>
  4949               
  4950      </member>
  4951              
  4952      <member 
  4953       name="M:Io nic.EnumUt il.GetDesc ription(Sy stem.Enum) "
  4954      >
  4955                    
  4956       <summary>
  4957                       Return s the valu e of the D escription Attribute  if the spe cified Enu m
  4958                       value  has one.   If not, re turns the  ToString()  represent ation of t he
  4959                       Enum v alue.
  4960                     
  4961       </summary>
  4962                    
  4963       <param 
  4964        name="valu e"
  4965       >
  4966        The Enum t o get the  descriptio n for
  4967       </param>
  4968                    
  4969       <returns>
  4970       </returns>
  4971               
  4972      </member>
  4973              
  4974      <member 
  4975       name="M:Io nic.EnumUt il.Parse(S ystem.Type ,System.St ring)"
  4976      >
  4977                    
  4978       <summary>
  4979                       Conver ts the str ing repres entation o f the name  or numeri c value of  one
  4980                       or mor e enumerat ed constan ts to an e quivalent  enumerated  object.
  4981                       Note:  use the De scriptionA ttribute o n enum val ues to ena ble this.
  4982                     
  4983       </summary>
  4984                    
  4985       <param 
  4986        name="enum Type"
  4987       >
  4988        The System .Type of t he enumera tion.
  4989       </param>
  4990                    
  4991       <param 
  4992        name="stri ngRepresen tation"
  4993       >
  4994                       A stri ng contain ing the na me or valu e to conve rt.
  4995                     
  4996       </param>
  4997                    
  4998       <returns>
  4999       </returns>
  5000               
  5001      </member>
  5002              
  5003      <member 
  5004       name="M:Io nic.EnumUt il.Parse(S ystem.Type ,System.St ring,Syste m.Boolean) "
  5005      >
  5006                    
  5007       <summary>
  5008                       Conver ts the str ing repres entation o f the name  or numeri c value of  one
  5009                       or mor e enumerat ed constan ts to an e quivalent  enumerated  object.   A
  5010                       parame ter specif ied whethe r the oper ation is c ase-sensit ive.  Note :
  5011                       use th e Descript ionAttribu te on enum  values to  enable th is.
  5012                     
  5013       </summary>
  5014                    
  5015       <param 
  5016        name="enum Type"
  5017       >
  5018        The System .Type of t he enumera tion.
  5019       </param>
  5020                    
  5021       <param 
  5022        name="stri ngRepresen tation"
  5023       >
  5024                       A stri ng contain ing the na me or valu e to conve rt.
  5025                     
  5026       </param>
  5027                    
  5028       <param 
  5029        name="igno reCase"
  5030       >
  5031                       Whethe r the oper ation is c ase-sensit ive or not .
  5032       </param>
  5033                    
  5034       <returns>
  5035       </returns>
  5036               
  5037      </member>
  5038              
  5039      <member 
  5040       name="T:Io nic.Zip.Wi nZipAesCry pto"
  5041      >
  5042                     
  5043       <summary>
  5044                        This  is a helpe r class su pporting W inZip AES  encryption .
  5045                        This  class is i ntended fo r use only  by the Do tNetZip li brary.
  5046                      
  5047       </summary>
  5048                    
  5049                     
  5050       <remarks>
  5051                        Most  uses of th e DotNetZi p library  will not i nvolve dir ect calls  into
  5052                        the W inZipAesCr ypto class .  Instead , the WinZ ipAesCrypt o class is
  5053                        insta ntiated an d used by  the ZipEnt ry() class  when WinZ ip AES
  5054                        encry ption or d ecryption  on an entr y is emplo yed.
  5055                      
  5056       </remarks>
  5057               
  5058      </member>
  5059              
  5060      <member 
  5061       name="T:Io nic.Zip.Wi nZipAesCip herStream"
  5062      >
  5063                     
  5064       <summary>
  5065                        A str eam that e ncrypts as  it writes , or decry pts as it  reads.  Th e
  5066                        Crypt o is AES i n CTR (cou nter) mode , which is  compatibl e with the  AES
  5067                        encry ption empl oyed by Wi nZip 12.0.
  5068                      
  5069       </summary>
  5070                     
  5071       <remarks>
  5072                        
  5073        <para>
  5074                           The  AES/CTR e ncryption  protocol u sed by Win Zip works  like this:
  5075                      
  5076                             -  start wit h a counte r, initial ized to ze ro.
  5077                      
  5078                             -  to encryp t, take th e data by  16-byte bl ocks. For  each block :
  5079                                - apply t he transfo rm to the  counter
  5080                                - increem ent the co unter
  5081                                - XOR the  result of  the trans form with  the plaint ext to
  5082                                  get the  ciphertex t.
  5083                                - compute  the mac o n the encr ypted byte s
  5084                             -  when fini shed with  all blocks , store th e computed  MAC.
  5085                      
  5086                             -  to decryp t, take th e data by  16-byte bl ocks. For  each block :
  5087                                - compute  the mac o n the encr ypted byte s,
  5088                                - apply t he transfo rm to the  counter
  5089                                - increem ent the co unter
  5090                                - XOR the  result of  the trans form with  the cipher text to
  5091                                  get the  plaintext .
  5092                             -  when fini shed with  all blocks , compare  the comput ed MAC aga inst
  5093                                the store d MAC
  5094                      
  5095                         
  5096        </para>
  5097                      
  5098       </remarks>
  5099               
  5100      </member>
  5101              
  5102      <member 
  5103       name="M:Io nic.Zip.Wi nZipAesCip herStream. #ctor(Syst em.IO.Stre am,Ionic.Z ip.WinZipA esCrypto,S ystem.Int6 4,Ionic.Zi p.CryptoMo de)"
  5104      >
  5105                    
  5106       <summary>
  5107                     The cons tructor.
  5108                     
  5109       </summary>
  5110                    
  5111       <param 
  5112        name="s"
  5113       >
  5114        The underl ying strea m
  5115       </param>
  5116                    
  5117       <param 
  5118        name="mode "
  5119       >
  5120        To either  encrypt or  decrypt.
  5121       </param>
  5122                    
  5123       <param 
  5124        name="cryp toParams"
  5125       >
  5126        The pre-in itialized  WinZipAesC rypto obje ct.
  5127       </param>
  5128                    
  5129       <param 
  5130        name="leng th"
  5131       >
  5132        The maximu m number o f bytes to  read from  the strea m.
  5133       </param>
  5134               
  5135      </member>
  5136              
  5137      <member 
  5138       name="M:Io nic.Zip.Wi nZipAesCip herStream. Close"
  5139      >
  5140                    
  5141       <summary>
  5142                       Close  the stream .
  5143                     
  5144       </summary>
  5145               
  5146      </member>
  5147              
  5148      <member 
  5149       name="M:Io nic.Zip.Wi nZipAesCip herStream. Flush"
  5150      >
  5151                    
  5152       <summary>
  5153                     Flush th e content  in the str eam.
  5154                     
  5155       </summary>
  5156               
  5157      </member>
  5158              
  5159      <member 
  5160       name="M:Io nic.Zip.Wi nZipAesCip herStream. Seek(Syste m.Int64,Sy stem.IO.Se ekOrigin)"
  5161      >
  5162                    
  5163       <summary>
  5164                     This met hod throws  a NotImpl ementedExc eption.
  5165                     
  5166       </summary>
  5167               
  5168      </member>
  5169              
  5170      <member 
  5171       name="M:Io nic.Zip.Wi nZipAesCip herStream. SetLength( System.Int 64)"
  5172      >
  5173                    
  5174       <summary>
  5175                     This met hod throws  a NotImpl ementedExc eption.
  5176                     
  5177       </summary>
  5178               
  5179      </member>
  5180              
  5181      <member 
  5182       name="P:Io nic.Zip.Wi nZipAesCip herStream. FinalAuthe ntication"
  5183      >
  5184                    
  5185       <summary>
  5186                     Returns  the final  HMAC-SHA1- 80 for the  data that  was encry pted.
  5187                     
  5188       </summary>
  5189               
  5190      </member>
  5191              
  5192      <member 
  5193       name="P:Io nic.Zip.Wi nZipAesCip herStream. CanRead"
  5194      >
  5195                    
  5196       <summary>
  5197                     Returns  true if th e stream c an be read .
  5198                     
  5199       </summary>
  5200               
  5201      </member>
  5202              
  5203      <member 
  5204       name="P:Io nic.Zip.Wi nZipAesCip herStream. CanSeek"
  5205      >
  5206                    
  5207       <summary>
  5208                     Always r eturns fal se.
  5209                     
  5210       </summary>
  5211               
  5212      </member>
  5213              
  5214      <member 
  5215       name="P:Io nic.Zip.Wi nZipAesCip herStream. CanWrite"
  5216      >
  5217                    
  5218       <summary>
  5219                     Returns  true if th e CryptoMo de is Encr ypt.
  5220                     
  5221       </summary>
  5222               
  5223      </member>
  5224              
  5225      <member 
  5226       name="P:Io nic.Zip.Wi nZipAesCip herStream. Length"
  5227      >
  5228                    
  5229       <summary>
  5230                     Getting  this prope rty throws  a NotImpl ementedExc eption.
  5231                     
  5232       </summary>
  5233               
  5234      </member>
  5235              
  5236      <member 
  5237       name="P:Io nic.Zip.Wi nZipAesCip herStream. Position"
  5238      >
  5239                    
  5240       <summary>
  5241                     Getting  or Setting  this prop erty throw s a NotImp lementedEx ception.
  5242                     
  5243       </summary>
  5244               
  5245      </member>
  5246              
  5247      <member 
  5248       name="T:Io nic.Zip.Ba dPasswordE xception"
  5249      >
  5250                    
  5251       <summary>
  5252                     Issued w hen an 
  5253        <c>
  5254         ZipEntry.E xtractWith Password()
  5255        </c>
  5256         method is  invoked
  5257                     with an  incorrect  password.
  5258                     
  5259       </summary>
  5260               
  5261      </member>
  5262              
  5263      <member 
  5264       name="T:Io nic.Zip.Zi pException "
  5265      >
  5266                    
  5267       <summary>
  5268                     Base cla ss for all  exception s defined  by and thr ow by the  Zip librar y.
  5269                     
  5270       </summary>
  5271               
  5272      </member>
  5273              
  5274      <member 
  5275       name="M:Io nic.Zip.Zi pException .#ctor"
  5276      >
  5277                    
  5278       <summary>
  5279                     Default  ctor.
  5280                     
  5281       </summary>
  5282               
  5283      </member>
  5284              
  5285      <member 
  5286       name="M:Io nic.Zip.Zi pException .#ctor(Sys tem.String )"
  5287      >
  5288                    
  5289       <summary>
  5290                     Come on,  you know  how except ions work.  Why are y ou looking  at this d ocumentati on?
  5291                     
  5292       </summary>
  5293                    
  5294       <param 
  5295        name="mess age"
  5296       >
  5297        The messag e in the e xception.
  5298       </param>
  5299               
  5300      </member>
  5301              
  5302      <member 
  5303       name="M:Io nic.Zip.Zi pException .#ctor(Sys tem.String ,System.Ex ception)"
  5304      >
  5305                    
  5306       <summary>
  5307                     Come on,  you know  how except ions work.  Why are y ou looking  at this d ocumentati on?
  5308                     
  5309       </summary>
  5310                    
  5311       <param 
  5312        name="mess age"
  5313       >
  5314        The messag e in the e xception.
  5315       </param>
  5316                    
  5317       <param 
  5318        name="inne rException "
  5319       >
  5320        The innerE xception f or this ex ception.
  5321       </param>
  5322               
  5323      </member>
  5324              
  5325      <member 
  5326       name="M:Io nic.Zip.Zi pException .#ctor(Sys tem.Runtim e.Serializ ation.Seri alizationI nfo,System .Runtime.S erializati on.Streami ngContext) "
  5327      >
  5328                    
  5329       <summary>
  5330                     Come on,  you know  how except ions work.  Why are y ou looking  at this d ocumentati on?
  5331                     
  5332       </summary>
  5333                    
  5334       <param 
  5335        name="info "
  5336       >
  5337        The serial ization in fo for the  exception .
  5338       </param>
  5339                    
  5340       <param 
  5341        name="cont ext"
  5342       >
  5343        The stream ing contex t from whi ch to dese rialize.
  5344       </param>
  5345               
  5346      </member>
  5347              
  5348      <member 
  5349       name="M:Io nic.Zip.Ba dPasswordE xception.# ctor"
  5350      >
  5351                    
  5352       <summary>
  5353                     Default  ctor.
  5354                     
  5355       </summary>
  5356               
  5357      </member>
  5358              
  5359      <member 
  5360       name="M:Io nic.Zip.Ba dPasswordE xception.# ctor(Syste m.String)"
  5361      >
  5362                    
  5363       <summary>
  5364                     Come on,  you know  how except ions work.  Why are y ou looking  at this d ocumentati on?
  5365                     
  5366       </summary>
  5367                    
  5368       <param 
  5369        name="mess age"
  5370       >
  5371        The messag e in the e xception.
  5372       </param>
  5373               
  5374      </member>
  5375              
  5376      <member 
  5377       name="M:Io nic.Zip.Ba dPasswordE xception.# ctor(Syste m.String,S ystem.Exce ption)"
  5378      >
  5379                    
  5380       <summary>
  5381                     Come on,  you know  how except ions work.  Why are y ou looking  at this d ocumentati on?
  5382                     
  5383       </summary>
  5384                    
  5385       <param 
  5386        name="mess age"
  5387       >
  5388        The messag e in the e xception.
  5389       </param>
  5390                    
  5391       <param 
  5392        name="inne rException "
  5393       >
  5394        The innerE xception f or this ex ception.
  5395       </param>
  5396               
  5397      </member>
  5398              
  5399      <member 
  5400       name="M:Io nic.Zip.Ba dPasswordE xception.# ctor(Syste m.Runtime. Serializat ion.Serial izationInf o,System.R untime.Ser ialization .Streaming Context)"
  5401      >
  5402                    
  5403       <summary>
  5404                     Come on,  you know  how except ions work.  Why are y ou looking  at this d ocumentati on?
  5405                     
  5406       </summary>
  5407                    
  5408       <param 
  5409        name="info "
  5410       >
  5411        The serial ization in fo for the  exception .
  5412       </param>
  5413                    
  5414       <param 
  5415        name="cont ext"
  5416       >
  5417        The stream ing contex t from whi ch to dese rialize.
  5418       </param>
  5419               
  5420      </member>
  5421              
  5422      <member 
  5423       name="T:Io nic.Zip.Ba dReadExcep tion"
  5424      >
  5425                    
  5426       <summary>
  5427                     Indicate s that a r ead was at tempted on  a stream,  and bad o r incomple te data wa s
  5428                     received .
  5429                     
  5430       </summary>
  5431               
  5432      </member>
  5433              
  5434      <member 
  5435       name="M:Io nic.Zip.Ba dReadExcep tion.#ctor "
  5436      >
  5437                    
  5438       <summary>
  5439                     Default  ctor.
  5440                     
  5441       </summary>
  5442               
  5443      </member>
  5444              
  5445      <member 
  5446       name="M:Io nic.Zip.Ba dReadExcep tion.#ctor (System.St ring)"
  5447      >
  5448                    
  5449       <summary>
  5450                     Come on,  you know  how except ions work.  Why are y ou looking  at this d ocumentati on?
  5451                     
  5452       </summary>
  5453                    
  5454       <param 
  5455        name="mess age"
  5456       >
  5457        The messag e in the e xception.
  5458       </param>
  5459               
  5460      </member>
  5461              
  5462      <member 
  5463       name="M:Io nic.Zip.Ba dReadExcep tion.#ctor (System.St ring,Syste m.Exceptio n)"
  5464      >
  5465                    
  5466       <summary>
  5467                     Come on,  you know  how except ions work.  Why are y ou looking  at this d ocumentati on?
  5468                     
  5469       </summary>
  5470                    
  5471       <param 
  5472        name="mess age"
  5473       >
  5474        The messag e in the e xception.
  5475       </param>
  5476                    
  5477       <param 
  5478        name="inne rException "
  5479       >
  5480        The innerE xception f or this ex ception.
  5481       </param>
  5482               
  5483      </member>
  5484              
  5485      <member 
  5486       name="M:Io nic.Zip.Ba dReadExcep tion.#ctor (System.Ru ntime.Seri alization. Serializat ionInfo,Sy stem.Runti me.Seriali zation.Str eamingCont ext)"
  5487      >
  5488                    
  5489       <summary>
  5490                     Come on,  you know  how except ions work.  Why are y ou looking  at this d ocumentati on?
  5491                     
  5492       </summary>
  5493                    
  5494       <param 
  5495        name="info "
  5496       >
  5497        The serial ization in fo for the  exception .
  5498       </param>
  5499                    
  5500       <param 
  5501        name="cont ext"
  5502       >
  5503        The stream ing contex t from whi ch to dese rialize.
  5504       </param>
  5505               
  5506      </member>
  5507              
  5508      <member 
  5509       name="T:Io nic.Zip.Ba dCrcExcept ion"
  5510      >
  5511                    
  5512       <summary>
  5513                     Issued w hen an CRC  check fai ls upon ex tracting a n entry fr om a zip a rchive.
  5514                     
  5515       </summary>
  5516               
  5517      </member>
  5518              
  5519      <member 
  5520       name="M:Io nic.Zip.Ba dCrcExcept ion.#ctor"
  5521      >
  5522                    
  5523       <summary>
  5524                     Default  ctor.
  5525                     
  5526       </summary>
  5527               
  5528      </member>
  5529              
  5530      <member 
  5531       name="M:Io nic.Zip.Ba dCrcExcept ion.#ctor( System.Str ing)"
  5532      >
  5533                    
  5534       <summary>
  5535                     Come on,  you know  how except ions work.  Why are y ou looking  at this d ocumentati on?
  5536                     
  5537       </summary>
  5538                    
  5539       <param 
  5540        name="mess age"
  5541       >
  5542        The messag e in the e xception.
  5543       </param>
  5544               
  5545      </member>
  5546              
  5547      <member 
  5548       name="M:Io nic.Zip.Ba dCrcExcept ion.#ctor( System.Run time.Seria lization.S erializati onInfo,Sys tem.Runtim e.Serializ ation.Stre amingConte xt)"
  5549      >
  5550                    
  5551       <summary>
  5552                     Come on,  you know  how except ions work.  Why are y ou looking  at this d ocumentati on?
  5553                     
  5554       </summary>
  5555                    
  5556       <param 
  5557        name="info "
  5558       >
  5559        The serial ization in fo for the  exception .
  5560       </param>
  5561                    
  5562       <param 
  5563        name="cont ext"
  5564       >
  5565        The stream ing contex t from whi ch to dese rialize.
  5566       </param>
  5567               
  5568      </member>
  5569              
  5570      <member 
  5571       name="T:Io nic.Zip.Sf xGeneratio nException "
  5572      >
  5573                    
  5574       <summary>
  5575                     Issued w hen errors  occur sav ing a self -extractin g archive.
  5576                     
  5577       </summary>
  5578               
  5579      </member>
  5580              
  5581      <member 
  5582       name="M:Io nic.Zip.Sf xGeneratio nException .#ctor"
  5583      >
  5584                    
  5585       <summary>
  5586                     Default  ctor.
  5587                     
  5588       </summary>
  5589               
  5590      </member>
  5591              
  5592      <member 
  5593       name="M:Io nic.Zip.Sf xGeneratio nException .#ctor(Sys tem.String )"
  5594      >
  5595                    
  5596       <summary>
  5597                     Come on,  you know  how except ions work.  Why are y ou looking  at this d ocumentati on?
  5598                     
  5599       </summary>
  5600                    
  5601       <param 
  5602        name="mess age"
  5603       >
  5604        The messag e in the e xception.
  5605       </param>
  5606               
  5607      </member>
  5608              
  5609      <member 
  5610       name="M:Io nic.Zip.Sf xGeneratio nException .#ctor(Sys tem.Runtim e.Serializ ation.Seri alizationI nfo,System .Runtime.S erializati on.Streami ngContext) "
  5611      >
  5612                    
  5613       <summary>
  5614                     Come on,  you know  how except ions work.  Why are y ou looking  at this d ocumentati on?
  5615                     
  5616       </summary>
  5617                    
  5618       <param 
  5619        name="info "
  5620       >
  5621        The serial ization in fo for the  exception .
  5622       </param>
  5623                    
  5624       <param 
  5625        name="cont ext"
  5626       >
  5627        The stream ing contex t from whi ch to dese rialize.
  5628       </param>
  5629               
  5630      </member>
  5631              
  5632      <member 
  5633       name="T:Io nic.Zip.Ba dStateExce ption"
  5634      >
  5635                    
  5636       <summary>
  5637                     Indicate s that an  operation  was attemp ted on a Z ipFile whi ch was not  possible
  5638                     given th e state of  the insta nce. For e xample, if  you call 
  5639        <c>
  5640         Save()
  5641        </c>
  5642         on a ZipF ile
  5643                     which ha s no filen ame set, y ou can get  this exce ption.
  5644                     
  5645       </summary>
  5646               
  5647      </member>
  5648              
  5649      <member 
  5650       name="M:Io nic.Zip.Ba dStateExce ption.#cto r"
  5651      >
  5652                    
  5653       <summary>
  5654                     Default  ctor.
  5655                     
  5656       </summary>
  5657               
  5658      </member>
  5659              
  5660      <member 
  5661       name="M:Io nic.Zip.Ba dStateExce ption.#cto r(System.S tring)"
  5662      >
  5663                    
  5664       <summary>
  5665                     Come on,  you know  how except ions work.  Why are y ou looking  at this d ocumentati on?
  5666                     
  5667       </summary>
  5668                    
  5669       <param 
  5670        name="mess age"
  5671       >
  5672        The messag e in the e xception.
  5673       </param>
  5674               
  5675      </member>
  5676              
  5677      <member 
  5678       name="M:Io nic.Zip.Ba dStateExce ption.#cto r(System.S tring,Syst em.Excepti on)"
  5679      >
  5680                    
  5681       <summary>
  5682                     Come on,  you know  how except ions work.  Why are y ou looking  at this d ocumentati on?
  5683                     
  5684       </summary>
  5685                    
  5686       <param 
  5687        name="mess age"
  5688       >
  5689        The messag e in the e xception.
  5690       </param>
  5691                    
  5692       <param 
  5693        name="inne rException "
  5694       >
  5695        The innerE xception f or this ex ception.
  5696       </param>
  5697               
  5698      </member>
  5699              
  5700      <member 
  5701       name="M:Io nic.Zip.Ba dStateExce ption.#cto r(System.R untime.Ser ialization .Serializa tionInfo,S ystem.Runt ime.Serial ization.St reamingCon text)"
  5702      >
  5703                    
  5704       <summary>
  5705                     Come on,  you know  how except ions work.  Why are y ou looking  at this d ocumentati on?
  5706                     
  5707       </summary>
  5708                    
  5709       <param 
  5710        name="info "
  5711       >
  5712        The serial ization in fo for the  exception .
  5713       </param>
  5714                    
  5715       <param 
  5716        name="cont ext"
  5717       >
  5718        The stream ing contex t from whi ch to dese rialize.
  5719       </param>
  5720               
  5721      </member>
  5722              
  5723      <member 
  5724       name="T:Io nic.Zip.Sh aredUtilit ies"
  5725      >
  5726                    
  5727       <summary>
  5728                     Collects  general p urpose uti lity metho ds.
  5729                     
  5730       </summary>
  5731               
  5732      </member>
  5733              
  5734      <member 
  5735       name="M:Io nic.Zip.Sh aredUtilit ies.GetFil eLength(Sy stem.Strin g)"
  5736      >
  5737                    private  null const ructor
  5738               
  5739      </member>
  5740              
  5741      <member 
  5742       name="M:Io nic.Zip.Sh aredUtilit ies.Normal izePathFor UseInZipFi le(System. String)"
  5743      >
  5744                    
  5745       <summary>
  5746                     Utility  routine fo r transfor ming path  names from  filesyste m format ( on Windows  that mean s backslas hes) to
  5747                     a format  suitable  for use wi thin zipfi les. This  means trim ming the v olume lett er and col on (if any ) And
  5748                     swapping  backslash es for for ward slash es.
  5749                     
  5750       </summary>
  5751                    
  5752       <param 
  5753        name="path Name"
  5754       >
  5755        source pat h.
  5756       </param>
  5757                    
  5758       <returns>
  5759        transforme d path
  5760       </returns>
  5761               
  5762      </member>
  5763              
  5764      <member 
  5765       name="M:Io nic.Zip.Sh aredUtilit ies.FindSi gnature(Sy stem.IO.St ream,Syste m.Int32)"
  5766      >
  5767                     
  5768       <summary>
  5769                        Finds  a signatu re in the  zip stream . This is  useful for  finding
  5770                        the e nd of a zi p entry, f or example , or the b eginning o f the next  ZipEntry.
  5771                      
  5772       </summary>
  5773                    
  5774                     
  5775       <remarks>
  5776                        
  5777        <para>
  5778                           Sca ns through  64k at a  time.
  5779                         
  5780        </para>
  5781                     
  5782                        
  5783        <para>
  5784                           If  the method  fails to  find the r equested s ignature,  the stream  Position
  5785                           aft er complet ion of thi s method i s unchange d. If the  method suc ceeds in
  5786                           fin ding the r equested s ignature,  the stream  position  after comp letion is
  5787                           dir ect AFTER  the signat ure found  in the str eam.
  5788                         
  5789        </para>
  5790                      
  5791       </remarks>
  5792                    
  5793                     
  5794       <param 
  5795        name="stre am"
  5796       >
  5797        The stream  to search
  5798       </param>
  5799                     
  5800       <param 
  5801        name="Sign atureToFin d"
  5802       >
  5803        The 4-byte  signature  to find
  5804       </param>
  5805                     
  5806       <returns>
  5807        The number  of bytes  read
  5808       </returns>
  5809               
  5810      </member>
  5811              
  5812      <member 
  5813       name="M:Io nic.Zip.Sh aredUtilit ies.Create AndOpenUni queTempFil e(System.S tring,Syst em.IO.Stre am@,System .String@)"
  5814      >
  5815                    
  5816       <summary>
  5817                       Create  a pseudo- random fil ename, sui table for  use as a t emporary
  5818                       file,  and open i t.
  5819                     
  5820       </summary>
  5821                    
  5822       <remarks>
  5823                     
  5824        <para>
  5825                        The Sy stem.IO.Pa th.GetRand omFileName () method  is not ava ilable on
  5826                        the Co mpact Fram ework, so  this libra ry provide s its own  substitute
  5827                        on NET CF.
  5828                      
  5829        </para>
  5830                     
  5831        <para>
  5832                        This m ethod prod uces a fil ename of t he form
  5833                        DotNet Zip-xxxxxx xx.tmp, wh ere xxxxxx xx is repl aced by ra ndomly
  5834                        chosen  character s, and cre ates that  file.
  5835                      
  5836        </para>
  5837                     
  5838       </remarks>
  5839               
  5840      </member>
  5841              
  5842      <member 
  5843       name="M:Io nic.Zip.Sh aredUtilit ies.ReadWi thRetry(Sy stem.IO.St ream,Syste m.Byte[],S ystem.Int3 2,System.I nt32,Syste m.String)"
  5844      >
  5845                    
  5846       <summary>
  5847                     Workitem  7889: han dle ERROR_ LOCK_VIOLA TION durin g read
  5848                     
  5849       </summary>
  5850                    
  5851       <remarks>
  5852                     This cou ld be grac efully han dled with  an extensi on attribu te, but
  5853                     This ass embly is b uilt for . NET 2.0, s o I cannot  use them.
  5854                     
  5855       </remarks>
  5856               
  5857      </member>
  5858              
  5859      <member 
  5860       name="T:Io nic.Zip.Co untingStre am"
  5861      >
  5862                    
  5863       <summary>
  5864                       A deco rator stre am. It wra ps another  stream, a nd perform s bookkeep ing
  5865                       to kee p track of  the strea m Position .
  5866                     
  5867       </summary>
  5868                    
  5869       <remarks>
  5870                       
  5871        <para>
  5872                          In s ome cases,  it is not  possible  to get the  Position  of a strea m, let's
  5873                          say,  on a writ e-only out put stream  like ASP. NET's
  5874                          
  5875         <c>
  5876          Response.O utputStrea m
  5877         </c>
  5878         , or on a  different  write-only  stream
  5879                          prov ided as th e destinat ion for th e zip by t he applica tion.  In  this
  5880                          case , programm ers can us e this cou nting stre am to coun t the byte s read
  5881                          or w ritten.
  5882                        
  5883        </para>
  5884                       
  5885        <para>
  5886                          Cons ider the s cenario of  an applic ation that  saves a s elf-extrac ting
  5887                          arch ive (SFX),  that uses  a custom  SFX stub.
  5888                        
  5889        </para>
  5890                       
  5891        <para>
  5892                          Savi ng to a fi lesystem f ile, the a pplication  would ope n the
  5893                          file system fil e (getting  a 
  5894         <c>
  5895          FileStream
  5896         </c>
  5897         ), save th e custom s fx stub
  5898                          into  it, and t hen call 
  5899         <c>
  5900          ZipFile.Sa ve()
  5901         </c>
  5902         , specifyi ng the sam e
  5903                          File Stream. 
  5904         <c>
  5905          ZipFile.Sa ve()
  5906         </c>
  5907          does the  right thin g for the  zipentry
  5908                          offs ets, by in quiring th e Position  of the 
  5909         <c>
  5910          FileStream
  5911         </c>
  5912          before wr iting
  5913                          any  data, and  then addin g that ini tial offse t into any  ZipEntry
  5914                          offs ets in the  zip direc tory. Ever ything wor ks fine.
  5915                        
  5916        </para>
  5917                       
  5918        <para>
  5919                          Now  suppose th e applicat ion is an  ASPNET app lication a nd it save s
  5920                          dire ctly to 
  5921         <c>
  5922          Response.O utputStrea m
  5923         </c>
  5924         . It's not  possible  for DotNet Zip to
  5925                          inqu ire the 
  5926         <c>
  5927          Position
  5928         </c>
  5929         , so the o ffsets for  the SFX w ill be wro ng.
  5930                        
  5931        </para>
  5932                       
  5933        <para>
  5934                          The  workaround  is for th e applicat ion to use  this clas s to wrap
  5935                          
  5936         <c>
  5937          HttpRespon se.OutputS tream
  5938         </c>
  5939         , then wri te the SFX  stub and  the ZipFil e
  5940                          into  that wrap per stream . Because 
  5941         <c>
  5942          ZipFile.Sa ve()
  5943         </c>
  5944          can inqui re the
  5945                          
  5946         <c>
  5947          Position
  5948         </c>
  5949         , it will  then do th e right th ing with t he offsets .
  5950                        
  5951        </para>
  5952                     
  5953       </remarks>
  5954               
  5955      </member>
  5956              
  5957      <member 
  5958       name="M:Io nic.Zip.Co untingStre am.#ctor(S ystem.IO.S tream)"
  5959      >
  5960                    
  5961       <summary>
  5962                     The cons tructor.
  5963                     
  5964       </summary>
  5965                    
  5966       <param 
  5967        name="stre am"
  5968       >
  5969        The underl ying strea m
  5970       </param>
  5971               
  5972      </member>
  5973              
  5974      <member 
  5975       name="M:Io nic.Zip.Co untingStre am.Adjust( System.Int 64)"
  5976      >
  5977                     
  5978       <summary>
  5979                         Adju st the byt e count on  the strea m.
  5980                      
  5981       </summary>
  5982                    
  5983                     
  5984       <param 
  5985        name='delt a'
  5986       >
  5987                        the n umber of b ytes to su btract fro m the coun t.
  5988                      
  5989       </param>
  5990                    
  5991                     
  5992       <remarks>
  5993                        
  5994        <para>
  5995                           Sub tract delt a from the  count of  bytes writ ten to the  stream.
  5996                           Thi s is neces sary when  seeking ba ck, and wr iting addi tional dat a,
  5997                           as  happens in  some case s when sav ing Zip fi les.
  5998                         
  5999        </para>
  6000                      
  6001       </remarks>
  6002               
  6003      </member>
  6004              
  6005      <member 
  6006       name="M:Io nic.Zip.Co untingStre am.Read(Sy stem.Byte[ ],System.I nt32,Syste m.Int32)"
  6007      >
  6008                    
  6009       <summary>
  6010                       The re ad method.
  6011                     
  6012       </summary>
  6013                    
  6014       <param 
  6015        name="buff er"
  6016       >
  6017        The buffer  to hold t he data re ad from th e stream.
  6018       </param>
  6019                    
  6020       <param 
  6021        name="offs et"
  6022       >
  6023        the offset  within th e buffer t o copy the  first byt e read.
  6024       </param>
  6025                    
  6026       <param 
  6027        name="coun t"
  6028       >
  6029        the number  of bytes  to read.
  6030       </param>
  6031                    
  6032       <returns>
  6033        the number  of bytes  read, afte r decrypti on and dec ompression .
  6034       </returns>
  6035               
  6036      </member>
  6037              
  6038      <member 
  6039       name="M:Io nic.Zip.Co untingStre am.Write(S ystem.Byte [],System. Int32,Syst em.Int32)"
  6040      >
  6041                    
  6042       <summary>
  6043                       Write  data into  the stream .
  6044                     
  6045       </summary>
  6046                    
  6047       <param 
  6048        name="buff er"
  6049       >
  6050        The buffer  holding d ata to wri te to the  stream.
  6051       </param>
  6052                    
  6053       <param 
  6054        name="offs et"
  6055       >
  6056        the offset  within th at data ar ray to fin d the firs t byte to  write.
  6057       </param>
  6058                    
  6059       <param 
  6060        name="coun t"
  6061       >
  6062        the number  of bytes  to write.
  6063       </param>
  6064               
  6065      </member>
  6066              
  6067      <member 
  6068       name="M:Io nic.Zip.Co untingStre am.Flush"
  6069      >
  6070                    
  6071       <summary>
  6072                       Flushe s the unde rlying str eam.
  6073                     
  6074       </summary>
  6075               
  6076      </member>
  6077              
  6078      <member 
  6079       name="M:Io nic.Zip.Co untingStre am.Seek(Sy stem.Int64 ,System.IO .SeekOrigi n)"
  6080      >
  6081                    
  6082       <summary>
  6083                       Seek i n the stre am.
  6084                     
  6085       </summary>
  6086                    
  6087       <param 
  6088        name="offs et"
  6089       >
  6090        the offset  point to  seek to
  6091       </param>
  6092                    
  6093       <param 
  6094        name="orig in"
  6095       >
  6096        the refere nce point  from which  to seek
  6097       </param>
  6098                    
  6099       <returns>
  6100        The new po sition
  6101       </returns>
  6102               
  6103      </member>
  6104              
  6105      <member 
  6106       name="M:Io nic.Zip.Co untingStre am.SetLeng th(System. Int64)"
  6107      >
  6108                     
  6109       <summary>
  6110                        Set t he length  of the und erlying st ream.  Be  careful wi th this!
  6111                      
  6112       </summary>
  6113                    
  6114                     
  6115       <param 
  6116        name='valu e'
  6117       >
  6118        the length  to set on  the under lying stre am.
  6119       </param>
  6120               
  6121      </member>
  6122              
  6123      <member 
  6124       name="P:Io nic.Zip.Co untingStre am.Wrapped Stream"
  6125      >
  6126                    
  6127       <summary>
  6128                       Gets t he wrapped  stream.
  6129                     
  6130       </summary>
  6131               
  6132      </member>
  6133              
  6134      <member 
  6135       name="P:Io nic.Zip.Co untingStre am.BytesWr itten"
  6136      >
  6137                    
  6138       <summary>
  6139                       The co unt of byt es written  out to th e stream.
  6140                     
  6141       </summary>
  6142               
  6143      </member>
  6144              
  6145      <member 
  6146       name="P:Io nic.Zip.Co untingStre am.BytesRe ad"
  6147      >
  6148                    
  6149       <summary>
  6150                       the co unt of byt es that ha ve been re ad from th e stream.
  6151                     
  6152       </summary>
  6153               
  6154      </member>
  6155              
  6156      <member 
  6157       name="P:Io nic.Zip.Co untingStre am.CanRead "
  6158      >
  6159                    
  6160       <summary>
  6161                       Whethe r the stre am can be  read.
  6162                     
  6163       </summary>
  6164               
  6165      </member>
  6166              
  6167      <member 
  6168       name="P:Io nic.Zip.Co untingStre am.CanSeek "
  6169      >
  6170                    
  6171       <summary>
  6172                       Whethe r it is po ssible to  call Seek( ) on the s tream.
  6173                     
  6174       </summary>
  6175               
  6176      </member>
  6177              
  6178      <member 
  6179       name="P:Io nic.Zip.Co untingStre am.CanWrit e"
  6180      >
  6181                    
  6182       <summary>
  6183                       Whethe r it is po ssible to  call Write () on the  stream.
  6184                     
  6185       </summary>
  6186               
  6187      </member>
  6188              
  6189      <member 
  6190       name="P:Io nic.Zip.Co untingStre am.Length"
  6191      >
  6192                    
  6193       <summary>
  6194                       The le ngth of th e underlyi ng stream.
  6195                     
  6196       </summary>
  6197               
  6198      </member>
  6199              
  6200      <member 
  6201       name="P:Io nic.Zip.Co untingStre am.Compute dPosition"
  6202      >
  6203                    
  6204       <summary>
  6205                       Return s the sum  of number  of bytes w ritten, pl us the ini tial
  6206                       offset  before wr iting.
  6207                     
  6208       </summary>
  6209               
  6210      </member>
  6211              
  6212      <member 
  6213       name="P:Io nic.Zip.Co untingStre am.Positio n"
  6214      >
  6215                    
  6216       <summary>
  6217                       The Po sition of  the stream .
  6218                     
  6219       </summary>
  6220               
  6221      </member>
  6222              
  6223      <member 
  6224       name="T:Io nic.Zip.Zi pCrypto"
  6225      >
  6226                     
  6227       <summary>
  6228                        This  class impl ements the  "traditio nal" or "c lassic" PK Zip encryp tion,
  6229                        which  today is  considered  to be wea k. On the  other hand  it is
  6230                        ubiqu itous. Thi s class is  intended  for use on ly by the  DotNetZip
  6231                        libra ry.
  6232                      
  6233       </summary>
  6234                    
  6235                     
  6236       <remarks>
  6237                        Most  uses of th e DotNetZi p library  will not i nvolve dir ect calls  into
  6238                        the Z ipCrypto c lass.  Ins tead, the  ZipCrypto  class is i nstantiate d and
  6239                        used  by the Zip Entry() cl ass when e ncryption  or decrypt ion on an  entry
  6240                        is em ployed.  I f for some  reason yo u really w anted to u se a weak
  6241                        encry ption algo rithm in s ome other  applicatio n, you mig ht use thi s
  6242                        libra ry.  But y ou would b e much bet ter off us ing one of  the built -in
  6243                        stron g encrypti on librari es in the  .NET Frame work, like  the AES
  6244                        algor ithm or SH A.
  6245                      
  6246       </remarks>
  6247               
  6248      </member>
  6249              
  6250      <member 
  6251       name="M:Io nic.Zip.Zi pCrypto.#c tor"
  6252      >
  6253                     
  6254       <summary>
  6255                        The d efault con structor f or ZipCryp to.
  6256                      
  6257       </summary>
  6258                    
  6259                     
  6260       <remarks>
  6261                        This  class is i ntended fo r internal  use by th e library  only. It's
  6262                        proba bly not us eful to yo u. Serious ly.  Stop  reading th is
  6263                        docum entation.   It's a wa ste of you r time.  G o do somet hing else.
  6264                        Check  the footb all scores . Go get a n ice crea m with a f riend.
  6265                        Serio usly.
  6266                      
  6267       </remarks>
  6268                    
  6269               
  6270      </member>
  6271              
  6272      <member 
  6273       name="M:Io nic.Zip.Zi pCrypto.De cryptMessa ge(System. Byte[],Sys tem.Int32) "
  6274      >
  6275                     
  6276       <summary>
  6277                        Call  this metho d on a cip her text t o render t he plainte xt. You mu st
  6278                        first  initializ e the ciph er with a  call to In itCipher.
  6279                      
  6280       </summary>
  6281                    
  6282                     
  6283       <example>
  6284                        
  6285        <code>
  6286                           var  cipher =  new ZipCry pto();
  6287                           cip her.InitCi pher(Passw ord);
  6288                           //  Decrypt th e header.   This has  a side eff ect of "fu rther init ializing t he
  6289                           //  encryption  keys" in  the tradit ional zip  encryption .
  6290                           byt e[] Decryp tedMessage  = cipher. DecryptMes sage(Encry ptedMessag e);
  6291                         
  6292        </code>
  6293                      
  6294       </example>
  6295                    
  6296                     
  6297       <param 
  6298        name="ciph erText"
  6299       >
  6300        The encryp ted buffer .
  6301       </param>
  6302                     
  6303       <param 
  6304        name="leng th"
  6305       >
  6306                        The n umber of b ytes to en crypt.
  6307                        Shoul d be less  than or eq ual to Cip herText.Le ngth.
  6308                      
  6309       </param>
  6310                    
  6311                     
  6312       <returns>
  6313        The plaint ext.
  6314       </returns>
  6315               
  6316      </member>
  6317              
  6318      <member 
  6319       name="M:Io nic.Zip.Zi pCrypto.En cryptMessa ge(System. Byte[],Sys tem.Int32) "
  6320      >
  6321                     
  6322       <summary>
  6323                        This  is the con verse of D ecryptMess age.  It e ncrypts th e plaintex t
  6324                        and p roduces a  ciphertext .
  6325                      
  6326       </summary>
  6327                    
  6328                     
  6329       <param 
  6330        name="plai nText"
  6331       >
  6332        The plain  text buffe r.
  6333       </param>
  6334                    
  6335                     
  6336       <param 
  6337        name="leng th"
  6338       >
  6339                        The n umber of b ytes to en crypt.
  6340                        Shoul d be less  than or eq ual to pla inText.Len gth.
  6341                      
  6342       </param>
  6343                    
  6344                     
  6345       <returns>
  6346        The cipher text.
  6347       </returns>
  6348               
  6349      </member>
  6350              
  6351      <member 
  6352       name="M:Io nic.Zip.Zi pCrypto.In itCipher(S ystem.Stri ng)"
  6353      >
  6354                     
  6355       <summary>
  6356                        This  initialize s the ciph er with th e given pa ssword.
  6357                        See A ppNote.txt  for detai ls.
  6358                      
  6359       </summary>
  6360                    
  6361                     
  6362       <param 
  6363        name="pass phrase"
  6364       >
  6365                        The p assphrase  for encryp ting or de crypting w ith this c ipher.
  6366                      
  6367       </param>
  6368                    
  6369                     
  6370       <remarks>
  6371                      
  6372        <code>
  6373                       Step 1  - Initiali zing the e ncryption  keys
  6374                       ------- ---------- ---------- ---------- ----
  6375                       Start w ith these  keys:
  6376                       Key(0)  := 3054198 96 (0x1234 5678)
  6377                       Key(1)  := 5917510 49 (0x2345 6789)
  6378                       Key(2)  := 8780821 92 (0x3456 7890)
  6379                      
  6380                       Then, i nitialize  the keys w ith a pass word:
  6381                      
  6382                       loop fo r i from 0  to length (password) -1
  6383                           upd ate_keys(p assword(i) )
  6384                       end loo p
  6385                      
  6386                       Where u pdate_keys () is defi ned as:
  6387                      
  6388                       update_ keys(char) :
  6389                         Key(0 ) := crc32 (key(0),ch ar)
  6390                         Key(1 ) := Key(1 ) + (Key(0 ) bitwiseA ND 000000f fH)
  6391                         Key(1 ) := Key(1 ) * 134775 813 + 1
  6392                         Key(2 ) := crc32 (key(2),ke y(1) right shift 24)
  6393                       end upd ate_keys
  6394                      
  6395                       Where c rc32(old_c rc,char) i s a routin e that giv en a CRC v alue and a
  6396                       charact er, return s an updat ed CRC val ue after a pplying th e CRC-32
  6397                       algorit hm describ ed elsewhe re in this  document.
  6398                      
  6399                       
  6400        </code>
  6401                     
  6402                      
  6403        <para>
  6404                         After  the keys  are initia lized, the n you can  use the ci pher to
  6405                         encry pt the pla intext.
  6406                       
  6407        </para>
  6408                     
  6409                      
  6410        <para>
  6411                         Essen tially we  encrypt th e password  with the  keys, then  discard t he
  6412                         ciphe rtext for  the passwo rd. This i nitializes  the keys  for later  use.
  6413                       
  6414        </para>
  6415                     
  6416                      
  6417       </remarks>
  6418               
  6419      </member>
  6420              
  6421      <member 
  6422       name="P:Io nic.Zip.Zi pCrypto.Ma gicByte"
  6423      >
  6424                    
  6425       <summary>
  6426                     From App Note.txt:
  6427                     unsigned  char decr ypt_byte()
  6428                         loca l unsigned  short tem p
  6429                         temp  :=- Key(2 ) | 2
  6430                         decr ypt_byte : = (temp *  (temp ^ 1) ) bitshift -right 8
  6431                     end decr ypt_byte
  6432                     
  6433       </summary>
  6434               
  6435      </member>
  6436              
  6437      <member 
  6438       name="T:Io nic.Zip.Zi pCipherStr eam"
  6439      >
  6440                    
  6441       <summary>
  6442                       A Stre am for rea ding and c oncurrentl y decrypti ng data fr om a zip f ile,
  6443                       or for  writing a nd concurr ently encr ypting dat a to a zip  file.
  6444                     
  6445       </summary>
  6446               
  6447      </member>
  6448              
  6449      <member 
  6450       name="M:Io nic.Zip.Zi pCipherStr eam.#ctor( System.IO. Stream,Ion ic.Zip.Zip Crypto,Ion ic.Zip.Cry ptoMode)"
  6451      >
  6452                    
  6453       <summary>
  6454          The cons tructor. 
  6455       </summary>
  6456                    
  6457       <param 
  6458        name="s"
  6459       >
  6460        The underl ying strea m
  6461       </param>
  6462                    
  6463       <param 
  6464        name="mode "
  6465       >
  6466        To either  encrypt or  decrypt.
  6467       </param>
  6468                    
  6469       <param 
  6470        name="ciph er"
  6471       >
  6472        The pre-in itialized  ZipCrypto  object.
  6473       </param>
  6474               
  6475      </member>
  6476              
  6477      <member 
  6478       name="T:Io nic.Zip.Wr iteDelegat e"
  6479      >
  6480                     
  6481       <summary>
  6482                        Deleg ate in whi ch the app lication w rites the 
  6483        <c>
  6484         ZipEntry
  6485        </c>
  6486         content f or the nam ed entry.
  6487                      
  6488       </summary>
  6489                    
  6490                     
  6491       <param 
  6492        name="entr yName"
  6493       >
  6494        The name o f the entr y that mus t be writt en.
  6495       </param>
  6496                     
  6497       <param 
  6498        name="stre am"
  6499       >
  6500        The stream  to which  the entry  data shoul d be writt en.
  6501       </param>
  6502                    
  6503                     
  6504       <remarks>
  6505                        When  you add an  entry and  specify a  
  6506        <c>
  6507         WriteDeleg ate
  6508        </c>
  6509        , via 
  6510        <see 
  6511         cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,I onic.Zip.W riteDelega te)"
  6512        />
  6513        , the appl ication
  6514                        code  provides t he logic t hat writes  the entry  data dire ctly into  the zip fi le.
  6515                      
  6516       </remarks>
  6517                    
  6518                     
  6519       <example>
  6520                     
  6521                      This ex ample show s how to d efine a Wr iteDelegat e that obt ains a Dat aSet, and  then
  6522                      writes  the XML fo r the Data Set into t he zip arc hive.  The re's no ne ed to
  6523                      save th e XML to a  disk file  first.
  6524                     
  6525                      
  6526        <code 
  6527         lang="C#"
  6528        >
  6529                       private  void Writ eEntry (St ring filen ame, Strea m output)
  6530                       {
  6531                           Dat aSet ds1 =  ObtainDat aSet();
  6532                           ds1 .WriteXml( output);
  6533                       }
  6534                      
  6535                       private  void Run( )
  6536                       {
  6537                           usi ng (var zi p = new Zi pFile())
  6538                           {
  6539                                zip.AddEn try(zipEnt ryName, Wr iteEntry);
  6540                                zip.Save( zipFileNam e);
  6541                           }
  6542                       }
  6543                       
  6544        </code>
  6545                     
  6546                      
  6547        <code 
  6548         lang="vb"
  6549        >
  6550                       Private  Sub Write Entry (ByV al filenam e As Strin g, ByVal o utput As S tream)
  6551                           Dat aSet ds1 =  ObtainDat aSet()
  6552                           ds1 .WriteXml( stream)
  6553                       End Sub
  6554                      
  6555                       Public  Sub Run()
  6556                           Usi ng zip = N ew ZipFile
  6557                                zip.AddEn try(zipEnt ryName, Ne w WriteDel egate(Addr essOf Writ eEntry))
  6558                                zip.Save( zipFileNam e)
  6559                           End  Using
  6560                       End Sub
  6561                       
  6562        </code>
  6563                      
  6564       </example>
  6565                     
  6566       <seealso 
  6567        cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,I onic.Zip.W riteDelega te)"
  6568       />
  6569               
  6570      </member>
  6571              
  6572      <member 
  6573       name="T:Io nic.Zip.Op enDelegate "
  6574      >
  6575                     
  6576       <summary>
  6577                        Deleg ate in whi ch the app lication o pens the s tream, jus t-in-time,  for the n amed entry .
  6578                      
  6579       </summary>
  6580                    
  6581                     
  6582       <param 
  6583        name="entr yName"
  6584       >
  6585                      The nam e of the Z ipEntry th at the app lication s hould open  the strea m for.
  6586                      
  6587       </param>
  6588                    
  6589                     
  6590       <remarks>
  6591                        When  you add an  entry via  
  6592        <see 
  6593         cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,I onic.Zip.O penDelegat e,Ionic.Zi p.CloseDel egate)"
  6594        />
  6595        , the appl ication co de provide s the logi c that
  6596                        opens  and close s the stre am for the  given Zip Entry.
  6597                      
  6598       </remarks>
  6599                    
  6600                     
  6601       <seealso 
  6602        cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,I onic.Zip.O penDelegat e,Ionic.Zi p.CloseDel egate)"
  6603       />
  6604               
  6605      </member>
  6606              
  6607      <member 
  6608       name="T:Io nic.Zip.Cl oseDelegat e"
  6609      >
  6610                     
  6611       <summary>
  6612                        Deleg ate in whi ch the app lication c loses the  stream, ju st-in-time , for the  named entr y.
  6613                      
  6614       </summary>
  6615                    
  6616                     
  6617       <param 
  6618        name="entr yName"
  6619       >
  6620                      The nam e of the Z ipEntry th at the app lication s hould clos e the stre am for.
  6621                      
  6622       </param>
  6623                    
  6624                     
  6625       <param 
  6626        name="stre am"
  6627       >
  6628        The stream  to be clo sed.
  6629       </param>
  6630                    
  6631                     
  6632       <remarks>
  6633                        When  you add an  entry via  
  6634        <see 
  6635         cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,I onic.Zip.O penDelegat e,Ionic.Zi p.CloseDel egate)"
  6636        />
  6637        , the appl ication co de provide s the logi c that
  6638                        opens  and close s the stre am for the  given Zip Entry.
  6639                      
  6640       </remarks>
  6641                    
  6642                     
  6643       <seealso 
  6644        cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,I onic.Zip.O penDelegat e,Ionic.Zi p.CloseDel egate)"
  6645       />
  6646               
  6647      </member>
  6648              
  6649      <member 
  6650       name="T:Io nic.Zip.Se tCompressi onCallback "
  6651      >
  6652                     
  6653       <summary>
  6654                        Deleg ate for th e callback  by which  the applic ation tell s the
  6655                        libra ry the Com pressionLe vel to use  for a fil e.
  6656                      
  6657       </summary>
  6658                    
  6659                     
  6660       <remarks>
  6661                      
  6662        <para>
  6663                         Using  this call back, the  applicatio n can, for  example,  specify th at
  6664                         previ ously-comp ressed fil es (.mp3,  .png, .doc x, etc) sh ould use a
  6665                         
  6666         <c>
  6667          Compressio nLevel
  6668         </c>
  6669          of 
  6670         <c>
  6671          None
  6672         </c>
  6673         , or can s et the com pression l evel based
  6674                         on an y other fa ctor.
  6675                       
  6676        </para>
  6677                      
  6678       </remarks>
  6679                     
  6680       <seealso 
  6681        cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  6682       />
  6683               
  6684      </member>
  6685              
  6686      <member 
  6687       name="T:Io nic.Zip.Zi pProgressE ventType"
  6688      >
  6689                    
  6690       <summary>
  6691                       In an  EventArgs  type, indi cates whic h sort of  progress e vent is be ing
  6692                       report ed.
  6693                     
  6694       </summary>
  6695                    
  6696       <remarks>
  6697                       There  are events  for readi ng, events  for savin g, and eve nts for
  6698                       extrac ting. This  enumerati on allows  a single E ventArgs t ype to be  sued to
  6699                       descri be one of  multiple s ubevents.  For exampl e, a SaveP rogress ev ent is
  6700                       invoke d before,  after, and  during th e saving o f a single  entry.  T he value
  6701                       of an  enum with  this type,  specifies  which eve nt is bein g triggere d.  The
  6702                       same a pplies to  Extraction , Reading  and Adding  events.
  6703                     
  6704       </remarks>
  6705               
  6706      </member>
  6707              
  6708      <member 
  6709       name="F:Io nic.Zip.Zi pProgressE ventType.A dding_Star ted"
  6710      >
  6711                    
  6712       <summary>
  6713                     Indicate s that a A dd() opera tion has s tarted.
  6714                     
  6715       </summary>
  6716               
  6717      </member>
  6718              
  6719      <member 
  6720       name="F:Io nic.Zip.Zi pProgressE ventType.A dding_Afte rAddEntry"
  6721      >
  6722                    
  6723       <summary>
  6724                     Indicate s that an  individual  entry in  the archiv e has been  added.
  6725                     
  6726       </summary>
  6727               
  6728      </member>
  6729              
  6730      <member 
  6731       name="F:Io nic.Zip.Zi pProgressE ventType.A dding_Comp leted"
  6732      >
  6733                    
  6734       <summary>
  6735                     Indicate s that a A dd() opera tion has c ompleted.
  6736                     
  6737       </summary>
  6738               
  6739      </member>
  6740              
  6741      <member 
  6742       name="F:Io nic.Zip.Zi pProgressE ventType.R eading_Sta rted"
  6743      >
  6744                    
  6745       <summary>
  6746                     Indicate s that a R ead() oper ation has  started.
  6747                     
  6748       </summary>
  6749               
  6750      </member>
  6751              
  6752      <member 
  6753       name="F:Io nic.Zip.Zi pProgressE ventType.R eading_Bef oreReadEnt ry"
  6754      >
  6755                    
  6756       <summary>
  6757                     Indicate s that an  individual  entry in  the archiv e is about  to be rea d.
  6758                     
  6759       </summary>
  6760               
  6761      </member>
  6762              
  6763      <member 
  6764       name="F:Io nic.Zip.Zi pProgressE ventType.R eading_Aft erReadEntr y"
  6765      >
  6766                    
  6767       <summary>
  6768                     Indicate s that an  individual  entry in  the archiv e has just  been read .
  6769                     
  6770       </summary>
  6771               
  6772      </member>
  6773              
  6774      <member 
  6775       name="F:Io nic.Zip.Zi pProgressE ventType.R eading_Com pleted"
  6776      >
  6777                    
  6778       <summary>
  6779                     Indicate s that a R ead() oper ation has  completed.
  6780                     
  6781       </summary>
  6782               
  6783      </member>
  6784              
  6785      <member 
  6786       name="F:Io nic.Zip.Zi pProgressE ventType.R eading_Arc hiveBytesR ead"
  6787      >
  6788                    
  6789       <summary>
  6790                     The give n event re ports the  number of  bytes read  so far
  6791                     during a  Read() op eration.
  6792                     
  6793       </summary>
  6794               
  6795      </member>
  6796              
  6797      <member 
  6798       name="F:Io nic.Zip.Zi pProgressE ventType.S aving_Star ted"
  6799      >
  6800                    
  6801       <summary>
  6802                     Indicate s that a S ave() oper ation has  started.
  6803                     
  6804       </summary>
  6805               
  6806      </member>
  6807              
  6808      <member 
  6809       name="F:Io nic.Zip.Zi pProgressE ventType.S aving_Befo reWriteEnt ry"
  6810      >
  6811                    
  6812       <summary>
  6813                     Indicate s that an  individual  entry in  the archiv e is about  to be wri tten.
  6814                     
  6815       </summary>
  6816               
  6817      </member>
  6818              
  6819      <member 
  6820       name="F:Io nic.Zip.Zi pProgressE ventType.S aving_Afte rWriteEntr y"
  6821      >
  6822                    
  6823       <summary>
  6824                     Indicate s that an  individual  entry in  the archiv e has just  been save d.
  6825                     
  6826       </summary>
  6827               
  6828      </member>
  6829              
  6830      <member 
  6831       name="F:Io nic.Zip.Zi pProgressE ventType.S aving_Comp leted"
  6832      >
  6833                    
  6834       <summary>
  6835                     Indicate s that a S ave() oper ation has  completed.
  6836                     
  6837       </summary>
  6838               
  6839      </member>
  6840              
  6841      <member 
  6842       name="F:Io nic.Zip.Zi pProgressE ventType.S aving_Afte rSaveTempA rchive"
  6843      >
  6844                    
  6845       <summary>
  6846                     Indicate s that the  zip archi ve has bee n created  in a
  6847                     temporar y location  during a  Save() ope ration.
  6848                     
  6849       </summary>
  6850               
  6851      </member>
  6852              
  6853      <member 
  6854       name="F:Io nic.Zip.Zi pProgressE ventType.S aving_Befo reRenameTe mpArchive"
  6855      >
  6856                    
  6857       <summary>
  6858                     Indicate s that the  temporary  file is a bout to be  renamed t o the fina l archive
  6859                     name dur ing a Save () operati on.
  6860                     
  6861       </summary>
  6862               
  6863      </member>
  6864              
  6865      <member 
  6866       name="F:Io nic.Zip.Zi pProgressE ventType.S aving_Afte rRenameTem pArchive"
  6867      >
  6868                    
  6869       <summary>
  6870                     Indicate s that the  temporary  file is h as just be en renamed  to the fi nal archiv e
  6871                     name dur ing a Save () operati on.
  6872                     
  6873       </summary>
  6874               
  6875      </member>
  6876              
  6877      <member 
  6878       name="F:Io nic.Zip.Zi pProgressE ventType.S aving_Afte rCompileSe lfExtracto r"
  6879      >
  6880                    
  6881       <summary>
  6882                     Indicate s that the  self-extr acting arc hive has b een compil ed
  6883                     during a  Save() op eration.
  6884                     
  6885       </summary>
  6886               
  6887      </member>
  6888              
  6889      <member 
  6890       name="F:Io nic.Zip.Zi pProgressE ventType.S aving_Entr yBytesRead "
  6891      >
  6892                    
  6893       <summary>
  6894                     The give n event is  reporting  the numbe r of sourc e bytes th at have ru n through  the compre ssor so fa r
  6895                     during a  Save() op eration.
  6896                     
  6897       </summary>
  6898               
  6899      </member>
  6900              
  6901      <member 
  6902       name="F:Io nic.Zip.Zi pProgressE ventType.E xtracting_ BeforeExtr actEntry"
  6903      >
  6904                    
  6905       <summary>
  6906                     Indicate s that an  entry is a bout to be  extracted .
  6907                     
  6908       </summary>
  6909               
  6910      </member>
  6911              
  6912      <member 
  6913       name="F:Io nic.Zip.Zi pProgressE ventType.E xtracting_ AfterExtra ctEntry"
  6914      >
  6915                    
  6916       <summary>
  6917                     Indicate s that an  entry has  just been  extracted.
  6918                     
  6919       </summary>
  6920               
  6921      </member>
  6922              
  6923      <member 
  6924       name="F:Io nic.Zip.Zi pProgressE ventType.E xtracting_ ExtractEnt ryWouldOve rwrite"
  6925      >
  6926                    
  6927       <summary>
  6928                       Indica tes that e xtraction  of an entr y would ov erwrite an  existing
  6929                       filesy stem file.  You must  use
  6930                       
  6931        <see 
  6932         cref="F:Io nic.Zip.Ex tractExist ingFileAct ion.Invoke ExtractPro gressEvent "
  6933        >
  6934                        Extrac tExistingF ileAction. InvokeExtr actProgres sEvent
  6935        </see>
  6936         in the ca ll
  6937                       to 
  6938        <c>
  6939         ZipEntry.E xtract()
  6940        </c>
  6941         in order  to receive  this even t.
  6942                     
  6943       </summary>
  6944               
  6945      </member>
  6946              
  6947      <member 
  6948       name="F:Io nic.Zip.Zi pProgressE ventType.E xtracting_ EntryBytes Written"
  6949      >
  6950                    
  6951       <summary>
  6952                       The gi ven event  is reporti ng the num ber of byt es written  so far fo r
  6953                       the cu rrent entr y during a n Extract( ) operatio n.
  6954                     
  6955       </summary>
  6956               
  6957      </member>
  6958              
  6959      <member 
  6960       name="F:Io nic.Zip.Zi pProgressE ventType.E xtracting_ BeforeExtr actAll"
  6961      >
  6962                    
  6963       <summary>
  6964                     Indicate s that an  ExtractAll  operation  is about  to begin.
  6965                     
  6966       </summary>
  6967               
  6968      </member>
  6969              
  6970      <member 
  6971       name="F:Io nic.Zip.Zi pProgressE ventType.E xtracting_ AfterExtra ctAll"
  6972      >
  6973                    
  6974       <summary>
  6975                     Indicate s that an  ExtractAll  operation  has compl eted.
  6976                     
  6977       </summary>
  6978               
  6979      </member>
  6980              
  6981      <member 
  6982       name="F:Io nic.Zip.Zi pProgressE ventType.E rror_Savin g"
  6983      >
  6984                    
  6985       <summary>
  6986                     Indicate s that an  error has  occurred w hile savin g a zip fi le.
  6987                     This gen erally mea ns the fil e cannot b e opened,  because it  has been
  6988                     removed,  or becaus e it is lo cked by an other proc ess.  It c an also
  6989                     mean tha t the file  cannot be  Read, bec ause of a  range lock  conflict.
  6990                     
  6991       </summary>
  6992               
  6993      </member>
  6994              
  6995      <member 
  6996       name="T:Io nic.Zip.Zi pProgressE ventArgs"
  6997      >
  6998                    
  6999       <summary>
  7000                     Provides  informati on about t he progres s of a sav e, read, o r extract  operation.
  7001                     This is  a base cla ss; you wi ll probabl y use one  of the cla sses deriv ed from th is one.
  7002                     
  7003       </summary>
  7004               
  7005      </member>
  7006              
  7007      <member 
  7008       name="P:Io nic.Zip.Zi pProgressE ventArgs.E ntriesTota l"
  7009      >
  7010                    
  7011       <summary>
  7012                     The tota l number o f entries  to be save d or extra cted.
  7013                     
  7014       </summary>
  7015               
  7016      </member>
  7017              
  7018      <member 
  7019       name="P:Io nic.Zip.Zi pProgressE ventArgs.C urrentEntr y"
  7020      >
  7021                    
  7022       <summary>
  7023                     The name  of the la st entry s aved or ex tracted.
  7024                     
  7025       </summary>
  7026               
  7027      </member>
  7028              
  7029      <member 
  7030       name="P:Io nic.Zip.Zi pProgressE ventArgs.C ancel"
  7031      >
  7032                    
  7033       <summary>
  7034                     In an ev ent handle r, set thi s to cance l the save  or extrac t
  7035                     operatio n that is  in progres s.
  7036                     
  7037       </summary>
  7038               
  7039      </member>
  7040              
  7041      <member 
  7042       name="P:Io nic.Zip.Zi pProgressE ventArgs.E ventType"
  7043      >
  7044                    
  7045       <summary>
  7046                     The type  of event  being repo rted.
  7047                     
  7048       </summary>
  7049               
  7050      </member>
  7051              
  7052      <member 
  7053       name="P:Io nic.Zip.Zi pProgressE ventArgs.A rchiveName "
  7054      >
  7055                    
  7056       <summary>
  7057                     Returns  the archiv e name ass ociated to  this even t.
  7058                     
  7059       </summary>
  7060               
  7061      </member>
  7062              
  7063      <member 
  7064       name="P:Io nic.Zip.Zi pProgressE ventArgs.B ytesTransf erred"
  7065      >
  7066                    
  7067       <summary>
  7068                     The numb er of byte s read or  written so  far for t his entry.
  7069                     
  7070       </summary>
  7071               
  7072      </member>
  7073              
  7074      <member 
  7075       name="P:Io nic.Zip.Zi pProgressE ventArgs.T otalBytesT oTransfer"
  7076      >
  7077                    
  7078       <summary>
  7079                     Total nu mber of by tes that w ill be rea d or writt en for thi s entry.
  7080                     This num ber will b e -1 if th e value ca nnot be de termined.
  7081                     
  7082       </summary>
  7083               
  7084      </member>
  7085              
  7086      <member 
  7087       name="T:Io nic.Zip.Re adProgress EventArgs"
  7088      >
  7089                    
  7090       <summary>
  7091                     Provides  informati on about t he progres s of a Rea d operatio n.
  7092                     
  7093       </summary>
  7094               
  7095      </member>
  7096              
  7097      <member 
  7098       name="T:Io nic.Zip.Ad dProgressE ventArgs"
  7099      >
  7100                    
  7101       <summary>
  7102                     Provides  informati on about t he progres s of a Add  operation .
  7103                     
  7104       </summary>
  7105               
  7106      </member>
  7107              
  7108      <member 
  7109       name="T:Io nic.Zip.Sa veProgress EventArgs"
  7110      >
  7111                    
  7112       <summary>
  7113                     Provides  informati on about t he progres s of a sav e operatio n.
  7114                     
  7115       </summary>
  7116               
  7117      </member>
  7118              
  7119      <member 
  7120       name="M:Io nic.Zip.Sa veProgress EventArgs. #ctor(Syst em.String, System.Boo lean,Syste m.Int32,Sy stem.Int32 ,Ionic.Zip .ZipEntry) "
  7121      >
  7122                    
  7123       <summary>
  7124                     Construc tor for th e SaveProg ressEventA rgs.
  7125                     
  7126       </summary>
  7127                    
  7128       <param 
  7129        name="arch iveName"
  7130       >
  7131        the name o f the zip  archive.
  7132       </param>
  7133                    
  7134       <param 
  7135        name="befo re"
  7136       >
  7137        whether th is is befo re saving  the entry,  or after
  7138       </param>
  7139                    
  7140       <param 
  7141        name="entr iesTotal"
  7142       >
  7143        The total  number of  entries in  the zip a rchive.
  7144       </param>
  7145                    
  7146       <param 
  7147        name="entr iesSaved"
  7148       >
  7149        Number of  entries th at have be en saved.
  7150       </param>
  7151                    
  7152       <param 
  7153        name="entr y"
  7154       >
  7155        The entry  involved i n the even t.
  7156       </param>
  7157               
  7158      </member>
  7159              
  7160      <member 
  7161       name="P:Io nic.Zip.Sa veProgress EventArgs. EntriesSav ed"
  7162      >
  7163                    
  7164       <summary>
  7165                     Number o f entries  saved so f ar.
  7166                     
  7167       </summary>
  7168               
  7169      </member>
  7170              
  7171      <member 
  7172       name="T:Io nic.Zip.Ex tractProgr essEventAr gs"
  7173      >
  7174                    
  7175       <summary>
  7176                     Provides  informati on about t he progres s of the e xtract ope ration.
  7177                     
  7178       </summary>
  7179               
  7180      </member>
  7181              
  7182      <member 
  7183       name="M:Io nic.Zip.Ex tractProgr essEventAr gs.#ctor(S ystem.Stri ng,System. Boolean,Sy stem.Int32 ,System.In t32,Ionic. Zip.ZipEnt ry,System. String)"
  7184      >
  7185                    
  7186       <summary>
  7187                     Construc tor for th e ExtractP rogressEve ntArgs.
  7188                     
  7189       </summary>
  7190                    
  7191       <param 
  7192        name="arch iveName"
  7193       >
  7194        the name o f the zip  archive.
  7195       </param>
  7196                    
  7197       <param 
  7198        name="befo re"
  7199       >
  7200        whether th is is befo re saving  the entry,  or after
  7201       </param>
  7202                    
  7203       <param 
  7204        name="entr iesTotal"
  7205       >
  7206        The total  number of  entries in  the zip a rchive.
  7207       </param>
  7208                    
  7209       <param 
  7210        name="entr iesExtract ed"
  7211       >
  7212        Number of  entries th at have be en extract ed.
  7213       </param>
  7214                    
  7215       <param 
  7216        name="entr y"
  7217       >
  7218        The entry  involved i n the even t.
  7219       </param>
  7220                    
  7221       <param 
  7222        name="extr actLocatio n"
  7223       >
  7224        The locati on to whic h entries  are extrac ted.
  7225       </param>
  7226               
  7227      </member>
  7228              
  7229      <member 
  7230       name="P:Io nic.Zip.Ex tractProgr essEventAr gs.Entries Extracted"
  7231      >
  7232                    
  7233       <summary>
  7234                     Number o f entries  extracted  so far.  T his is set  only if t he
  7235                     EventTyp e is Extra cting_Befo reExtractE ntry or Ex tracting_A fterExtrac tEntry, an d
  7236                     the Extr act() is o ccurring w itin the s cope of a  call to Ex tractAll() .
  7237                     
  7238       </summary>
  7239               
  7240      </member>
  7241              
  7242      <member 
  7243       name="P:Io nic.Zip.Ex tractProgr essEventAr gs.Extract Location"
  7244      >
  7245                    
  7246       <summary>
  7247                     Returns  the extrac tion targe t location , a filesy stem path.
  7248                     
  7249       </summary>
  7250               
  7251      </member>
  7252              
  7253      <member 
  7254       name="T:Io nic.Zip.Zi pErrorEven tArgs"
  7255      >
  7256                    
  7257       <summary>
  7258                     Provides  informati on about t he an erro r that occ urred whil e zipping.
  7259                     
  7260       </summary>
  7261               
  7262      </member>
  7263              
  7264      <member 
  7265       name="P:Io nic.Zip.Zi pErrorEven tArgs.Exce ption"
  7266      >
  7267                    
  7268       <summary>
  7269                     Returns  the except ion that o ccurred, i f any.
  7270                     
  7271       </summary>
  7272               
  7273      </member>
  7274              
  7275      <member 
  7276       name="P:Io nic.Zip.Zi pErrorEven tArgs.File Name"
  7277      >
  7278                    
  7279       <summary>
  7280                     Returns  the name o f the file  that caus ed the exc eption, if  any.
  7281                     
  7282       </summary>
  7283               
  7284      </member>
  7285              
  7286      <member 
  7287       name="T:Io nic.Zip.Zi pEntry"
  7288      >
  7289                    
  7290       <summary>
  7291                     Represen ts a singl e entry in  a ZipFile . Typicall y, applica tions get  a ZipEntry
  7292                     by enume rating the  entries w ithin a Zi pFile, or  by adding  an entry t o a ZipFil e.
  7293                     
  7294       </summary>
  7295               
  7296      </member>
  7297              
  7298      <member 
  7299       name="M:Io nic.Zip.Zi pEntry.Rea dDirEntry( Ionic.Zip. ZipFile,Sy stem.Colle ctions.Gen eric.Dicti onary{Syst em.String, System.Obj ect})"
  7300      >
  7301                     
  7302       <summary>
  7303                        Reads  one entry  from the  zip direct ory struct ure in the  zip file.
  7304                      
  7305       </summary>
  7306                    
  7307                     
  7308       <param 
  7309        name="zf"
  7310       >
  7311                        The z ipfile for  which a d irectory e ntry will  be read.   From this  param, the
  7312                        metho d gets the  ReadStrea m and the  expected t ext encodi ng
  7313                        (Prov isionalAlt ernateEnco ding) whic h is used  if the ent ry is not  marked
  7314                        UTF-8 .
  7315                      
  7316       </param>
  7317                    
  7318                     
  7319       <param 
  7320        name="prev iouslySeen "
  7321       >
  7322                        a lis t of previ ously seen  entry nam es; used t o prevent  duplicates .
  7323                      
  7324       </param>
  7325                    
  7326                     
  7327       <returns>
  7328        the entry  read from  the archiv e.
  7329       </returns>
  7330               
  7331      </member>
  7332              
  7333      <member 
  7334       name="M:Io nic.Zip.Zi pEntry.IsN otValidZip DirEntrySi g(System.I nt32)"
  7335      >
  7336                    
  7337       <summary>
  7338                     Returns  true if th e passed-i n value is  a valid s ignature f or a ZipDi rEntry.
  7339                     
  7340       </summary>
  7341                    
  7342       <param 
  7343        name="sign ature"
  7344       >
  7345        the candid ate 4-byte  signature  value.
  7346       </param>
  7347                    
  7348       <returns>
  7349        true, if t he signatu re is vali d accordin g to the P KWare spec .
  7350       </returns>
  7351               
  7352      </member>
  7353              
  7354      <member 
  7355       name="M:Io nic.Zip.Zi pEntry.#ct or"
  7356      >
  7357                    
  7358       <summary>
  7359                     Default  constructo r.
  7360                     
  7361       </summary>
  7362                    
  7363       <remarks>
  7364                     Applicat ions shoul d never ne ed to call  this dire ctly.  It  is exposed  to
  7365                     support  COM Automa tion envir onments.
  7366                     
  7367       </remarks>
  7368               
  7369      </member>
  7370              
  7371      <member 
  7372       name="M:Io nic.Zip.Zi pEntry.Set EntryTimes (System.Da teTime,Sys tem.DateTi me,System. DateTime)"
  7373      >
  7374                     
  7375       <summary>
  7376                        Sets  the NTFS C reation, A ccess, and  Modified  times for  the given  entry.
  7377                      
  7378       </summary>
  7379                    
  7380                     
  7381       <remarks>
  7382                      
  7383        <para>
  7384                         When  adding an  entry from  a file or  directory , the Crea tion, Acce ss, and
  7385                         Modif ied times  for the gi ven entry  are automa tically se t from the
  7386                         files ystem valu es. When a dding an e ntry from  a stream o r string,  the
  7387                         value s are impl icitly set  to DateTi me.Now.  T he applica tion may w ish to
  7388                         set t hese value s to some  arbitrary  value, bef ore saving  the archi ve, and
  7389                         can d o so using  the vario us setters .  If you  want to se t all of t he times,
  7390                         this  method is  more effic ient.
  7391                       
  7392        </para>
  7393                     
  7394                      
  7395        <para>
  7396                         The v alues you  set here w ill be ret rievable w ith the 
  7397         <see 
  7398          cref="P:Io nic.Zip.Zi pEntry.Mod ifiedTime"
  7399         />
  7400        
  7401         <see 
  7402          cref="P:Io nic.Zip.Zi pEntry.Cre ationTime"
  7403         />
  7404          and 
  7405         <see 
  7406          cref="P:Io nic.Zip.Zi pEntry.Acc essedTime"
  7407         />
  7408          propertie s.
  7409                       
  7410        </para>
  7411                     
  7412                      
  7413        <para>
  7414                         When  this metho d is calle d, if both  
  7415         <see 
  7416          cref="P:Io nic.Zip.Zi pEntry.Emi tTimesInWi ndowsForma tWhenSavin g"
  7417         />
  7418          and 
  7419         <see 
  7420          cref="P:Io nic.Zip.Zi pEntry.Emi tTimesInUn ixFormatWh enSaving"
  7421         />
  7422          are false , then the
  7423                         
  7424         <c>
  7425          EmitTimesI nWindowsFo rmatWhenSa ving
  7426         </c>
  7427          flag is a utomatical ly set.
  7428                       
  7429        </para>
  7430                     
  7431                      
  7432        <para>
  7433                         DateT ime values  provided  here witho ut a DateT imeKind ar e assumed  to be Loca l Time.
  7434                       
  7435        </para>
  7436                     
  7437                      
  7438       </remarks>
  7439                     
  7440       <param 
  7441        name="crea ted"
  7442       >
  7443        the creati on time of  the entry .
  7444       </param>
  7445                     
  7446       <param 
  7447        name="acce ssed"
  7448       >
  7449        the last a ccess time  of the en try.
  7450       </param>
  7451                     
  7452       <param 
  7453        name="modi fied"
  7454       >
  7455        the last m odified ti me of the  entry.
  7456       </param>
  7457                    
  7458                     
  7459       <seealso 
  7460        cref="P:Io nic.Zip.Zi pEntry.Emi tTimesInWi ndowsForma tWhenSavin g"
  7461       />
  7462                     
  7463       <seealso 
  7464        cref="P:Io nic.Zip.Zi pEntry.Emi tTimesInUn ixFormatWh enSaving"
  7465       />
  7466                     
  7467       <seealso 
  7468        cref="P:Io nic.Zip.Zi pEntry.Acc essedTime"
  7469       />
  7470                     
  7471       <seealso 
  7472        cref="P:Io nic.Zip.Zi pEntry.Cre ationTime"
  7473       />
  7474                     
  7475       <seealso 
  7476        cref="P:Io nic.Zip.Zi pEntry.Mod ifiedTime"
  7477       />
  7478               
  7479      </member>
  7480              
  7481      <member 
  7482       name="M:Io nic.Zip.Zi pEntry.ToS tring"
  7483      >
  7484                    
  7485       <summary>
  7486        Provides a  string re presentati on of the  instance.
  7487       </summary>
  7488                    
  7489       <returns>
  7490        a string r epresentat ion of the  instance.
  7491       </returns>
  7492               
  7493      </member>
  7494              
  7495      <member 
  7496       name="M:Io nic.Zip.Zi pEntry.Ext ract"
  7497      >
  7498                     
  7499       <summary>
  7500                        Extra ct the ent ry to the  filesystem , starting  at the cu rrent
  7501                        worki ng directo ry.
  7502                      
  7503       </summary>
  7504                    
  7505                     
  7506       <overloads >
  7507                        This  method has  a bunch o f overload s! One of  them is su re to
  7508                        be th e right on e for you. .. If you  don't like  these, ch eck
  7509                        out t he 
  7510        <c>
  7511         ExtractWit hPassword( )
  7512        </c>
  7513         methods.
  7514                      
  7515       </overload s>
  7516                    
  7517                     
  7518       <seealso 
  7519        cref="P:Io nic.Zip.Zi pEntry.Ext ractExisti ngFile"
  7520       />
  7521                     
  7522       <seealso 
  7523        cref="M:Io nic.Zip.Zi pEntry.Ext ract(Ionic .Zip.Extra ctExisting FileAction )"
  7524       />
  7525                    
  7526                     
  7527       <remarks>
  7528                     
  7529                      
  7530        <para>
  7531                         This  method ext racts an e ntry from  a zip file  into the  current
  7532                         worki ng directo ry.  The p ath of the  entry as  extracted  is the ful l
  7533                         path  as specifi ed in the  zip archiv e, relativ e to the c urrent
  7534                         worki ng directo ry.  After  the file  is extract ed success fully, the
  7535                         file  attributes  and times tamps are  set.
  7536                       
  7537        </para>
  7538                     
  7539                      
  7540        <para>
  7541                         The a ction take n when ext raction an  entry wou ld overwri te an
  7542                         exist ing file i s determin ed by the 
  7543         <see 
  7544          cref="P:Io nic.Zip.Zi pEntry.Ext ractExisti ngFile"
  7545         />
  7546          property.
  7547                       
  7548        </para>
  7549                     
  7550                      
  7551        <para>
  7552                         Withi n the call  to 
  7553         <c>
  7554          Extract()
  7555         </c>
  7556         , the cont ent for th e entry is
  7557                         writt en into a  filesystem  file, and  then the  last modif ied time o f the
  7558                         file  is set acc ording to  the 
  7559         <see 
  7560          cref="P:Io nic.Zip.Zi pEntry.Las tModified"
  7561         />
  7562          property  on
  7563                         the e ntry. See  the remark s the 
  7564         <see 
  7565          cref="P:Io nic.Zip.Zi pEntry.Las tModified"
  7566         />
  7567          property  for
  7568                         some  details ab out the la st modifie d time.
  7569                       
  7570        </para>
  7571                     
  7572                      
  7573       </remarks>
  7574               
  7575      </member>
  7576              
  7577      <member 
  7578       name="M:Io nic.Zip.Zi pEntry.Ext ract(Ionic .Zip.Extra ctExisting FileAction )"
  7579      >
  7580                     
  7581       <summary>
  7582                        Extra ct the ent ry to a fi le in the  filesystem , using th e specifie d
  7583                        behav ior when e xtraction  would over write an e xisting fi le.
  7584                      
  7585       </summary>
  7586                    
  7587                     
  7588       <remarks>
  7589                      
  7590        <para>
  7591                         See t he remarks  on the 
  7592         <see 
  7593          cref="P:Io nic.Zip.Zi pEntry.Las tModified"
  7594         />
  7595          property,  for some
  7596                         detai ls about h ow the las t modified  time of t he file is  set after
  7597                         extra ction.
  7598                       
  7599        </para>
  7600                      
  7601       </remarks>
  7602                    
  7603                     
  7604       <param 
  7605        name="extr actExistin gFile"
  7606       >
  7607                        The a ction to t ake if ext raction wo uld overwr ite an exi sting file .
  7608                      
  7609       </param>
  7610               
  7611      </member>
  7612              
  7613      <member 
  7614       name="M:Io nic.Zip.Zi pEntry.Ext ract(Syste m.IO.Strea m)"
  7615      >
  7616                     
  7617       <summary>
  7618                        Extra cts the en try to the  specified  stream.
  7619                      
  7620       </summary>
  7621                    
  7622                     
  7623       <remarks>
  7624                      
  7625        <para>
  7626                         The c aller can  specify an y write-ab le stream,  for examp le a 
  7627         <see 
  7628          cref="T:Sy stem.IO.Fi leStream"
  7629         />
  7630         , a 
  7631         <see 
  7632          cref="T:Sy stem.IO.Me moryStream "
  7633         />
  7634         , or ASP.N ET's
  7635                         
  7636         <c>
  7637          Response.O utputStrea m
  7638         </c>
  7639         .  The con tent will  be decrypt ed and
  7640                         decom pressed as  necessary . If the e ntry is en crypted an d no passw ord
  7641                         is pr ovided, th is method  will throw .
  7642                       
  7643        </para>
  7644                      
  7645        <para>
  7646                         The p osition on  the strea m is not r eset by th is method  before it  extracts.
  7647                         You m ay want to  call stre am.Seek()  before cal ling ZipEn try.Extrac t().
  7648                       
  7649        </para>
  7650                      
  7651       </remarks>
  7652                    
  7653                     
  7654       <param 
  7655        name="stre am"
  7656       >
  7657                        the s tream to w hich the e ntry shoul d be extra cted.
  7658                      
  7659       </param>
  7660                    
  7661               
  7662      </member>
  7663              
  7664      <member 
  7665       name="M:Io nic.Zip.Zi pEntry.Ext ract(Syste m.String)"
  7666      >
  7667                     
  7668       <summary>
  7669                        Extra ct the ent ry to the  filesystem , starting  at the sp ecified ba se
  7670                        direc tory.
  7671                      
  7672       </summary>
  7673                    
  7674                     
  7675       <param 
  7676        name="base Directory"
  7677       >
  7678        the pathna me of the  base direc tory
  7679       </param>
  7680                    
  7681                     
  7682       <seealso 
  7683        cref="P:Io nic.Zip.Zi pEntry.Ext ractExisti ngFile"
  7684       />
  7685                     
  7686       <seealso 
  7687        cref="M:Io nic.Zip.Zi pEntry.Ext ract(Syste m.String,I onic.Zip.E xtractExis tingFileAc tion)"
  7688       />
  7689                    
  7690                     
  7691       <example>
  7692                      This ex ample extr acts only  the entrie s in a zip  file that  are .txt  files,
  7693                      into a  directory  called "te xtfiles".
  7694                      
  7695        <code 
  7696         lang="C#"
  7697        >
  7698                       using ( ZipFile zi p = ZipFil e.Read("Pa ckedDocume nts.zip"))
  7699                       {
  7700                         forea ch (string  s1 in zip .EntryFile names)
  7701                         {
  7702                           if  (s1.EndsWi th(".txt") )
  7703                           {
  7704                             z ip[s1].Ext ract("text files");
  7705                           }
  7706                         }
  7707                       }
  7708                       
  7709        </code>
  7710                      
  7711        <code 
  7712         lang="VB"
  7713        >
  7714                         Using  zip As Zi pFile = Zi pFile.Read ("PackedDo cuments.zi p")
  7715                             D im s1 As S tring
  7716                             F or Each s1  In zip.En tryFilenam es
  7717                                  If s1.E ndsWith(". txt") Then
  7718                                      zip (s1).Extra ct("textfi les")
  7719                                  End If
  7720                             N ext
  7721                         End U sing
  7722                       
  7723        </code>
  7724                      
  7725       </example>
  7726                    
  7727                     
  7728       <remarks>
  7729                     
  7730                      
  7731        <para>
  7732                         Using  this meth od, existi ng entries  in the fi lesystem w ill not be
  7733                         overw ritten. If  you would  like to f orce the o verwrite o f existing
  7734                         files , see the 
  7735         <see 
  7736          cref="P:Io nic.Zip.Zi pEntry.Ext ractExisti ngFile"
  7737         />
  7738          property,  or call
  7739                         
  7740         <see 
  7741          cref="M:Io nic.Zip.Zi pEntry.Ext ract(Syste m.String,I onic.Zip.E xtractExis tingFileAc tion)"
  7742         />
  7743         .
  7744                       
  7745        </para>
  7746                     
  7747                      
  7748        <para>
  7749                         See t he remarks  on the 
  7750         <see 
  7751          cref="P:Io nic.Zip.Zi pEntry.Las tModified"
  7752         />
  7753          property,  for some
  7754                         detai ls about h ow the las t modified  time of t he created  file is s et.
  7755                       
  7756        </para>
  7757                      
  7758       </remarks>
  7759               
  7760      </member>
  7761              
  7762      <member 
  7763       name="M:Io nic.Zip.Zi pEntry.Ext ract(Syste m.String,I onic.Zip.E xtractExis tingFileAc tion)"
  7764      >
  7765                     
  7766       <summary>
  7767                        Extra ct the ent ry to the  filesystem , starting  at the sp ecified ba se
  7768                        direc tory, and  using the  specified  behavior w hen extrac tion would
  7769                        overw rite an ex isting fil e.
  7770                      
  7771       </summary>
  7772                    
  7773                     
  7774       <remarks>
  7775                      
  7776        <para>
  7777                         See t he remarks  on the 
  7778         <see 
  7779          cref="P:Io nic.Zip.Zi pEntry.Las tModified"
  7780         />
  7781          property,  for some
  7782                         detai ls about h ow the las t modified  time of t he created  file is s et.
  7783                       
  7784        </para>
  7785                      
  7786       </remarks>
  7787                    
  7788                     
  7789       <example>
  7790                      
  7791        <code 
  7792         lang="C#"
  7793        >
  7794                       String  sZipPath =  "Airborne .zip";
  7795                       String  sFilePath  = "Readme. txt";
  7796                       String  sRootFolde r = "Digad o";
  7797                       using ( ZipFile zi p = ZipFil e.Read(sZi pPath))
  7798                       {
  7799                         if (z ip.EntryFi leNames.Co ntains(sFi lePath))
  7800                         {
  7801                           //  use the st ring index er on the  zip file
  7802                           zip [sFileName ].Extract( sRootFolde r,
  7803                                                     ExtractExi stingFileA ction.Over writeSilen tly);
  7804                         }
  7805                       }
  7806                       
  7807        </code>
  7808                     
  7809                      
  7810        <code 
  7811         lang="VB"
  7812        >
  7813                       Dim sZi pPath as S tring = "A irborne.zi p"
  7814                       Dim sFi lePath As  String = " Readme.txt "
  7815                       Dim sRo otFolder A s String =  "Digado"
  7816                       Using z ip As ZipF ile = ZipF ile.Read(s ZipPath)
  7817                         If zi p.EntryFil eNames.Con tains(sFil ePath)
  7818                           ' u se the str ing indexe r on the z ip file
  7819                           zip (sFilePath ).Extract( sRootFolde r, _
  7820                                                     ExtractExi stingFileA ction.Over writeSilen tly)
  7821                         End I f
  7822                       End Usi ng
  7823                       
  7824        </code>
  7825                      
  7826       </example>
  7827                    
  7828                     
  7829       <param 
  7830        name="base Directory"
  7831       >
  7832        the pathna me of the  base direc tory
  7833       </param>
  7834                     
  7835       <param 
  7836        name="extr actExistin gFile"
  7837       >
  7838                      The act ion to tak e if extra ction woul d overwrit e an exist ing file.
  7839                      
  7840       </param>
  7841               
  7842      </member>
  7843              
  7844      <member 
  7845       name="M:Io nic.Zip.Zi pEntry.Ext ractWithPa ssword(Sys tem.String )"
  7846      >
  7847                     
  7848       <summary>
  7849                        Extra ct the ent ry to the  filesystem , using th e current  working di rectory
  7850                        and t he specifi ed passwor d.
  7851                      
  7852       </summary>
  7853                    
  7854                     
  7855       <overloads >
  7856                        This  method has  a bunch o f overload s! One of  them is su re to be
  7857                        the r ight one f or you...
  7858                      
  7859       </overload s>
  7860                    
  7861                     
  7862       <seealso 
  7863        cref="P:Io nic.Zip.Zi pEntry.Ext ractExisti ngFile"
  7864       />
  7865                     
  7866       <seealso 
  7867        cref="M:Io nic.Zip.Zi pEntry.Ext ractWithPa ssword(Ion ic.Zip.Ext ractExisti ngFileActi on,System. String)"
  7868       />
  7869                    
  7870                     
  7871       <remarks>
  7872                     
  7873                      
  7874        <para>
  7875                         Exist ing entrie s in the f ilesystem  will not b e overwrit ten. If yo u
  7876                         would  like to f orce the o verwrite o f existing  files, se e the 
  7877         <see 
  7878          cref="P:Io nic.Zip.Zi pEntry.Ext ractExisti ngFile"
  7879         />
  7880         property,  or call
  7881                         
  7882         <see 
  7883          cref="M:Io nic.Zip.Zi pEntry.Ext ractWithPa ssword(Ion ic.Zip.Ext ractExisti ngFileActi on,System. String)"
  7884         />
  7885         .
  7886                       
  7887        </para>
  7888                     
  7889                      
  7890        <para>
  7891                         See t he remarks  on the 
  7892         <see 
  7893          cref="P:Io nic.Zip.Zi pEntry.Las tModified"
  7894         />
  7895          property  for some
  7896                         detai ls about h ow the "la st modifie d" time of  the creat ed file is
  7897                         set.
  7898                       
  7899        </para>
  7900                      
  7901       </remarks>
  7902                    
  7903                     
  7904       <example>
  7905                        In th is example , entries  that use e ncryption  are extrac ted using  a
  7906                        parti cular pass word.
  7907                      
  7908        <code>
  7909                       using ( var zip =  ZipFile.Re ad(FilePat h))
  7910                       {
  7911                           for each (ZipE ntry e in  zip)
  7912                           {
  7913                                if (e.Use sEncryptio n)
  7914                                    e.Ext ractWithPa ssword("Se cret!");
  7915                                else
  7916                                    e.Ext ract();
  7917                           }
  7918                       }
  7919                       
  7920        </code>
  7921                      
  7922        <code 
  7923         lang="VB"
  7924        >
  7925                       Using z ip As ZipF ile = ZipF ile.Read(F ilePath)
  7926                           Dim  e As ZipE ntry
  7927                           For  Each e In  zip
  7928                                If (e.Use sEncryptio n)
  7929                                  e.Extra ctWithPass word("Secr et!")
  7930                                Else
  7931                                  e.Extra ct
  7932                                End If
  7933                           Nex t
  7934                       End Usi ng
  7935                       
  7936        </code>
  7937                      
  7938       </example>
  7939                     
  7940       <param 
  7941        name="pass word"
  7942       >
  7943        The Passwo rd to use  for decryp ting the e ntry.
  7944       </param>
  7945               
  7946      </member>
  7947              
  7948      <member 
  7949       name="M:Io nic.Zip.Zi pEntry.Ext ractWithPa ssword(Sys tem.String ,System.St ring)"
  7950      >
  7951                     
  7952       <summary>
  7953                        Extra ct the ent ry to the  filesystem , starting  at the sp ecified ba se
  7954                        direc tory, and  using the  specified  password.
  7955                      
  7956       </summary>
  7957                    
  7958                     
  7959       <seealso 
  7960        cref="P:Io nic.Zip.Zi pEntry.Ext ractExisti ngFile"
  7961       />
  7962                     
  7963       <seealso 
  7964        cref="M:Io nic.Zip.Zi pEntry.Ext ractWithPa ssword(Sys tem.String ,Ionic.Zip .ExtractEx istingFile Action,Sys tem.String )"
  7965       />
  7966                    
  7967                     
  7968       <remarks>
  7969                      
  7970        <para>
  7971                         Exist ing entrie s in the f ilesystem  will not b e overwrit ten. If yo u
  7972                         would  like to f orce the o verwrite o f existing  files, se e the 
  7973         <see 
  7974          cref="P:Io nic.Zip.Zi pEntry.Ext ractExisti ngFile"
  7975         />
  7976         property,  or call
  7977                         
  7978         <see 
  7979          cref="M:Io nic.Zip.Zi pEntry.Ext ractWithPa ssword(Ion ic.Zip.Ext ractExisti ngFileActi on,System. String)"
  7980         />
  7981         .
  7982                       
  7983        </para>
  7984                     
  7985                      
  7986        <para>
  7987                         See t he remarks  on the 
  7988         <see 
  7989          cref="P:Io nic.Zip.Zi pEntry.Las tModified"
  7990         />
  7991          property,  for some
  7992                         detai ls about h ow the las t modified  time of t he created  file is s et.
  7993                       
  7994        </para>
  7995                      
  7996       </remarks>
  7997                    
  7998                     
  7999       <param 
  8000        name="base Directory"
  8001       >
  8002        The pathna me of the  base direc tory.
  8003       </param>
  8004                     
  8005       <param 
  8006        name="pass word"
  8007       >
  8008        The Passwo rd to use  for decryp ting the e ntry.
  8009       </param>
  8010               
  8011      </member>
  8012              
  8013      <member 
  8014       name="M:Io nic.Zip.Zi pEntry.Ext ractWithPa ssword(Ion ic.Zip.Ext ractExisti ngFileActi on,System. String)"
  8015      >
  8016                     
  8017       <summary>
  8018                        Extra ct the ent ry to a fi le in the  filesystem , relative  to the
  8019                        curre nt directo ry, using  the specif ied behavi or when ex traction
  8020                        would  overwrite  an existi ng file.
  8021                      
  8022       </summary>
  8023                    
  8024                     
  8025       <remarks>
  8026                      
  8027        <para>
  8028                         See t he remarks  on the 
  8029         <see 
  8030          cref="P:Io nic.Zip.Zi pEntry.Las tModified"
  8031         />
  8032          property,  for some
  8033                         detai ls about h ow the las t modified  time of t he created  file is s et.
  8034                       
  8035        </para>
  8036                      
  8037       </remarks>
  8038                    
  8039                     
  8040       <param 
  8041        name="pass word"
  8042       >
  8043        The Passwo rd to use  for decryp ting the e ntry.
  8044       </param>
  8045                    
  8046                     
  8047       <param 
  8048        name="extr actExistin gFile"
  8049       >
  8050                      The act ion to tak e if extra ction woul d overwrit e an exist ing file.
  8051                      
  8052       </param>
  8053               
  8054      </member>
  8055              
  8056      <member 
  8057       name="M:Io nic.Zip.Zi pEntry.Ext ractWithPa ssword(Sys tem.String ,Ionic.Zip .ExtractEx istingFile Action,Sys tem.String )"
  8058      >
  8059                     
  8060       <summary>
  8061                        Extra ct the ent ry to the  filesystem , starting  at the sp ecified ba se
  8062                        direc tory, and  using the  specified  behavior w hen extrac tion would
  8063                        overw rite an ex isting fil e.
  8064                      
  8065       </summary>
  8066                    
  8067                     
  8068       <remarks>
  8069                        See t he remarks  on the 
  8070        <see 
  8071         cref="P:Io nic.Zip.Zi pEntry.Las tModified"
  8072        />
  8073         property,  for some
  8074                        detai ls about h ow the las t modified  time of t he created  file is s et.
  8075                      
  8076       </remarks>
  8077                    
  8078                     
  8079       <param 
  8080        name="base Directory"
  8081       >
  8082        the pathna me of the  base direc tory
  8083       </param>
  8084                    
  8085                     
  8086       <param 
  8087        name="extr actExistin gFile"
  8088       >
  8089        The action  to take i f extracti on would
  8090                      overwri te an exis ting file.
  8091       </param>
  8092                    
  8093                     
  8094       <param 
  8095        name="pass word"
  8096       >
  8097        The Passwo rd to use  for decryp ting the e ntry.
  8098       </param>
  8099               
  8100      </member>
  8101              
  8102      <member 
  8103       name="M:Io nic.Zip.Zi pEntry.Ext ractWithPa ssword(Sys tem.IO.Str eam,System .String)"
  8104      >
  8105                     
  8106       <summary>
  8107                        Extra cts the en try to the  specified  stream, u sing the s pecified
  8108                        Passw ord.  For  example, t he caller  could extr act to Con sole.Out,  or
  8109                        to a  MemoryStre am.
  8110                      
  8111       </summary>
  8112                    
  8113                     
  8114       <remarks>
  8115                      
  8116        <para>
  8117                         The c aller can  specify an y write-ab le stream,  for examp le a 
  8118         <see 
  8119          cref="T:Sy stem.IO.Fi leStream"
  8120         />
  8121         , a 
  8122         <see 
  8123          cref="T:Sy stem.IO.Me moryStream "
  8124         />
  8125         , or ASP.N ET's
  8126                         
  8127         <c>
  8128          Response.O utputStrea m
  8129         </c>
  8130         .  The con tent will  be decrypt ed and
  8131                         decom pressed as  necessary . If the e ntry is en crypted an d no passw ord
  8132                         is pr ovided, th is method  will throw .
  8133                       
  8134        </para>
  8135                      
  8136        <para>
  8137                         The p osition on  the strea m is not r eset by th is method  before it  extracts.
  8138                         You m ay want to  call stre am.Seek()  before cal ling ZipEn try.Extrac t().
  8139                       
  8140        </para>
  8141                      
  8142       </remarks>
  8143                    
  8144                    
  8145                     
  8146       <param 
  8147        name="stre am"
  8148       >
  8149                        the s tream to w hich the e ntry shoul d be extra cted.
  8150                      
  8151       </param>
  8152                     
  8153       <param 
  8154        name="pass word"
  8155       >
  8156                        The p assword to  use for d ecrypting  the entry.
  8157                      
  8158       </param>
  8159               
  8160      </member>
  8161              
  8162      <member 
  8163       name="M:Io nic.Zip.Zi pEntry.Ope nReader"
  8164      >
  8165                     
  8166       <summary>
  8167                        Opens  a readabl e stream c orrespondi ng to the  zip entry  in the
  8168                        archi ve.  The s tream deco mpresses a nd decrypt s as neces sary, as i t
  8169                        is re ad.
  8170                      
  8171       </summary>
  8172                    
  8173                     
  8174       <remarks>
  8175                     
  8176                      
  8177        <para>
  8178                         DotNe tZip offer s a variet y of ways  to extract  entries f rom a zip
  8179                         file.   This met hod allows  an applic ation to e xtract an  entry by
  8180                         readi ng a 
  8181         <see 
  8182          cref="T:Sy stem.IO.St ream"
  8183         />
  8184         .
  8185                       
  8186        </para>
  8187                     
  8188                      
  8189        <para>
  8190                         The r eturn valu e is of ty pe 
  8191         <see 
  8192          cref="T:Io nic.Crc.Cr cCalculato rStream"
  8193         />
  8194         .  Use it  as you wou ld any
  8195                         strea m for read ing.  When  an applic ation call
  8196         <see 
  8197          cref="M:Sy stem.IO.St ream.Read( System.Byt e[],System .Int32,Sys tem.Int32) "
  8198         />
  8199          on that s tream, it  will
  8200                         recei ve data fr om the zip  entry tha t is decry pted and d ecompresse d
  8201                         as ne cessary.
  8202                       
  8203        </para>
  8204                     
  8205                      
  8206        <para>
  8207                         
  8208         <c>
  8209          CrcCalcula torStream
  8210         </c>
  8211          adds one  additional  feature:  it keeps a
  8212                         CRC32  checksum  on the byt es of the  stream as  it is read .  The CRC
  8213                         value  is availa ble in the  
  8214         <see 
  8215          cref="P:Io nic.Crc.Cr cCalculato rStream.Cr c"
  8216         />
  8217          property  on the
  8218                         
  8219         <c>
  8220          CrcCalcula torStream
  8221         </c>
  8222         .  When th e read is  complete,  your
  8223                         appli cation
  8224                         
  8225         <em>
  8226          should
  8227         </em>
  8228          check thi s CRC agai nst the 
  8229         <see 
  8230          cref="P:Io nic.Zip.Zi pEntry.Crc "
  8231         />
  8232                         prope rty on the  
  8233         <c>
  8234          ZipEntry
  8235         </c>
  8236          to valida te the con tent of th e
  8237                         ZipEn try. You d on't have  to validat e the entr y using th e CRC, but
  8238                         you s hould, to  verify int egrity. Ch eck the ex ample for  how to do
  8239                         this.
  8240                       
  8241        </para>
  8242                     
  8243                      
  8244        <para>
  8245                         If th e entry is  protected  with a pa ssword, th en you nee d to provi de
  8246                         a pas sword prio r to calli ng 
  8247         <see 
  8248          cref="M:Io nic.Zip.Zi pEntry.Ope nReader"
  8249         />
  8250         , either b y
  8251                         setti ng the 
  8252         <see 
  8253          cref="P:Io nic.Zip.Zi pEntry.Pas sword"
  8254         />
  8255          property  on the ent ry, or the
  8256                         
  8257         <see 
  8258          cref="P:Io nic.Zip.Zi pFile.Pass word"
  8259         />
  8260          property  on the 
  8261         <c>
  8262          ZipFile
  8263         </c>
  8264                         itsel f. Or, you  can use 
  8265         <see 
  8266          cref="M:Io nic.Zip.Zi pEntry.Ope nReader(Sy stem.Strin g)"
  8267         />
  8268         , the
  8269                         overl oad of Ope nReader th at accepts  a passwor d paramete r.
  8270                       
  8271        </para>
  8272                     
  8273                      
  8274        <para>
  8275                         If yo u want to  extract en try data i nto a writ e-able str eam that i s
  8276                         alrea dy opened,  like a 
  8277         <see 
  8278          cref="T:Sy stem.IO.Fi leStream"
  8279         />
  8280         , do not
  8281                         use t his method . Instead,  use 
  8282         <see 
  8283          cref="M:Io nic.Zip.Zi pEntry.Ext ract(Syste m.IO.Strea m)"
  8284         />
  8285         .
  8286                       
  8287        </para>
  8288                     
  8289                      
  8290        <para>
  8291                         Your  applicatio n may use  only one s tream crea ted by Ope nReader()  at
  8292                         a tim e, and you  should no t call oth er Extract  methods b efore
  8293                         compl eting your  reads on  a stream o btained fr om OpenRea der().  Th is
  8294                         is be cause ther e is reall y only one  source st ream for t he compres sed
  8295                         conte nt.  A cal l to OpenR eader() se eks in the  source st ream, to t he
  8296                         begin ning of th e compress ed content .  A subse quent call  to
  8297                         OpenR eader() on  a differe nt entry w ill seek t o a differ ent positi on
  8298                         in th e source s tream, as  will a cal l to Extra ct() or on e of its
  8299                         overl oads.  Thi s will cor rupt the s tate for t he decompr essing str eam
  8300                         from  the origin al call to  OpenReade r().
  8301                       
  8302        </para>
  8303                     
  8304                      
  8305        <para>
  8306                          The 
  8307         <c>
  8308          OpenReader ()
  8309         </c>
  8310          method wo rks only w hen the Zi pEntry is
  8311                          obta ined from  an instanc e of 
  8312         <c>
  8313          ZipFile
  8314         </c>
  8315         . This met hod will t hrow
  8316                          an e xception i f the ZipE ntry is ob tained fro m a 
  8317         <see 
  8318          cref="T:Io nic.Zip.Zi pInputStre am"
  8319         />
  8320         .
  8321                       
  8322        </para>
  8323                      
  8324       </remarks>
  8325                    
  8326                     
  8327       <example>
  8328                        This  example sh ows how to  open a zi p archive,  then read  in a name d
  8329                        entry  via a str eam. After  the read  loop is co mplete, th e code
  8330                        compa res the ca lculated d uring the  read loop  with the e xpected CR C
  8331                        on th
  8332        <c>
  8333         ZipEntry
  8334        </c>
  8335        , to verif y the extr action.
  8336                      
  8337        <code>
  8338                       using ( ZipFile zi p = new Zi pFile(ZipF ileToRead) )
  8339                       {
  8340                         ZipEn try e1= zi p["Elevati on.mp3"];
  8341                         using  (Ionic.Zl ib.CrcCalc ulatorStre am s = e1. OpenReader ())
  8342                         {
  8343                           byt e[] buffer  = new byt e[4096];
  8344                           int  n, totalB ytesRead=  0;
  8345                           do  {
  8346                             n  = s.Read( buffer,0,  buffer.Len gth);
  8347                             t otalBytesR ead+=n;
  8348                           } w hile (n&gt ;0);
  8349                            if  (s.Crc32  != e1.Crc3 2)
  8350                             t hrow new E xception(s tring.Form at("The Zi p Entry fa iled the C RC Check.  (0x{0:X8}! =0x{1:X8}) ", s.Crc32 , e1.Crc32 ));
  8351                            if  (totalByt esRead !=  e1.Uncompr essedSize)
  8352                             t hrow new E xception(s tring.Form at("We rea d an unexp ected numb er of byte s. ({0}!={ 1})", tota lBytesRead , e1.Uncom pressedSiz e));
  8353                         }
  8354                       }
  8355                       
  8356        </code>
  8357                      
  8358        <code 
  8359         lang="VB"
  8360        >
  8361                         Using  zip As Ne w ZipFile( ZipFileToR ead)
  8362                             D im e1 As Z ipEntry =  zip.Item(" Elevation. mp3")
  8363                             U sing s As  Ionic.Zlib .CrcCalcul atorStream  = e1.Open Reader
  8364                                  Dim n A s Integer
  8365                                  Dim buf fer As Byt e() = New  Byte(4096)  {}
  8366                                  Dim tot alBytesRea d As Integ er = 0
  8367                                  Do
  8368                                      n =  s.Read(bu ffer, 0, b uffer.Leng th)
  8369                                      tot alBytesRea d = (total BytesRead  + n)
  8370                                  Loop Wh ile (n &gt ; 0)
  8371                                  If (s.C rc32 &lt;& gt; e1.Crc 32) Then
  8372                                      Thr ow New Exc eption(Str ing.Format ("The Zip  Entry fail ed the CRC  Check. (0 x{0:X8}!=0 x{1:X8})",  s.Crc32,  e1.Crc32))
  8373                                  End If
  8374                                  If (tot alBytesRea d &lt;&gt;  e1.Uncomp ressedSize ) Then
  8375                                      Thr ow New Exc eption(Str ing.Format ("We read  an unexpec ted number  of bytes.  ({0}!={1} )", totalB ytesRead,  e1.Uncompr essedSize) )
  8376                                  End If
  8377                             E nd Using
  8378                         End U sing
  8379                       
  8380        </code>
  8381                      
  8382       </example>
  8383                     
  8384       <seealso 
  8385        cref="M:Io nic.Zip.Zi pEntry.Ext ract(Syste m.IO.Strea m)"
  8386       />
  8387                     
  8388       <returns>
  8389        The Stream  for readi ng.
  8390       </returns>
  8391               
  8392      </member>
  8393              
  8394      <member 
  8395       name="M:Io nic.Zip.Zi pEntry.Ope nReader(Sy stem.Strin g)"
  8396      >
  8397                     
  8398       <summary>
  8399                        Opens  a readabl e stream f or an encr ypted zip  entry in t he archive .
  8400                        The s tream deco mpresses a nd decrypt s as neces sary, as i t is read.
  8401                      
  8402       </summary>
  8403                    
  8404                     
  8405       <remarks>
  8406                      
  8407        <para>
  8408                         See t he documen tation on  the 
  8409         <see 
  8410          cref="M:Io nic.Zip.Zi pEntry.Ope nReader"
  8411         />
  8412          method fo r
  8413                         full  details. T his overlo ad allows  the applic ation to s pecify a
  8414                         passw ord for th
  8415         <c>
  8416          ZipEntry
  8417         </c>
  8418          to be rea d.
  8419                       
  8420        </para>
  8421                      
  8422       </remarks>
  8423                    
  8424                     
  8425       <param 
  8426        name="pass word"
  8427       >
  8428        The passwo rd to use  for decryp ting the e ntry.
  8429       </param>
  8430                     
  8431       <returns>
  8432        The Stream  for readi ng.
  8433       </returns>
  8434               
  8435      </member>
  8436              
  8437      <member 
  8438       name="M:Io nic.Zip.Zi pEntry.Int ernalExtra ctToBaseDi r(System.S tring,Syst em.String, Ionic.Zip. ZipContain er,Ionic.Z ip.ZipEntr ySource,Sy stem.Strin g)"
  8439      >
  8440                    
  8441       <summary>
  8442                     Pass in  either bas edir or s,  but not b oth.
  8443                     In other  words, yo u can extr act to a s tream or t o a direct ory (files ystem), bu t not both !
  8444                     The Pass word param  is requir ed for enc rypted ent ries.
  8445                     
  8446       </summary>
  8447               
  8448      </member>
  8449              
  8450      <member 
  8451       name="M:Io nic.Zip.Zi pEntry.Int ernalExtra ctToStream (System.IO .Stream,Sy stem.Strin g,Ionic.Zi p.ZipConta iner,Ionic .Zip.ZipEn trySource, System.Str ing)"
  8452      >
  8453                    
  8454       <summary>
  8455                     Extract  to a strea m
  8456                     In other  words, yo u can extr act to a s tream or t o a direct ory (files ystem), bu t not both !
  8457                     The Pass word param  is requir ed for enc rypted ent ries.
  8458                     
  8459       </summary>
  8460               
  8461      </member>
  8462              
  8463      <member 
  8464       name="M:Io nic.Zip.Zi pEntry.IsD oneWithOut putToBaseD ir(System. String,Sys tem.String @)"
  8465      >
  8466                    
  8467       <summary>
  8468                     Validate s that the  args are  consistent ; returnin g whether  the caller  can retur n
  8469                     because  it's done,  or not (c aller shou ld continu e)
  8470                     
  8471       </summary>
  8472               
  8473      </member>
  8474              
  8475      <member 
  8476       name="M:Io nic.Zip.Zi pEntry.IsD oneWithOut putToStrea m"
  8477      >
  8478                    
  8479       <summary>
  8480                     Validate s that the  args are  consistent ; returnin g whether  the caller  can retur n
  8481                     because  it's done,  or not (c aller shou ld continu e)
  8482                     
  8483       </summary>
  8484               
  8485      </member>
  8486              
  8487      <member 
  8488       name="M:Io nic.Zip.Zi pEntry.Rea dEntry(Ion ic.Zip.Zip Container, System.Boo lean)"
  8489      >
  8490                    
  8491       <summary>
  8492                       Reads  one 
  8493        <c>
  8494         ZipEntry
  8495        </c>
  8496         from the  given stre am.  The c ontent for
  8497                       the en try does n ot get dec ompressed  or decrypt ed.  This  method
  8498                       basica lly reads  metadata,  and seeks.
  8499                     
  8500       </summary>
  8501                    
  8502       <param 
  8503        name="zc"
  8504       >
  8505        the ZipCon tainer thi s entry be longs to.
  8506       </param>
  8507                    
  8508       <param 
  8509        name="firs t"
  8510       >
  8511                       true o f this is  the first  entry bein g read fro m the stre am.
  8512                     
  8513       </param>
  8514                    
  8515       <returns>
  8516        the 
  8517        <c>
  8518         ZipEntry
  8519        </c>
  8520         read from  the strea m.
  8521       </returns>
  8522               
  8523      </member>
  8524              
  8525      <member 
  8526       name="M:Io nic.Zip.Zi pEntry.Fin dExtraFiel dSegment(S ystem.Byte [],System. Int32,Syst em.UInt16) "
  8527      >
  8528                    
  8529       <summary>
  8530                       Finds  a particul ar segment  in the gi ven extra  field.
  8531                       This i s used whe n modifyin g a previo usly-gener ated
  8532                       extra  field, in  particular  when remo ving the A ES crypto
  8533                       segmen t in the e xtra field .
  8534                     
  8535       </summary>
  8536               
  8537      </member>
  8538              
  8539      <member 
  8540       name="M:Io nic.Zip.Zi pEntry.Pro cessExtraF ield(Syste m.IO.Strea m,System.I nt16)"
  8541      >
  8542                    
  8543       <summary>
  8544                       At cur rent curso r position  in the st ream, read  the extra
  8545                       field,  and set t he propert ies on the  ZipEntry  instance
  8546                       approp riately.   This can b e called w hen proces sing the
  8547                       Extra  field in t he Central  Directory , or in th e local
  8548                       header .
  8549                     
  8550       </summary>
  8551               
  8552      </member>
  8553              
  8554      <member 
  8555       name="M:Io nic.Zip.Zi pEntry.Get EncodedFil eNameBytes "
  8556      >
  8557                    
  8558       <summary>
  8559                       genera te and ret urn a byte  array tha t encodes  the filena me
  8560                       for th e entry.
  8561                     
  8562       </summary>
  8563                    
  8564       <remarks>
  8565                       
  8566        <para>
  8567                          side  effects:  generate a nd store i nto _Comme ntBytes th e
  8568                          byte  array for  any comme nt attache d to the e ntry. Also
  8569                          sets  _actualEn coding to  indicate t he actual  encoding
  8570                          used . The same  encoding  is used fo r both fil ename and
  8571                          comm ent.
  8572                        
  8573        </para>
  8574                     
  8575       </remarks>
  8576               
  8577      </member>
  8578              
  8579      <member 
  8580       name="M:Io nic.Zip.Zi pEntry.Pre pSourceStr eam"
  8581      >
  8582                     
  8583       <summary>
  8584                        Store s the posi tion of th e entry so urce strea m, or, if  the positi on is
  8585                        alrea dy stored,  seeks to  that posit ion.
  8586                      
  8587       </summary>
  8588                    
  8589                     
  8590       <remarks>
  8591                      
  8592        <para>
  8593                         This  method is  called in  prep for r eading the  source st ream.  If  PKZIP
  8594                         encry ption is u sed, then  we need to  calc the  CRC32 befo re doing t he
  8595                         encry ption, bec ause the C RC is used  in the 12 th byte of  the PKZIP
  8596                         encry ption head er.  So, w e need to  be able to  seek back ward in th e source
  8597                         when  saving the  ZipEntry.  This meth od is call ed from th e place th at
  8598                         calcu lates the  CRC, and a lso from t he method  that does  the encryp tion of
  8599                         the f ile data.
  8600                       
  8601        </para>
  8602                     
  8603                      
  8604        <para>
  8605                         The f irst time  through, t his method  sets the  _sourceStr eamOrigina lPosition
  8606                         field . Subseque nt calls t o this met hod seek t o that pos ition.
  8607                       
  8608        </para>
  8609                      
  8610       </remarks>
  8611               
  8612      </member>
  8613              
  8614      <member 
  8615       name="M:Io nic.Zip.Zi pEntry.Cop yMetaData( Ionic.Zip. ZipEntry)"
  8616      >
  8617                    
  8618       <summary>
  8619                     Copy met adata that  may have  been chang ed by the  app.  We d o this whe n
  8620                     resettin g the zipF ile instan ce.  If th e app call s Save() o n a ZipFil e, then
  8621                     tries to  party on  that file  some more,  we may ne ed to Rese t() it , w hich
  8622                     means re -reading t he entries  and then  copying th e metadata .  I think .
  8623                     
  8624       </summary>
  8625               
  8626      </member>
  8627              
  8628      <member 
  8629       name="M:Io nic.Zip.Zi pEntry.Set InputAndFi gureFileLe ngth(Syste m.IO.Strea m@)"
  8630      >
  8631                    
  8632       <summary>
  8633                       Set th e input st ream and g et its len gth, if po ssible.  T he length  is
  8634                       used f or progres s updates,  AND, to a llow an op timization  in case o f
  8635                       a stre am/file of  zero leng th. In tha t case we  skip the E ncrypt and
  8636                       compre ssion Stre am. (like  DeflateStr eam or BZi p2OutputSt ream)
  8637                     
  8638       </summary>
  8639               
  8640      </member>
  8641              
  8642      <member 
  8643       name="M:Io nic.Zip.Zi pEntry.Pre pOutputStr eam(System .IO.Stream ,System.In t64,Ionic. Zip.Counti ngStream@, System.IO. Stream@,Sy stem.IO.St ream@,Ioni c.Crc.CrcC alculatorS tream@)"
  8644      >
  8645                    
  8646       <summary>
  8647                       Prepar e the give n stream f or output  - wrap it  in a Count ingStream,  and
  8648                       then i n a CRC st ream, and  an encrypt or and def lator as a ppropriate .
  8649                     
  8650       </summary>
  8651                    
  8652       <remarks>
  8653                       
  8654        <para>
  8655                          Prev iously thi s was used  in ZipEnt ry.Write() , but in a n effort t o
  8656                          intr oduce some  efficienc ies in tha t method I 've refact ored to pu t the
  8657                          code  inline.   This metho d still ge ts called  by ZipOutp utStream.
  8658                        
  8659        </para>
  8660                     
  8661       </remarks>
  8662               
  8663      </member>
  8664              
  8665      <member 
  8666       name="P:Io nic.Zip.Zi pEntry.Att ributesInd icateDirec tory"
  8667      >
  8668                    
  8669       <summary>
  8670                     True if  the refere nced entry  is a dire ctory.
  8671                     
  8672       </summary>
  8673               
  8674      </member>
  8675              
  8676      <member 
  8677       name="P:Io nic.Zip.Zi pEntry.Inf o"
  8678      >
  8679                    
  8680       <summary>
  8681                     Provides  a human-r eadable st ring with  informatio n about th e ZipEntry .
  8682                     
  8683       </summary>
  8684               
  8685      </member>
  8686              
  8687      <member 
  8688       name="P:Io nic.Zip.Zi pEntry.Las tModified"
  8689      >
  8690                     
  8691       <summary>
  8692                        The t ime and da te at whic h the file  indicated  by the 
  8693        <c>
  8694         ZipEntry
  8695        </c>
  8696         was
  8697                        last  modified.
  8698                      
  8699       </summary>
  8700                    
  8701                     
  8702       <remarks>
  8703                      
  8704        <para>
  8705                         The D otNetZip l ibrary set s the Last Modified v alue for a n entry, e qual to
  8706                         the L ast Modifi ed time of  the file  in the fil esystem.   If an entr y is
  8707                         added  from a st ream, the  library us es 
  8708         <c>
  8709          System.Dat eTime.Now
  8710         </c>
  8711          for this
  8712                         value , for the  given entr y.
  8713                       
  8714        </para>
  8715                     
  8716                      
  8717        <para>
  8718                         This  property a llows the  applicatio n to retri eve and po ssibly set  the
  8719                         LastM odified va lue on an  entry, to  an arbitra ry value.   
  8720         <see 
  8721          cref="T:Sy stem.DateT ime"
  8722         />
  8723          values wi th a 
  8724         <see 
  8725          cref="T:Sy stem.DateT imeKind"
  8726         />
  8727                         setti ng of 
  8728         <c>
  8729          DateTimeKi nd.Unspeci fied
  8730         </c>
  8731          are taken  to be exp ressed as
  8732                         
  8733         <c>
  8734          DateTimeKi nd.Local
  8735         </c>
  8736         .
  8737                       
  8738        </para>
  8739                     
  8740                      
  8741        <para>
  8742                         Be aw are that b ecause of  the way 
  8743         <see 
  8744          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  8745         >
  8746          PKWare's
  8747                          Zip s pecificati on
  8748         </see>
  8749          describes  how times  are store d in the z ip file,
  8750                         the f ull precis ion of the  
  8751         <c>
  8752          System.Dat eTime
  8753         </c>
  8754          datatype  is not sto red
  8755                         for t he last mo dified tim e when sav ing zip fi les.  For  more infor mation on
  8756                         how t imes are f ormatted,  see the PK Zip specif ication.
  8757                       
  8758        </para>
  8759                     
  8760                      
  8761        <para>
  8762                         The a ctual last  modified  time of a  file can b e stored i n multiple  ways in
  8763                         the z ip file, a nd they ar e not mutu ally exclu sive:
  8764                       
  8765        </para>
  8766                     
  8767                      
  8768        <list 
  8769         type="bull et"
  8770        >
  8771                         
  8772         <item>
  8773                            In  the so-cal led "DOS"  format, wh ich has a  2-second p recision.  Values
  8774                            are  rounded t o the near est even s econd. For  example,  if the tim e on the
  8775                            fil e is 12:34 :43, then  it will be  stored as  12:34:44.  This firs t value
  8776                            is  accessible  via the 
  8777          <c>
  8778           LastModifi ed
  8779          </c>
  8780           property.  This valu e is alway s
  8781                            pre sent in th e metadata  for each  zip entry.   In some  cases the  value is
  8782                            inv alid, or z ero.
  8783                          
  8784         </item>
  8785                      
  8786                         
  8787         <item>
  8788                            In  the so-cal led "Windo ws" or "NT FS" format , as an 8- byte integ er
  8789                            qua ntity expr essed as t he number  of 1/10 mi lliseconds  (in other  words
  8790                            the  number of  100 nanos econd unit s) since J anuary 1,  1601 (UTC) .  This
  8791                            for mat is how  Windows r epresents  file times .  This ti me is acce ssible
  8792                            via  the 
  8793          <c>
  8794           ModifiedTi me
  8795          </c>
  8796           property.
  8797                          
  8798         </item>
  8799                      
  8800                         
  8801         <item>
  8802                            In  the "Unix"  format, a  4-byte qu antity spe cifying th e number o f seconds  since
  8803                            Jan uary 1, 19 70 UTC.
  8804                          
  8805         </item>
  8806                      
  8807                         
  8808         <item>
  8809                            In  an older f ormat, now  deprecate d but stil l used by  some curre nt
  8810                            too ls. This f ormat is a lso a 4-by te quantit y specifyi ng the num ber of
  8811                            sec onds since  January 1 , 1970 UTC .
  8812                          
  8813         </item>
  8814                      
  8815                       
  8816        </list>
  8817                     
  8818                      
  8819        <para>
  8820                         Zip t ools and l ibraries w ill always  at least  handle (re ad or writ e) the
  8821                         DOS t ime, and m ay also ha ndle the o ther time  formats.   Keep in mi nd that
  8822                         while  the names  refer to  particular  operating  systems,  there is n othing in
  8823                         the t ime format s themselv es that pr events the ir use on  other oper ating
  8824                         syste ms.
  8825                       
  8826        </para>
  8827                     
  8828                      
  8829        <para>
  8830                         When  reading ZI P files, t he DotNetZ ip library  reads the  Windows-f ormatted
  8831                         time,  if it is  stored in  the entry,  and sets  both 
  8832         <c>
  8833          LastModifi ed
  8834         </c>
  8835          and
  8836                         
  8837         <c>
  8838          ModifiedTi me
  8839         </c>
  8840          to that v alue. When  writing Z IP files,  the DotNet Zip
  8841                         libra ry by defa ult will w rite both  time quant ities. It  can also e mit the
  8842                         Unix- formatted  time if de sired (See  
  8843         <see 
  8844          cref="P:Io nic.Zip.Zi pEntry.Emi tTimesInUn ixFormatWh enSaving"
  8845         />
  8846         .)
  8847                       
  8848        </para>
  8849                     
  8850                      
  8851        <para>
  8852                         The l ast modifi ed time of  the file  created up on a call  to
  8853                         
  8854         <c>
  8855          ZipEntry.E xtract()
  8856         </c>
  8857          may be ad justed dur ing extrac tion to co mpensate
  8858                         for d ifferences  in how th e .NET Bas e Class Li brary deal s with day light
  8859                         savin g time (DS T) versus  how the Wi ndows file system dea ls with da ylight
  8860                         savin g time.  R aymond Che
  8861         <see 
  8862          href="http ://blogs.m sdn.com/ol dnewthing/ archive/20 03/10/24/5 5413.aspx"
  8863         >
  8864          provides
  8865                          some  good conte xt
  8866         </see>
  8867         .
  8868                       
  8869        </para>
  8870                     
  8871                      
  8872        <para>
  8873                         In a  nutshell:  Daylight s avings tim e rules ch ange regul arly.  In  2007, for
  8874                         examp le, the in ception we ek of DST  changed.   In 1977, D ST was in  place all
  8875                         year  round. In  1945, like wise.  And  so on.  W in32 does  not attemp t to
  8876                         guess  which tim e zone rul es were in  effect at  the time  in questio n.  It
  8877                         will  render a t ime as "st andard tim e" and all ow the app  to change  to DST
  8878                         as ne cessary.   .NET makes  a differe nt choice.
  8879                       
  8880        </para>
  8881                     
  8882                      
  8883        <para>
  8884                         Compa re the out put of Fil eInfo.Last WriteTime. ToString(" f") with w hat you
  8885                         see i n the Wind ows Explor er propert y sheet fo r a file t hat was la st
  8886                         writt en to on t he other s ide of the  DST trans ition. For  example,  suppose
  8887                         the f ile was la st modifie d on Octob er 17, 200 3, during  DST but DS T is not
  8888                         curre ntly in ef fect. Expl orer's fil e properti es reports  Thursday,  October
  8889                         17, 2 003, 8:45: 38 AM, but  .NETs Fil eInfo repo rts Thursd ay, Octobe r 17,
  8890                         2003,  9:45 AM.
  8891                       
  8892        </para>
  8893                     
  8894                      
  8895        <para>
  8896                         Win32  says, "Th ursday, Oc tober 17,  2002 8:45: 38 AM PST" . Note: Pa cific
  8897                         STAND ARD Time.  Even thoug h October  17 of that  year occu rred durin g Pacific
  8898                         Dayli ght Time,  Win32 disp lays the t ime as sta ndard time  because t hat's
  8899                         what  time it is  NOW.
  8900                       
  8901        </para>
  8902                     
  8903                      
  8904        <para>
  8905                         .NET  BCL assume s that the  current D ST rules w ere in pla ce at the  time in
  8906                         quest ion.  So,  .NET says,  "Well, if  the rules  in effect  now were  also in
  8907                         effec t on Octob er 17, 200 3, then th at would b e daylight  time" so  it
  8908                         displ ays "Thurs day, Octob er 17, 200 3, 9:45 AM  PDT" - da ylight tim e.
  8909                       
  8910        </para>
  8911                     
  8912                      
  8913        <para>
  8914                         So .N ET gives a  value whi ch is more  intuitive ly correct , but is a lso
  8915                         poten tially inc orrect, an d which is  not inver tible. Win 32 gives a  value
  8916                         which  is intuit ively inco rrect, but  is strict ly correct .
  8917                       
  8918        </para>
  8919                     
  8920                      
  8921        <para>
  8922                         Becau se of this  funkiness , this lib rary adds  one hour t o the Last Modified
  8923                         time  on the ext racted fil e, if nece ssary.  Th at is to s ay, if the  time in
  8924                         quest ion had oc curred in  what the . NET Base C lass Libra ry assumed  to be
  8925                         DST.  This assum ption may  be wrong g iven the c onstantly  changing D ST rules,
  8926                         but i t is the b est we can  do.
  8927                       
  8928        </para>
  8929                     
  8930                      
  8931       </remarks>
  8932                    
  8933               
  8934      </member>
  8935              
  8936      <member 
  8937       name="P:Io nic.Zip.Zi pEntry.Mod ifiedTime"
  8938      >
  8939                     
  8940       <summary>
  8941                      Last Mo dified tim e for the  file repre sented by  the entry.
  8942                      
  8943       </summary>
  8944                    
  8945                     
  8946       <remarks>
  8947                     
  8948                      
  8949        <para>
  8950                         This  value corr esponds to  the "last  modified"  time in t he NTFS fi le times
  8951                         as de scribed in  
  8952         <see 
  8953          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  8954         >
  8955          the Zip
  8956                          speci fication
  8957         </see>
  8958         .  When ge tting this  property,  the value  may be
  8959                         diffe rent from 
  8960         <see 
  8961          cref="P:Io nic.Zip.Zi pEntry.Las tModified"
  8962         />
  8963         .  When se tting the  property,
  8964                         the 
  8965         <see 
  8966          cref="P:Io nic.Zip.Zi pEntry.Las tModified"
  8967         />
  8968          property  also gets  set, but w ith a lowe r
  8969                         preci sion.
  8970                       
  8971        </para>
  8972                     
  8973                      
  8974        <para>
  8975                         Let m e explain.  It's goin g to take  a while, s o get
  8976                         comfo rtable. Or iginally,  waaaaay ba ck in 1989  when the  ZIP specif ication
  8977                         was o riginally  described  by the est eemed Mr.  Phil Katz,  the domin ant
  8978                         opera ting syste m of the t ime was MS -DOS. MSDO S stored f ile times  with a
  8979                         2-sec ond precis ion, becau se, c'mon,  
  8980         <em>
  8981          who is eve r going to  need bett er
  8982                          resol ution than  THAT?
  8983         </em>
  8984          And so ZI P files, r egardless  of the pla tform on
  8985                         which  the zip f ile was cr eated, sto re file ti mes in exa ctly 
  8986         <see 
  8987          href="http ://www.vsf t.com/hal/ dostime.ht m"
  8988         >
  8989          the same f ormat that  DOS used
  8990                          in 19 89
  8991         </see>
  8992         .
  8993                       
  8994        </para>
  8995                     
  8996                      
  8997        <para>
  8998                         Since  then, the  ZIP spec  has evolve d, but the  internal  format for  file
  8999                         times tamps rema ins the sa me.  Despi te the fac t that the  way times  are
  9000                         store d in a zip  file is r ooted in D OS heritag e, any pro gram on an y
  9001                         opera ting syste m can form at a time  in this wa y, and mos t zip tool s and
  9002                         libra ries DO -  they round  file time s to the n earest eve n second a nd store
  9003                         it ju st like DO S did 25+  years ago.
  9004                       
  9005        </para>
  9006                     
  9007                      
  9008        <para>
  9009                         PKWar e extended  the ZIP s pecificati on to allo w a zip fi le to stor e what
  9010                         are c alled "NTF S Times" a nd "Unix(t m) times"  for a file .  These a re the
  9011                         
  9012         <em>
  9013          last write
  9014         </em>
  9015        
  9016         <em>
  9017          last acces s
  9018         </em>
  9019         , and 
  9020         <em>
  9021          file creat ion
  9022         </em>
  9023                         times  of a part icular fil e. These m etadata ar e not actu ally speci fic
  9024                         to NT FS or Unix . They are  tracked f or each fi le by NTFS  and by va rious
  9025                         Unix  filesystem s, but the y are also  tracked b y other fi lesystems,  too.
  9026                         The k ey point i s that the  times are  
  9027         <em>
  9028          formatted  in the zip  file
  9029         </em>
  9030                         in th e same way  that NTFS  formats t he time (t icks since  win32 epo ch),
  9031                         or in  the same  way that U nix format s the time  (seconds  since Unix
  9032                         epoch ). As with  the DOS t ime, any t ool or lib rary runni ng on any
  9033                         opera ting syste m is capab le of form atting a t ime in one  of these  ways
  9034                         and e mbedding i t into the  zip file.
  9035                       
  9036        </para>
  9037                     
  9038                      
  9039        <para>
  9040                         These  extended  times are  higher pre cision qua ntities th an the DOS  time.
  9041                         As de scribed ab ove, the ( DOS) LastM odified ha s a precis ion of 2 s econds.
  9042                         The U nix time i s stored w ith a prec ision of 1  second. T he NTFS ti me is
  9043                         store d with a p recision o f 0.000000 1 seconds.  The quant ities are  easily
  9044                         conve rtible, ex cept for t he loss of  precision  you may i ncur.
  9045                       
  9046        </para>
  9047                     
  9048                      
  9049        <para>
  9050                         A zip  archive c an store t he {C,A,M}  times in  NTFS forma t, in Unix  format,
  9051                         or no t at all.   Often a t ool runnin g on Unix  or Mac wil l embed th e times
  9052                         in Un ix format  (1 second  precision) , while Wi nZip runni ng on Wind ows might
  9053                         embed  the times  in NTFS f ormat (pre cision of  of 0.00000 01 seconds ).  When
  9054                         readi ng a zip f ile with t hese "exte nded" time s, in eith er format,
  9055                         DotNe tZip repre sents the  values wit h the
  9056                         
  9057         <c>
  9058          ModifiedTi me
  9059         </c>
  9060        
  9061         <c>
  9062          AccessedTi me
  9063         </c>
  9064          and 
  9065         <c>
  9066          CreationTi me
  9067         </c>
  9068                         prope rties on t he 
  9069         <c>
  9070          ZipEntry
  9071         </c>
  9072         .
  9073                       
  9074        </para>
  9075                     
  9076                      
  9077        <para>
  9078                         While  any zip a pplication  or librar y, regardl ess of the  platform  it
  9079                         runs  on, could  use any of  the time  formats al lowed by t he ZIP
  9080                         speci fication,  not all zi p tools or  libraries  do suppor t all thes e
  9081                         forma ts.  Stori ng the hig her-precis ion times  for each e ntry is
  9082                         optio nal for zi p files, a nd many to ols and li braries do n't use th e
  9083                         highe r precisio n quantiti es at all.  The old D OS time, r epresented  by
  9084                         
  9085         <see 
  9086          cref="P:Io nic.Zip.Zi pEntry.Las tModified"
  9087         />
  9088         , is guara nteed to b e present,  though it
  9089                         somet imes unset .
  9090                       
  9091        </para>
  9092                     
  9093                      
  9094        <para>
  9095                         Ok, g etting bac k to the q uestion ab out how th
  9096         <c>
  9097          LastModifi ed
  9098         </c>
  9099                         prope rty relate s to this 
  9100         <c>
  9101          ModifiedTi me
  9102         </c>
  9103                         prope rty... 
  9104         <c>
  9105          LastModifi ed
  9106         </c>
  9107          is always  set, whil e
  9108                         
  9109         <c>
  9110          ModifiedTi me
  9111         </c>
  9112          is not. ( The other  times stor ed in the 
  9113         <em>
  9114          NTFS
  9115                          times  extension
  9116         </em>
  9117        
  9118         <c>
  9119          CreationTi me
  9120         </c>
  9121          and 
  9122         <c>
  9123          AccessedTi me
  9124         </c>
  9125          also
  9126                         may n ot be set  on an entr y that is  read from  an existin g zip file .)
  9127                         When  reading a  zip file,  then 
  9128         <c>
  9129          LastModifi ed
  9130         </c>
  9131          takes the  DOS time
  9132                         that  is stored  with the f ile. If th e DOS time  has been  stored as  zero
  9133                         in th e zipfile,  then this  library w ill use 
  9134         <c>
  9135          DateTime.N ow
  9136         </c>
  9137          for the
  9138                         
  9139         <c>
  9140          LastModifi ed
  9141         </c>
  9142          value.  I f the ZIP  file was c reated by  an evolved
  9143                         tool,  then ther e will als o be highe r precisio n NTFS or  Unix times  in
  9144                         the z ip file.   In that ca se, this l ibrary wil l read tho se times,  and
  9145                         set 
  9146         <c>
  9147          LastModifi ed
  9148         </c>
  9149          and 
  9150         <c>
  9151          ModifiedTi me
  9152         </c>
  9153          to the sa me value,  the
  9154                         one c orrespondi ng to the  last write  time of t he file.   If there a re no
  9155                         highe r precisio n times st ored for t he entry,  then 
  9156         <c>
  9157          ModifiedTi me
  9158         </c>
  9159                         remai ns unset ( likewise 
  9160         <c>
  9161          AccessedTi me
  9162         </c>
  9163          and 
  9164         <c>
  9165          CreationTi me
  9166         </c>
  9167         ),
  9168                         and 
  9169         <c>
  9170          LastModifi ed
  9171         </c>
  9172          keeps its  DOS time.
  9173                       
  9174        </para>
  9175                     
  9176                      
  9177        <para>
  9178                         When  creating z ip files w ith this l ibrary, by  default t he extende d time
  9179                         prope rties (
  9180         <c>
  9181          ModifiedTi me
  9182         </c>
  9183        
  9184         <c>
  9185          AccessedTi me
  9186         </c>
  9187         , and
  9188                         
  9189         <c>
  9190          CreationTi me
  9191         </c>
  9192         ) are set  on the Zip Entry inst ance, and  these data  are
  9193                         store d in the z ip archive  for each  entry, in  NTFS forma t. If you  add an
  9194                         entry  from an a ctual file system fil e, then th e entry ge ts the act ual file
  9195                         times  for that  file, to N TFS-level  precision.   If you a dd an entr y from a
  9196                         strea m, or a st ring, then  the times  get the v alue 
  9197         <c>
  9198          DateTime.N ow
  9199         </c>
  9200         .  In
  9201                         this  case 
  9202         <c>
  9203          LastModifi ed
  9204         </c>
  9205          and 
  9206         <c>
  9207          ModifiedTi me
  9208         </c>
  9209          will be i dentical,
  9210                         to 2  seconds of  precision .  You can  explicitl y set the
  9211                         
  9212         <c>
  9213          CreationTi me
  9214         </c>
  9215        
  9216         <c>
  9217          AccessedTi me
  9218         </c>
  9219         , and 
  9220         <c>
  9221          ModifiedTi me
  9222         </c>
  9223          of an
  9224                         entry  using the  property  setters.   If you wan t to set a ll of thos e
  9225                         quant ities, it' s more eff icient to  use the 
  9226         <see 
  9227          cref="M:Io nic.Zip.Zi pEntry.Set EntryTimes (System.Da teTime,Sys tem.DateTi me,System. DateTime)"
  9228         />
  9229          method.   Those
  9230                         chang es are not  made perm anent in t he zip fil e until yo u call 
  9231         <see 
  9232          cref="M:Io nic.Zip.Zi pFile.Save "
  9233         />
  9234          or one of  its cousi ns.
  9235                       
  9236        </para>
  9237                     
  9238                      
  9239        <para>
  9240                         When  creating a  zip file,  you can o verride th e default  behavior o f
  9241                         this  library fo r formatti ng times i n the zip  file, disa bling the
  9242                         embed ding of fi le times i n NTFS for mat or ena bling the  storage of  file
  9243                         times  in Unix f ormat, or  both.  You  may want  to do this , for exam ple,
  9244                         when  creating a  zip file  on Windows , that wil l be consu med on a M ac,
  9245                         by an  applicati on that is  not hip t o the "NTF S times" f ormat. To  do
  9246                         this,  use the 
  9247         <see 
  9248          cref="P:Io nic.Zip.Zi pEntry.Emi tTimesInWi ndowsForma tWhenSavin g"
  9249         />
  9250          and
  9251                         
  9252         <see 
  9253          cref="P:Io nic.Zip.Zi pEntry.Emi tTimesInUn ixFormatWh enSaving"
  9254         />
  9255          propertie s.  A vali d zip
  9256                         file  may store  the file t imes in bo th formats .  But, th ere are no
  9257                         guara ntees that  a program  running o n Mac or L inux will  gracefully
  9258                         handl e the NTFS -formatted  times whe n Unix tim es are pre sent, or t hat a
  9259                         non-D otNetZip-p owered app lication r unning on  Windows wi ll be able  to
  9260                         handl e file tim es in Unix  format. D otNetZip w ill always  do someth ing
  9261                         reaso nable; oth er librari es or tool s may not.  When in d oubt, test .
  9262                       
  9263        </para>
  9264                     
  9265                      
  9266        <para>
  9267                         I'll  bet you di dn't think  one perso n could ty pe so much  about tim e, eh?
  9268                         And r eading it  was so enj oyable, to o!  Well,  in appreci ation, 
  9269         <see 
  9270          href="http ://cheeso. members.wi nisp.net/D otNetZipDo nate.aspx"
  9271         >
  9272          maybe you
  9273                          shoul d donate
  9274         </see>
  9275         ?
  9276                       
  9277        </para>
  9278                      
  9279       </remarks>
  9280                    
  9281                     
  9282       <seealso 
  9283        cref="P:Io nic.Zip.Zi pEntry.Acc essedTime"
  9284       />
  9285                     
  9286       <seealso 
  9287        cref="P:Io nic.Zip.Zi pEntry.Cre ationTime"
  9288       />
  9289                     
  9290       <seealso 
  9291        cref="P:Io nic.Zip.Zi pEntry.Las tModified"
  9292       />
  9293                     
  9294       <seealso 
  9295        cref="M:Io nic.Zip.Zi pEntry.Set EntryTimes (System.Da teTime,Sys tem.DateTi me,System. DateTime)"
  9296       />
  9297               
  9298      </member>
  9299              
  9300      <member 
  9301       name="P:Io nic.Zip.Zi pEntry.Acc essedTime"
  9302      >
  9303                    
  9304       <summary>
  9305                     Last Acc ess time f or the fil e represen ted by the  entry.
  9306                     
  9307       </summary>
  9308                    
  9309       <remarks>
  9310                     This val ue may or  may not be  meaningfu l.  If the  
  9311        <c>
  9312         ZipEntry
  9313        </c>
  9314         was read  from an ex isting
  9315                     Zip arch ive, this  informatio n may not  be availab le. For an  explanati on of why,  see
  9316                     
  9317        <see 
  9318         cref="P:Io nic.Zip.Zi pEntry.Mod ifiedTime"
  9319        />
  9320        .
  9321                     
  9322       </remarks>
  9323                    
  9324       <seealso 
  9325        cref="P:Io nic.Zip.Zi pEntry.Mod ifiedTime"
  9326       />
  9327                    
  9328       <seealso 
  9329        cref="P:Io nic.Zip.Zi pEntry.Cre ationTime"
  9330       />
  9331                    
  9332       <seealso 
  9333        cref="M:Io nic.Zip.Zi pEntry.Set EntryTimes (System.Da teTime,Sys tem.DateTi me,System. DateTime)"
  9334       />
  9335               
  9336      </member>
  9337              
  9338      <member 
  9339       name="P:Io nic.Zip.Zi pEntry.Cre ationTime"
  9340      >
  9341                     
  9342       <summary>
  9343                      The fil e creation  time for  the file r epresented  by the en try.
  9344                      
  9345       </summary>
  9346                    
  9347                     
  9348       <remarks>
  9349                      This va lue may or  may not b e meaningf ul.  If th
  9350        <c>
  9351         ZipEntry
  9352        </c>
  9353         was read
  9354                      from an  existing  zip archiv e, and the  creation  time was n ot set on  the entry
  9355                      when th e zip file  was creat ed, then t his proper ty may be  meaningles s. For an
  9356                      explana tion of wh y, see 
  9357        <see 
  9358         cref="P:Io nic.Zip.Zi pEntry.Mod ifiedTime"
  9359        />
  9360        .
  9361                      
  9362       </remarks>
  9363                     
  9364       <seealso 
  9365        cref="P:Io nic.Zip.Zi pEntry.Mod ifiedTime"
  9366       />
  9367                     
  9368       <seealso 
  9369        cref="P:Io nic.Zip.Zi pEntry.Acc essedTime"
  9370       />
  9371                     
  9372       <seealso 
  9373        cref="M:Io nic.Zip.Zi pEntry.Set EntryTimes (System.Da teTime,Sys tem.DateTi me,System. DateTime)"
  9374       />
  9375               
  9376      </member>
  9377              
  9378      <member 
  9379       name="P:Io nic.Zip.Zi pEntry.Emi tTimesInWi ndowsForma tWhenSavin g"
  9380      >
  9381                     
  9382       <summary>
  9383                        Speci fies wheth er the Cre ation, Acc ess, and M odified ti mes for th e given
  9384                        entry  will be e mitted in  "Windows f ormat" whe n the zip  archive is  saved.
  9385                      
  9386       </summary>
  9387                    
  9388                     
  9389       <remarks>
  9390                      
  9391        <para>
  9392                         An ap plication  creating a  zip archi ve can use  this flag  to explic itly
  9393                         speci fy that th e file tim es for the  entry sho uld or sho uld not be  stored
  9394                         in th e zip arch ive in the  format us ed by Wind ows. The d efault val ue of
  9395                         this  property i
  9396         <c>
  9397          true
  9398         </c>
  9399         .
  9400                       
  9401        </para>
  9402                     
  9403                      
  9404        <para>
  9405                         When  adding an  entry from  a file or  directory , the Crea tion (
  9406         <see 
  9407          cref="P:Io nic.Zip.Zi pEntry.Cre ationTime"
  9408         />
  9409         ), Access  (
  9410         <see 
  9411          cref="P:Io nic.Zip.Zi pEntry.Acc essedTime"
  9412         />
  9413         ), and Mod ified
  9414                         (
  9415         <see 
  9416          cref="P:Io nic.Zip.Zi pEntry.Mod ifiedTime"
  9417         />
  9418         ) times fo r the give n entry ar e automati cally
  9419                         set f rom the fi lesystem v alues. Whe n adding a n entry fr om a strea m or
  9420                         strin g, all thr ee values  are implic itly set t o DateTime .Now.  App lications
  9421                         can a lso explic itly set t hose times  by callin
  9422         <see 
  9423          cref="M:Io nic.Zip.Zi pEntry.Set EntryTimes (System.Da teTime,Sys tem.DateTi me,System. DateTime)"
  9424         />
  9425         .
  9426                       
  9427        </para>
  9428                     
  9429                      
  9430        <para>
  9431                         
  9432         <see 
  9433          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  9434         >
  9435          PKWARE's
  9436                          zip s pecificati on
  9437         </see>
  9438          describes  multiple  ways to fo rmat these  times in  a
  9439                         zip f ile. One i s the form at Windows  applicati ons normal ly use: 10 0ns ticks
  9440                         since  Jan 1, 16 01 UTC.  T he other i s a format  Unix appl ications t ypically
  9441                         use:  seconds si nce Januar y 1, 1970  UTC.  Each  format ca n be store d in an
  9442                         "extr a field" i n the zip  entry when  saving th e zip arch ive. The f ormer
  9443                         uses  an extra f ield with  a Header I d of 0x000 A, while t he latter  uses a
  9444                         heade r ID of 0x 5455.
  9445                       
  9446        </para>
  9447                     
  9448                      
  9449        <para>
  9450                         Not a ll zip too ls and lib raries can  interpret  these fie lds.  Wind ows
  9451                         compr essed fold ers is one  that can  read the W indows For mat timest amps,
  9452                         while  I believe  the 
  9453         <see 
  9454          href="http ://www.inf o-zip.org/ "
  9455         >
  9456          Infozip
  9457         </see>
  9458                         tools  can read  the Unix f ormat time stamps. Al though the  time valu es are
  9459                         easil y converti ble, subje ct to a lo ss of prec ision, som e tools an d
  9460                         libra ries may b e able to  read only  one or the  other. Do tNetZip ca n read or
  9461                         write  times in  either or  both forma ts.
  9462                       
  9463        </para>
  9464                     
  9465                      
  9466        <para>
  9467                         The t imes store d are take n from 
  9468         <see 
  9469          cref="P:Io nic.Zip.Zi pEntry.Mod ifiedTime"
  9470         />
  9471        
  9472         <see 
  9473          cref="P:Io nic.Zip.Zi pEntry.Acc essedTime"
  9474         />
  9475         , and 
  9476         <see 
  9477          cref="P:Io nic.Zip.Zi pEntry.Cre ationTime"
  9478         />
  9479         .
  9480                       
  9481        </para>
  9482                     
  9483                      
  9484        <para>
  9485                         This  property i s not mutu ally exclu sive from  the 
  9486         <see 
  9487          cref="P:Io nic.Zip.Zi pEntry.Emi tTimesInUn ixFormatWh enSaving"
  9488         />
  9489          property.   It is
  9490                         possi ble that a  zip entry  can embed  the times tamps in b oth forms,  one
  9491                         form,  or neithe r.  But, t here are n o guarante es that a  program ru nning on
  9492                         Mac o r Linux wi ll gracefu lly handle  NTFS Form atted time s, or that  a
  9493                         non-D otNetZip-p owered app lication r unning on  Windows wi ll be able  to
  9494                         handl e file tim es in Unix  format. W hen in dou bt, test.
  9495                       
  9496        </para>
  9497                     
  9498                      
  9499        <para>
  9500                         Norma lly you wi ll use the  
  9501         <see 
  9502          cref="P:Io nic.Zip.Zi pFile.Emit TimesInWin dowsFormat WhenSaving "
  9503         >
  9504          ZipFile.Em itTimesInW indowsForm atWhenSavi ng
  9505         </see>
  9506                         prope rty, to sp ecify the  behavior f or all ent ries in a  zip, rathe r than
  9507                         the p roperty on  each indi vidual ent ry.
  9508                       
  9509        </para>
  9510                     
  9511                      
  9512       </remarks>
  9513                    
  9514                     
  9515       <seealso 
  9516        cref="M:Io nic.Zip.Zi pEntry.Set EntryTimes (System.Da teTime,Sys tem.DateTi me,System. DateTime)"
  9517       />
  9518                     
  9519       <seealso 
  9520        cref="P:Io nic.Zip.Zi pEntry.Emi tTimesInUn ixFormatWh enSaving"
  9521       />
  9522                     
  9523       <seealso 
  9524        cref="P:Io nic.Zip.Zi pEntry.Cre ationTime"
  9525       />
  9526                     
  9527       <seealso 
  9528        cref="P:Io nic.Zip.Zi pEntry.Acc essedTime"
  9529       />
  9530                     
  9531       <seealso 
  9532        cref="P:Io nic.Zip.Zi pEntry.Mod ifiedTime"
  9533       />
  9534               
  9535      </member>
  9536              
  9537      <member 
  9538       name="P:Io nic.Zip.Zi pEntry.Emi tTimesInUn ixFormatWh enSaving"
  9539      >
  9540                     
  9541       <summary>
  9542                        Speci fies wheth er the Cre ation, Acc ess, and M odified ti mes for th e given
  9543                        entry  will be e mitted in  "Unix(tm)  format" wh en the zip  archive i s saved.
  9544                      
  9545       </summary>
  9546                    
  9547                     
  9548       <remarks>
  9549                      
  9550        <para>
  9551                         An ap plication  creating a  zip archi ve can use  this flag  to explic itly
  9552                         speci fy that th e file tim es for the  entry sho uld or sho uld not be  stored
  9553                         in th e zip arch ive in the  format us ed by Unix . By defau lt this fl ag is
  9554                         
  9555         <c>
  9556          false
  9557         </c>
  9558         , meaning  the Unix-f ormat time s are not  stored in  the zip
  9559                         archi ve.
  9560                       
  9561        </para>
  9562                     
  9563                      
  9564        <para>
  9565                         When  adding an  entry from  a file or  directory , the Crea tion (
  9566         <see 
  9567          cref="P:Io nic.Zip.Zi pEntry.Cre ationTime"
  9568         />
  9569         ), Access  (
  9570         <see 
  9571          cref="P:Io nic.Zip.Zi pEntry.Acc essedTime"
  9572         />
  9573         ), and Mod ified
  9574                         (
  9575         <see 
  9576          cref="P:Io nic.Zip.Zi pEntry.Mod ifiedTime"
  9577         />
  9578         ) times fo r the give n entry ar e automati cally
  9579                         set f rom the fi lesystem v alues. Whe n adding a n entry fr om a strea m or
  9580                         strin g, all thr ee values  are implic itly set t o DateTime .Now.  App lications
  9581                         can a lso explic itly set t hose times  by callin
  9582         <see 
  9583          cref="M:Io nic.Zip.Zi pEntry.Set EntryTimes (System.Da teTime,Sys tem.DateTi me,System. DateTime)"
  9584         />
  9585         .
  9586                       
  9587        </para>
  9588                     
  9589                      
  9590        <para>
  9591                         
  9592         <see 
  9593          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  9594         >
  9595          PKWARE's
  9596                          zip s pecificati on
  9597         </see>
  9598          describes  multiple  ways to fo rmat these  times in  a
  9599                         zip f ile. One i s the form at Windows  applicati ons normal ly use: 10 0ns ticks
  9600                         since  Jan 1, 16 01 UTC.  T he other i s a format  Unix appl ications t ypically
  9601                         use:  seconds si nce Jan 1,  1970 UTC.   Each for mat can be  stored in  an
  9602                         "extr a field" i n the zip  entry when  saving th e zip arch ive. The f ormer
  9603                         uses  an extra f ield with  a Header I d of 0x000 A, while t he latter  uses a
  9604                         heade r ID of 0x 5455.
  9605                       
  9606        </para>
  9607                     
  9608                      
  9609        <para>
  9610                         Not a ll tools a nd librari es can int erpret the se fields.   Windows
  9611                         compr essed fold ers is one  that can  read the W indows For mat timest amps,
  9612                         while  I believe  the 
  9613         <see 
  9614          href="http ://www.inf o-zip.org/ "
  9615         >
  9616          Infozip
  9617         </see>
  9618                         tools  can read  the Unix f ormat time stamps. Al though the  time valu es are
  9619                         easil y converti ble, subje ct to a lo ss of prec ision, som e tools an d
  9620                         libra ries may b e able to  read only  one or the  other. Do tNetZip ca n read or
  9621                         write  times in  either or  both forma ts.
  9622                       
  9623        </para>
  9624                     
  9625                      
  9626        <para>
  9627                         The t imes store d are take n from 
  9628         <see 
  9629          cref="P:Io nic.Zip.Zi pEntry.Mod ifiedTime"
  9630         />
  9631        
  9632         <see 
  9633          cref="P:Io nic.Zip.Zi pEntry.Acc essedTime"
  9634         />
  9635         , and 
  9636         <see 
  9637          cref="P:Io nic.Zip.Zi pEntry.Cre ationTime"
  9638         />
  9639         .
  9640                       
  9641        </para>
  9642                     
  9643                      
  9644        <para>
  9645                         This  property i s not mutu ally exclu sive from  the 
  9646         <see 
  9647          cref="P:Io nic.Zip.Zi pEntry.Emi tTimesInWi ndowsForma tWhenSavin g"
  9648         />
  9649          property.   It is
  9650                         possi ble that a  zip entry  can embed  the times tamps in b oth forms,  one
  9651                         form,  or neithe r.  But, t here are n o guarante es that a  program ru nning on
  9652                         Mac o r Linux wi ll gracefu lly handle  NTFS Form atted time s, or that  a
  9653                         non-D otNetZip-p owered app lication r unning on  Windows wi ll be able  to
  9654                         handl e file tim es in Unix  format. W hen in dou bt, test.
  9655                       
  9656        </para>
  9657                     
  9658                      
  9659        <para>
  9660                         Norma lly you wi ll use the  
  9661         <see 
  9662          cref="P:Io nic.Zip.Zi pFile.Emit TimesInUni xFormatWhe nSaving"
  9663         >
  9664          ZipFile.Em itTimesInU nixFormatW henSaving
  9665         </see>
  9666                         prope rty, to sp ecify the  behavior f or all ent ries, rath er than th e
  9667                         prope rty on eac h individu al entry.
  9668                       
  9669        </para>
  9670                      
  9671       </remarks>
  9672                    
  9673                     
  9674       <seealso 
  9675        cref="M:Io nic.Zip.Zi pEntry.Set EntryTimes (System.Da teTime,Sys tem.DateTi me,System. DateTime)"
  9676       />
  9677                     
  9678       <seealso 
  9679        cref="P:Io nic.Zip.Zi pEntry.Emi tTimesInWi ndowsForma tWhenSavin g"
  9680       />
  9681                     
  9682       <seealso 
  9683        cref="P:Io nic.Zip.Zi pFile.Emit TimesInUni xFormatWhe nSaving"
  9684       />
  9685                     
  9686       <seealso 
  9687        cref="P:Io nic.Zip.Zi pEntry.Cre ationTime"
  9688       />
  9689                     
  9690       <seealso 
  9691        cref="P:Io nic.Zip.Zi pEntry.Acc essedTime"
  9692       />
  9693                     
  9694       <seealso 
  9695        cref="P:Io nic.Zip.Zi pEntry.Mod ifiedTime"
  9696       />
  9697               
  9698      </member>
  9699              
  9700      <member 
  9701       name="P:Io nic.Zip.Zi pEntry.Tim estamp"
  9702      >
  9703                     
  9704       <summary>
  9705                      The typ e of times tamp attac hed to the  ZipEntry.
  9706                      
  9707       </summary>
  9708                    
  9709                     
  9710       <remarks>
  9711                      This pr operty is  valid only  for a Zip Entry that  was read  from a zip  archive.
  9712                      It indi cates the  type of ti mestamp at tached to  the entry.
  9713                      
  9714       </remarks>
  9715                    
  9716                     
  9717       <seealso 
  9718        cref="P:Io nic.Zip.Zi pEntry.Emi tTimesInWi ndowsForma tWhenSavin g"
  9719       />
  9720                     
  9721       <seealso 
  9722        cref="P:Io nic.Zip.Zi pEntry.Emi tTimesInUn ixFormatWh enSaving"
  9723       />
  9724               
  9725      </member>
  9726              
  9727      <member 
  9728       name="P:Io nic.Zip.Zi pEntry.Att ributes"
  9729      >
  9730                     
  9731       <summary>
  9732                        The f ile attrib utes for t he entry.
  9733                      
  9734       </summary>
  9735                    
  9736                     
  9737       <remarks>
  9738                     
  9739                      
  9740        <para>
  9741                         The 
  9742         <see 
  9743          cref="T:Sy stem.IO.Fi leAttribut es"
  9744         >
  9745          attributes
  9746         </see>
  9747          in NTFS i nclude
  9748                         ReadO nly, Archi ve, Hidden , System,  and Indexe d.  When a dding a
  9749                         
  9750         <c>
  9751          ZipEntry
  9752         </c>
  9753          to a ZipF ile, these  attribute s are set  implicitly  when
  9754                         addin g an entry  from the  filesystem .  When ad ding an en try from a  stream
  9755                         or st ring, the  Attributes  are not s et implici tly.  Rega rdless of  the way
  9756                         an en try was ad ded to a 
  9757         <c>
  9758          ZipFile
  9759         </c>
  9760         , you can  set the at tributes
  9761                         expli citly if y ou like.
  9762                       
  9763        </para>
  9764                     
  9765                      
  9766        <para>
  9767                         When  reading a 
  9768         <c>
  9769          ZipEntry
  9770         </c>
  9771          from a 
  9772         <c>
  9773          ZipFile
  9774         </c>
  9775         , the attr ibutes are
  9776                         set a ccording t o the data  stored in  the 
  9777         <c>
  9778          ZipFile
  9779         </c>
  9780         . If you e xtract the
  9781                         entry  from the  archive to  a filesys tem file,  DotNetZip  will set t he
  9782                         attri butes on t he resulti ng file ac cordingly.
  9783                       
  9784        </para>
  9785                     
  9786                      
  9787        <para>
  9788                         The a ttributes  can be set  explicitl y by the a pplication .  For exa mple the
  9789                         appli cation may  wish to s et the 
  9790         <c>
  9791          FileAttrib utes.ReadO nly
  9792         </c>
  9793          bit for a ll
  9794                         entri es added t o an archi ve, so tha t on unpac k, this at tribute wi ll be set
  9795                         on th e extracte d file.  A ny changes  you make  to this pr operty are  made
  9796                         perma nent only  when you c all a 
  9797         <c>
  9798          Save()
  9799         </c>
  9800          method on  the 
  9801         <c>
  9802          ZipFile
  9803         </c>
  9804                         insta nce that c ontains th e ZipEntry .
  9805                       
  9806        </para>
  9807                     
  9808                      
  9809        <para>
  9810                         For e xample, an  applicati on may wis h to zip u p a direct ory and se t the
  9811                         ReadO nly bit on  every fil e in the a rchive, so  that upon  later ext raction,
  9812                         the r esulting f iles will  be marked  as ReadOnl y.  Not ev ery extrac tion tool
  9813                         respe cts these  attributes , but if y ou unpack  with DotNe tZip, as f or
  9814                         examp le in a se lf-extract ing archiv e, then th e attribut es will be  set as
  9815                         they  are stored  in the 
  9816         <c>
  9817          ZipFile
  9818         </c>
  9819         .
  9820                       
  9821        </para>
  9822                     
  9823                      
  9824        <para>
  9825                         These  attribute s may not  be interes ting or us eful if th e resultin g archive
  9826                         is ex tracted on  a non-Win dows platf orm.  How  these attr ibutes get  used
  9827                         upon  extraction  depends o n the plat form and t ool used.
  9828                       
  9829        </para>
  9830                     
  9831                      
  9832        <para>
  9833                         This  property i s only par tially sup ported in  the Silver light vers ion
  9834                         of th e library:  applicati ons can re ad attribu tes on ent ries withi n
  9835                         ZipFi les. But e xtracting  entries wi thin Silve rlight wil l not set  the
  9836                         attri butes on t he extract ed files.
  9837                       
  9838        </para>
  9839                     
  9840                      
  9841       </remarks>
  9842               
  9843      </member>
  9844              
  9845      <member 
  9846       name="P:Io nic.Zip.Zi pEntry.Loc alFileName "
  9847      >
  9848                     
  9849       <summary>
  9850                        The n ame of the  filesyste m file, re ferred to  by the Zip Entry.
  9851                      
  9852       </summary>
  9853                    
  9854                     
  9855       <remarks>
  9856                       
  9857        <para>
  9858                          This  property  specifies  the thing- to-be-zipp ed on disk , and is s et only
  9859                          when  the 
  9860         <c>
  9861          ZipEntry
  9862         </c>
  9863          is being  created fr om a files ystem file .  If the
  9864                          
  9865         <c>
  9866          ZipFile
  9867         </c>
  9868          is instan tiated by  reading an  existing  .zip archi ve, then
  9869                          the  LocalFileN ame will b
  9870         <c>
  9871          null
  9872         </c>
  9873          (
  9874         <c>
  9875          Nothing
  9876         </c>
  9877          in VB).
  9878                        
  9879        </para>
  9880                     
  9881                       
  9882        <para>
  9883                          When  it is set , the valu e of this  property m ay be diff erent than  
  9884         <see 
  9885          cref="P:Io nic.Zip.Zi pEntry.Fil eName"
  9886         />
  9887         , which is  the path  used in th e archive  itself.  I f you
  9888                          call  
  9889         <c>
  9890          Zip.AddFil e("foop.tx t", Altern ativeDirec tory)
  9891         </c>
  9892         , then the  path
  9893                          used  for the 
  9894         <c>
  9895          ZipEntry
  9896         </c>
  9897          within th e zip arch ive will b e differen t
  9898                          than  this path .
  9899                        
  9900        </para>
  9901                     
  9902                       
  9903        <para>
  9904                         If th e entry is  being add ed from a  stream, th en this is  null (Not hing in VB ).
  9905                        
  9906        </para>
  9907                     
  9908                      
  9909       </remarks>
  9910                     
  9911       <seealso 
  9912        cref="P:Io nic.Zip.Zi pEntry.Fil eName"
  9913       />
  9914               
  9915      </member>
  9916              
  9917      <member 
  9918       name="P:Io nic.Zip.Zi pEntry.Fil eName"
  9919      >
  9920                     
  9921       <summary>
  9922                        The n ame of the  file cont ained in t he ZipEntr y.
  9923                      
  9924       </summary>
  9925                    
  9926                     
  9927       <remarks>
  9928                     
  9929                      
  9930        <para>
  9931                         This  is the nam e of the e ntry in th
  9932         <c>
  9933          ZipFile
  9934         </c>
  9935          itself.   When creat ing
  9936                         a zip  archive,  if the 
  9937         <c>
  9938          ZipEntry
  9939         </c>
  9940          has been  created fr om a files ystem
  9941                         file,  via a cal l to 
  9942         <see 
  9943          cref="M:Io nic.Zip.Zi pFile.AddF ile(System .String,Sy stem.Strin g)"
  9944         />
  9945          or 
  9946         <see 
  9947          cref="M:Io nic.Zip.Zi pFile.AddI tem(System .String,Sy stem.Strin g)"
  9948         />
  9949         , or a rel ated overl oad, the v alue
  9950                         of th is propert y is deriv ed from th e name of  that file.  The
  9951                         
  9952         <c>
  9953          FileName
  9954         </c>
  9955          property  does not i nclude dri ve letters , and may  include a
  9956                         diffe rent direc tory path,  depending  on the va lue of the
  9957                         
  9958         <c>
  9959          directoryP athInArchi ve
  9960         </c>
  9961          parameter  used when  adding th e entry in to
  9962                         the 
  9963         <c>
  9964          ZipFile
  9965         </c>
  9966         .
  9967                       
  9968        </para>
  9969                     
  9970                      
  9971        <para>
  9972                         In so me cases t here is no  related f ilesystem  file - for  example w hen a
  9973                         
  9974         <c>
  9975          ZipEntry
  9976         </c>
  9977          is create d using 
  9978         <see 
  9979          cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,S ystem.Stri ng)"
  9980         />
  9981          or one of  the simil ar overloa ds.  In th is case, t he value o f
  9982                         this  property i s derived  from the f ileName an d the dire ctory path  passed
  9983                         to th at method.
  9984                       
  9985        </para>
  9986                     
  9987                      
  9988        <para>
  9989                         When  reading a  zip file,  this prope rty takes  the value  of the ent ry name
  9990                         as st ored in th e zip file . If you e xtract suc h an entry , the extr acted
  9991                         file  will take  the name g iven by th is propert y.
  9992                       
  9993        </para>
  9994                     
  9995                      
  9996        <para>
  9997                         Appli cations ca n set this  property  when creat ing new zi p archives  or when
  9998                         readi ng existin g archives . When set ting this  property,  the actual  value
  9999                         that  is set wil l replace  backslashe s with for ward slash es, in acc ordance
  10000                         with 
  10001         <see 
  10002          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  10003         >
  10004          the Zip
  10005                          speci fication
  10006         </see>
  10007         , for comp atibility  with Unix( tm) and .. . get
  10008                         this. ... Amiga!
  10009                       
  10010        </para>
  10011                     
  10012                      
  10013        <para>
  10014                         If an  applicati on reads a  
  10015         <c>
  10016          ZipFile
  10017         </c>
  10018          via 
  10019         <see 
  10020          cref="M:Io nic.Zip.Zi pFile.Read (System.St ring)"
  10021         />
  10022          or a rela ted overlo ad, and th en explici tly
  10023                         sets  the FileNa me on an e ntry conta ined withi n the 
  10024         <c>
  10025          ZipFile
  10026         </c>
  10027         , and
  10028                         then  calls 
  10029         <see 
  10030          cref="M:Io nic.Zip.Zi pFile.Save "
  10031         />
  10032         , the appl ication wi ll effecti vely
  10033                         renam e the entr y within t he zip arc hive.
  10034                       
  10035        </para>
  10036                     
  10037                      
  10038        <para>
  10039                         If an  applicati on sets th e value of  
  10040         <c>
  10041          FileName
  10042         </c>
  10043         , then cal ls
  10044                         
  10045         <c>
  10046          Extract()
  10047         </c>
  10048          on the en try, the e ntry is ex tracted to  a file us ing the
  10049                         newly  set value  as the fi lename.  T he 
  10050         <c>
  10051          FileName
  10052         </c>
  10053          value is  made
  10054                         perma nent in th e zip arch ive only 
  10055         <em>
  10056          after
  10057         </em>
  10058          a call to  one of th e
  10059                         
  10060         <c>
  10061          ZipFile.Sa ve()
  10062         </c>
  10063          methods o n the 
  10064         <c>
  10065          ZipFile
  10066         </c>
  10067          that cont ains the
  10068                         ZipEn try.
  10069                       
  10070        </para>
  10071                     
  10072                      
  10073        <para>
  10074                         If an  applicati on attempt s to set t he 
  10075         <c>
  10076          FileName
  10077         </c>
  10078          to a valu e that
  10079                         would  result in  a duplica te entry i n the 
  10080         <c>
  10081          ZipFile
  10082         </c>
  10083         , an excep tion is
  10084                         throw n.
  10085                       
  10086        </para>
  10087                     
  10088                      
  10089        <para>
  10090                         When 
  10091         <c>
  10092          ZipEntry
  10093         </c>
  10094          is contai ned within  a 
  10095         <c>
  10096          ZipFile
  10097         </c>
  10098         , applicat ions
  10099                         canno t rename t he entry w ithin the  context of  a 
  10100         <c>
  10101          foreach
  10102         </c>
  10103          (
  10104         <c>
  10105          For
  10106                          Each
  10107         </c>
  10108          in VB) lo op, becaus e of the w ay the 
  10109         <c>
  10110          ZipFile
  10111         </c>
  10112          stores
  10113                         entri es.  If yo u need to  enumerate  through al l the entr ies and re name one
  10114                         or mo re of them , use 
  10115         <see 
  10116          cref="P:Io nic.Zip.Zi pFile.Entr iesSorted"
  10117         >
  10118          ZipFile.En triesSorte d
  10119         </see>
  10120          as the
  10121                         colle ction.  Se e also, 
  10122         <see 
  10123          cref="M:Io nic.Zip.Zi pFile.GetE numerator"
  10124         >
  10125          ZipFile.Ge tEnumerato r()
  10126         </see>
  10127         .
  10128                       
  10129        </para>
  10130                     
  10131                      
  10132       </remarks>
  10133               
  10134      </member>
  10135              
  10136      <member 
  10137       name="P:Io nic.Zip.Zi pEntry.Inp utStream"
  10138      >
  10139                     
  10140       <summary>
  10141                      The str eam that p rovides co ntent for  the ZipEnt ry.
  10142                      
  10143       </summary>
  10144                    
  10145                     
  10146       <remarks>
  10147                     
  10148                      
  10149        <para>
  10150                         The a pplication  can use t his proper ty to set  the input  stream for  an
  10151                         entry  on a just -in-time b asis. Imag ine a scen ario where  the appli cation
  10152                         creat es a 
  10153         <c>
  10154          ZipFile
  10155         </c>
  10156          comprised  of conten t obtained  from hund reds of
  10157                         files , via call s to 
  10158         <c>
  10159          AddFile()
  10160         </c>
  10161         . The DotN etZip libr ary opens  streams
  10162                         on th ese files  on a just- in-time ba sis, only  when writi ng the ent ry out to
  10163                         an ex ternal sto re within  the scope  of a 
  10164         <c>
  10165          ZipFile.Sa ve()
  10166         </c>
  10167          call.  On ly
  10168                         one i nput strea m is opene d at a tim e, as each  entry is  being writ ten out.
  10169                       
  10170        </para>
  10171                     
  10172                      
  10173        <para>
  10174                         Now i magine a d ifferent a pplication  that crea tes a 
  10175         <c>
  10176          ZipFile
  10177         </c>
  10178                         with  content ob tained fro m hundreds  of stream s, added t hrough 
  10179         <see 
  10180          cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,S ystem.IO.S tream)"
  10181         />
  10182         .  Normall y the
  10183                         appli cation wou ld supply  an open st ream to th at call.   But when l arge
  10184                         numbe rs of stre ams are be ing added,  this can  mean many  open strea ms at one
  10185                         time,  unnecessa rily.
  10186                       
  10187        </para>
  10188                     
  10189                      
  10190        <para>
  10191                         To av oid this,  call 
  10192         <see 
  10193          cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,I onic.Zip.O penDelegat e,Ionic.Zi p.CloseDel egate)"
  10194         />
  10195          and speci fy delegat es that op en and clo se the str eam at
  10196                         the t ime of Sav e.
  10197                       
  10198        </para>
  10199                     
  10200                     
  10201                      
  10202        <para>
  10203                         Setti ng the val ue of this  property  when the e ntry was n ot added f rom a
  10204                         strea m (for exa mple, when  the 
  10205         <c>
  10206          ZipEntry
  10207         </c>
  10208          was added  with 
  10209         <see 
  10210          cref="M:Io nic.Zip.Zi pFile.AddF ile(System .String)"
  10211         />
  10212          or 
  10213         <see 
  10214          cref="M:Io nic.Zip.Zi pFile.AddD irectory(S ystem.Stri ng)"
  10215         />
  10216         , or when  the entry  was added  by
  10217                         readi ng an exis ting zip a rchive) wi ll throw a n exceptio n.
  10218                       
  10219        </para>
  10220                     
  10221                      
  10222       </remarks>
  10223                    
  10224               
  10225      </member>
  10226              
  10227      <member 
  10228       name="P:Io nic.Zip.Zi pEntry.Inp utStreamWa sJitProvid ed"
  10229      >
  10230                     
  10231       <summary>
  10232                        A fla g indicati ng whether  the Input Stream was  provided  Just-in-ti me.
  10233                      
  10234       </summary>
  10235                    
  10236                     
  10237       <remarks>
  10238                     
  10239                      
  10240        <para>
  10241                         When  creating a  zip archi ve, an app lication c an obtain  content fo r one or
  10242                         more  of the 
  10243         <c>
  10244          ZipEntry
  10245         </c>
  10246          instances  from stre ams, using  the 
  10247         <see 
  10248          cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,S ystem.IO.S tream)"
  10249         />
  10250          method.   At the tim e
  10251                         of ca lling that  method, t he applica tion can s upply null  as the va lue of
  10252                         the s tream para meter.  By  doing so,  the appli cation ind icates to  the
  10253                         libra ry that it  will prov ide a stre am for the  entry on  a just-in- time
  10254                         basis , at the t ime one of  the 
  10255         <c>
  10256          ZipFile.Sa ve()
  10257         </c>
  10258          methods i s called a nd
  10259                         the d ata for th e various  entries ar e being co mpressed a nd written  out.
  10260                       
  10261        </para>
  10262                     
  10263                      
  10264        <para>
  10265                         In th is case, t he applica tion can s et the 
  10266         <see 
  10267          cref="P:Io nic.Zip.Zi pEntry.Inp utStream"
  10268         />
  10269                         prope rty, typic ally withi n the Save Progress e vent (even t type: 
  10270         <see 
  10271          cref="F:Io nic.Zip.Zi pProgressE ventType.S aving_Befo reWriteEnt ry"
  10272         />
  10273         ) for that  entry.
  10274                       
  10275        </para>
  10276                     
  10277                      
  10278        <para>
  10279                         The a pplication  will late r want to  call Close () and Dis pose() on  that
  10280                         strea m.  In the  SaveProgr ess event,  when the  event type  is 
  10281         <see 
  10282          cref="F:Io nic.Zip.Zi pProgressE ventType.S aving_Afte rWriteEntr y"
  10283         />
  10284         , the appl ication ca n
  10285                         do so .  This fl ag indicat es that th e stream h as been pr ovided by  the
  10286                         appli cation on  a just-in- time basis  and that  it is the  applicatio n's
  10287                         respo nsibility  to call Cl ose/Dispos e on that  stream.
  10288                       
  10289        </para>
  10290                     
  10291                      
  10292       </remarks>
  10293                     
  10294       <seealso 
  10295        cref="P:Io nic.Zip.Zi pEntry.Inp utStream"
  10296       />
  10297               
  10298      </member>
  10299              
  10300      <member 
  10301       name="P:Io nic.Zip.Zi pEntry.Sou rce"
  10302      >
  10303                    
  10304       <summary>
  10305                     An enum  indicating  the sourc e of the Z ipEntry.
  10306                     
  10307       </summary>
  10308               
  10309      </member>
  10310              
  10311      <member 
  10312       name="P:Io nic.Zip.Zi pEntry.Ver sionNeeded "
  10313      >
  10314                     
  10315       <summary>
  10316                      The ver sion of th e zip engi ne needed  to read th e ZipEntry .
  10317                      
  10318       </summary>
  10319                    
  10320                     
  10321       <remarks>
  10322                      
  10323        <para>
  10324                         This  is a reado nly proper ty, indica ting the v ersion of 
  10325         <a
  10326                         
  10327          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  10328         >
  10329          the Zip
  10330                          speci fication
  10331         </a>
  10332          that the  extracting  tool or l ibrary mus t support  to
  10333                         extra ct the giv en entry.   Generally  higher ve rsions ind icate newe r
  10334                         featu res.  Olde r zip engi nes obviou sly won't  know about  new featu res, and
  10335                         won't  be able t o extract  entries th at depend  on those n ewer featu res.
  10336                       
  10337        </para>
  10338                     
  10339                      
  10340        <list 
  10341         type="tabl e"
  10342        >
  10343                       
  10344         <listheade r>
  10345                        
  10346          <term>
  10347           value
  10348          </term>
  10349                        
  10350          <descripti on>
  10351           Features
  10352          </descript ion>
  10353                        
  10354         </listhead er>
  10355                      
  10356                       
  10357         <item>
  10358                        
  10359          <term>
  10360           20
  10361          </term>
  10362                        
  10363          <descripti on>
  10364           a basic Zi p Entry, p otentially  using PKZ IP encrypt ion.
  10365                         
  10366          </descript ion>
  10367                        
  10368         </item>
  10369                      
  10370                       
  10371         <item>
  10372                        
  10373          <term>
  10374           45
  10375          </term>
  10376                        
  10377          <descripti on>
  10378           The ZIP64  extension  is used on  the entry .
  10379                         
  10380          </descript ion>
  10381                        
  10382         </item>
  10383                      
  10384                       
  10385         <item>
  10386                        
  10387          <term>
  10388           46
  10389          </term>
  10390                        
  10391          <descripti on>
  10392            File is c ompressed  using BZIP 2 compress ion*
  10393          </descript ion>
  10394                        
  10395         </item>
  10396                      
  10397                       
  10398         <item>
  10399                        
  10400          <term>
  10401           50
  10402          </term>
  10403                        
  10404          <descripti on>
  10405            File is e ncrypted u sing PkWar e's DES, 3 DES, (brok en) RC2 or  RC4
  10406          </descript ion>
  10407                        
  10408         </item>
  10409                      
  10410                       
  10411         <item>
  10412                        
  10413          <term>
  10414           51
  10415          </term>
  10416                        
  10417          <descripti on>
  10418            File is e ncrypted u sing PKWar e's AES en cryption o r correcte d RC2 encr yption.
  10419          </descript ion>
  10420                        
  10421         </item>
  10422                      
  10423                       
  10424         <item>
  10425                        
  10426          <term>
  10427           52
  10428          </term>
  10429                        
  10430          <descripti on>
  10431            File is e ncrypted u sing corre cted RC2-6 4 encrypti on**
  10432          </descript ion>
  10433                        
  10434         </item>
  10435                      
  10436                       
  10437         <item>
  10438                        
  10439          <term>
  10440           61
  10441          </term>
  10442                        
  10443          <descripti on>
  10444            File is e ncrypted u sing non-O AEP key wr apping***
  10445          </descript ion>
  10446                        
  10447         </item>
  10448                      
  10449                       
  10450         <item>
  10451                        
  10452          <term>
  10453           63
  10454          </term>
  10455                        
  10456          <descripti on>
  10457            File is c ompressed  using LZMA , PPMd+, B lowfish, o r Twofish
  10458          </descript ion>
  10459                        
  10460         </item>
  10461                      
  10462                       
  10463        </list>
  10464                     
  10465                      
  10466        <para>
  10467                         There  are other  values po ssible, no t listed h ere. DotNe tZip suppo rts
  10468                         regul ar PKZip e ncryption,  and ZIP64  extension s.  DotNet Zip cannot  extract
  10469                         entri es that re quire a zi p engine h igher than  45.
  10470                       
  10471        </para>
  10472                     
  10473                      
  10474        <para>
  10475                         This  value is s et upon re ading an e xisting zi p file, or  after sav ing a zip
  10476                         archi ve.
  10477                       
  10478        </para>
  10479                      
  10480       </remarks>
  10481               
  10482      </member>
  10483              
  10484      <member 
  10485       name="P:Io nic.Zip.Zi pEntry.Com ment"
  10486      >
  10487                     
  10488       <summary>
  10489                      The com ment attac hed to the  ZipEntry.
  10490                      
  10491       </summary>
  10492                    
  10493                     
  10494       <remarks>
  10495                      
  10496        <para>
  10497                         Each  entry in a  zip file  can option ally have  a comment  associated  to
  10498                         it. T he comment  might be  displayed  by a zip t ool during  extractio n, for
  10499                         examp le.
  10500                       
  10501        </para>
  10502                     
  10503                      
  10504        <para>
  10505                         By de fault, the  
  10506         <c>
  10507          Comment
  10508         </c>
  10509          is encode d in IBM43 7 code pag e. You can
  10510                         speci fy an alte rnative wi th 
  10511         <see 
  10512          cref="P:Io nic.Zip.Zi pEntry.Alt ernateEnco ding"
  10513         />
  10514          and
  10515                        
  10516         <see 
  10517          cref="P:Io nic.Zip.Zi pEntry.Alt ernateEnco dingUsage"
  10518         />
  10519         .
  10520                       
  10521        </para>
  10522                      
  10523       </remarks>
  10524                     
  10525       <seealso 
  10526        cref="P:Io nic.Zip.Zi pEntry.Alt ernateEnco ding"
  10527       />
  10528                     
  10529       <seealso 
  10530        cref="P:Io nic.Zip.Zi pEntry.Alt ernateEnco dingUsage"
  10531       />
  10532               
  10533      </member>
  10534              
  10535      <member 
  10536       name="P:Io nic.Zip.Zi pEntry.Req uiresZip64 "
  10537      >
  10538                     
  10539       <summary>
  10540                      Indicat es whether  the entry  requires  ZIP64 exte nsions.
  10541                      
  10542       </summary>
  10543                    
  10544                     
  10545       <remarks>
  10546                     
  10547                      
  10548        <para>
  10549                         This  property i s null (No thing in V B) until a  
  10550         <c>
  10551          Save()
  10552         </c>
  10553          method on  the
  10554                         conta ining 
  10555         <see 
  10556          cref="T:Io nic.Zip.Zi pFile"
  10557         />
  10558          instance  has been c alled. The  property  is
  10559                         non-n ull (
  10560         <c>
  10561          HasValue
  10562         </c>
  10563          is true)  only after  a 
  10564         <c>
  10565          Save()
  10566         </c>
  10567          method ha s
  10568                         been  called.
  10569                       
  10570        </para>
  10571                     
  10572                      
  10573        <para>
  10574                         After  the conta ining 
  10575         <c>
  10576          ZipFile
  10577         </c>
  10578          has been  saved, the  Value of  this
  10579                         prope rty is tru e if any o f the foll owing thre e conditio ns holds:  the
  10580                         uncom pressed si ze of the  entry is l arger than  0xFFFFFFF F; the com pressed
  10581                         size  of the ent ry is larg er than 0x FFFFFFFF;  the relati ve offset  of the
  10582                         entry  within th e zip arch ive is lar ger than 0 xFFFFFFFF.   These qu antities
  10583                         are n ot known u ntil a 
  10584         <c>
  10585          Save()
  10586         </c>
  10587          is attemp ted on the  zip archi ve and
  10588                         the c ompression  is applie d.
  10589                       
  10590        </para>
  10591                     
  10592                      
  10593        <para>
  10594                         If no ne of the  three cond itions hol ds, then t he 
  10595         <c>
  10596          Value
  10597         </c>
  10598          is false.
  10599                       
  10600        </para>
  10601                     
  10602                      
  10603        <para>
  10604                         A 
  10605         <c>
  10606          Value
  10607         </c>
  10608          of false  does not i ndicate th at the ent ry, as sav ed in the
  10609                         zip a rchive, do es not use  ZIP64.  I t merely i ndicates t hat ZIP64  is
  10610                         
  10611         <em>
  10612          not requir ed
  10613         </em>
  10614         .  An entr y may use  ZIP64 even  when not  required i f
  10615                         the 
  10616         <see 
  10617          cref="P:Io nic.Zip.Zi pFile.UseZ ip64WhenSa ving"
  10618         />
  10619          property  on the con taining
  10620                         
  10621         <c>
  10622          ZipFile
  10623         </c>
  10624          instance  is set to 
  10625         <see 
  10626          cref="F:Io nic.Zip.Zi p64Option. Always"
  10627         />
  10628         , or if
  10629                         the 
  10630         <see 
  10631          cref="P:Io nic.Zip.Zi pFile.UseZ ip64WhenSa ving"
  10632         />
  10633          property  on the con taining
  10634                         
  10635         <c>
  10636          ZipFile
  10637         </c>
  10638          instance  is set to 
  10639         <see 
  10640          cref="F:Io nic.Zip.Zi p64Option. AsNecessar y"
  10641         />
  10642                         and t he output  stream was  not seeka ble.
  10643                       
  10644        </para>
  10645                     
  10646                      
  10647       </remarks>
  10648                     
  10649       <seealso 
  10650        cref="P:Io nic.Zip.Zi pEntry.Out putUsedZip 64"
  10651       />
  10652               
  10653      </member>
  10654              
  10655      <member 
  10656       name="P:Io nic.Zip.Zi pEntry.Out putUsedZip 64"
  10657      >
  10658                     
  10659       <summary>
  10660                        Indic ates wheth er the ent ry actuall y used ZIP 64 extensi ons, as it  was most
  10661                        recen tly writte n to the o utput file  or stream .
  10662                      
  10663       </summary>
  10664                    
  10665                     
  10666       <remarks>
  10667                     
  10668                      
  10669        <para>
  10670                         This  Nullable p roperty is  null (Not hing in VB ) until a 
  10671         <c>
  10672          Save()
  10673         </c>
  10674                         metho d on the c ontaining 
  10675         <see 
  10676          cref="T:Io nic.Zip.Zi pFile"
  10677         />
  10678          instance  has been
  10679                         calle d. 
  10680         <c>
  10681          HasValue
  10682         </c>
  10683          is true o nly after 
  10684         <c>
  10685          Save()
  10686         </c>
  10687          method ha s been
  10688                         calle d.
  10689                       
  10690        </para>
  10691                     
  10692                      
  10693        <para>
  10694                         The v alue of th is propert y for a pa rticular 
  10695         <c>
  10696          ZipEntry
  10697         </c>
  10698          may chang e
  10699                         over  successive  calls to 
  10700         <c>
  10701          Save()
  10702         </c>
  10703          methods o n the cont aining Zip File,
  10704                         even  if the fil e that cor responds t o the 
  10705         <c>
  10706          ZipEntry
  10707         </c>
  10708          does not.  This
  10709                         may h appen if o ther entri es contain ed in the 
  10710         <c>
  10711          ZipFile
  10712         </c>
  10713          expand,
  10714                         causi ng the off set for th is particu lar entry  to exceed  0xFFFFFFFF .
  10715                       
  10716        </para>
  10717                      
  10718       </remarks>
  10719                     
  10720       <seealso 
  10721        cref="P:Io nic.Zip.Zi pEntry.Req uiresZip64 "
  10722       />
  10723               
  10724      </member>
  10725              
  10726      <member 
  10727       name="P:Io nic.Zip.Zi pEntry.Bit Field"
  10728      >
  10729                     
  10730       <summary>
  10731                        The b itfield fo r the entr y as defin ed in the  zip spec.  You probab ly
  10732                        never  need to l ook at thi s.
  10733                      
  10734       </summary>
  10735                    
  10736                     
  10737       <remarks>
  10738                      
  10739        <para>
  10740                         You p robably do  not need  to concern  yourself  with the c ontents of  this
  10741                         prope rty, but i n case you  do:
  10742                       
  10743        </para>
  10744                     
  10745                      
  10746        <list 
  10747         type="tabl e"
  10748        >
  10749                       
  10750         <listheade r>
  10751                        
  10752          <term>
  10753           bit
  10754          </term>
  10755                        
  10756          <descripti on>
  10757           meaning
  10758          </descript ion>
  10759                        
  10760         </listhead er>
  10761                      
  10762                       
  10763         <item>
  10764                        
  10765          <term>
  10766           0
  10767          </term>
  10768                        
  10769          <descripti on>
  10770           set if enc ryption is  used.
  10771          </descript ion>
  10772                        
  10773         </item>
  10774                      
  10775                       
  10776         <item>
  10777                        
  10778          <term>
  10779           1-2
  10780          </term>
  10781                        
  10782          <descripti on>
  10783                         set to  determine  whether no rmal, max,  fast defl ation.  Do tNetZip li brary
  10784                         always  leaves the se bits un set when w riting (in dicating " normal"
  10785                         deflati on"), but  can read a n entry wi th any val ue here.
  10786                         
  10787          </descript ion>
  10788                        
  10789         </item>
  10790                      
  10791                       
  10792         <item>
  10793                        
  10794          <term>
  10795           3
  10796          </term>
  10797                        
  10798          <descripti on>
  10799                         Indicat es that th e Crc32, C ompressed  and Uncomp ressed siz es are zer o in the
  10800                         local h eader.  Th is bit get s set on a n entry du ring writi ng a zip f ile, when
  10801                         it is s aved to a  non-seekab le output  stream.
  10802                         
  10803          </descript ion>
  10804                        
  10805         </item>
  10806                      
  10807                      
  10808                       
  10809         <item>
  10810                        
  10811          <term>
  10812           4
  10813          </term>
  10814                        
  10815          <descripti on>
  10816           reserved f or "enhanc ed deflati ng". This  library do esn't do e nhanced de flating.
  10817          </descript ion>
  10818                        
  10819         </item>
  10820                      
  10821                       
  10822         <item>
  10823                        
  10824          <term>
  10825           5
  10826          </term>
  10827                        
  10828          <descripti on>
  10829           set to ind icate the  zip is com pressed pa tched data .  This li brary does n't do tha t.
  10830          </descript ion>
  10831                        
  10832         </item>
  10833                      
  10834                       
  10835         <item>
  10836                        
  10837          <term>
  10838           6
  10839          </term>
  10840                        
  10841          <descripti on>
  10842                         set if  PKWare's s trong encr yption is  used (must  also set  bit 1 if b it 6 is
  10843                         set). T his bit is  not set i f WinZip's  AES encry ption is s et.
  10844          </descript ion>
  10845                        
  10846         </item>
  10847                      
  10848                       
  10849         <item>
  10850                        
  10851          <term>
  10852           7
  10853          </term>
  10854                        
  10855          <descripti on>
  10856           not used
  10857          </descript ion>
  10858                        
  10859         </item>
  10860                      
  10861                       
  10862         <item>
  10863                        
  10864          <term>
  10865           8
  10866          </term>
  10867                        
  10868          <descripti on>
  10869           not used
  10870          </descript ion>
  10871                        
  10872         </item>
  10873                      
  10874                       
  10875         <item>
  10876                        
  10877          <term>
  10878           9
  10879          </term>
  10880                        
  10881          <descripti on>
  10882           not used
  10883          </descript ion>
  10884                        
  10885         </item>
  10886                      
  10887                       
  10888         <item>
  10889                        
  10890          <term>
  10891           10
  10892          </term>
  10893                        
  10894          <descripti on>
  10895           not used
  10896          </descript ion>
  10897                        
  10898         </item>
  10899                      
  10900                       
  10901         <item>
  10902                        
  10903          <term>
  10904           11
  10905          </term>
  10906                        
  10907          <descripti on>
  10908                         Languag e encoding  flag (EFS ).  If thi s bit is s et, the fi lename and  comment
  10909                         fields  for this f ile must b e encoded  using UTF- 8. This li brary curr ently
  10910                         does no t support  UTF-8.
  10911                         
  10912          </descript ion>
  10913                        
  10914         </item>
  10915                      
  10916                       
  10917         <item>
  10918                        
  10919          <term>
  10920           12
  10921          </term>
  10922                        
  10923          <descripti on>
  10924           Reserved b y PKWARE f or enhance d compress ion.
  10925          </descript ion>
  10926                        
  10927         </item>
  10928                      
  10929                       
  10930         <item>
  10931                        
  10932          <term>
  10933           13
  10934          </term>
  10935                        
  10936          <descripti on>
  10937                           Used  when encry pting the  Central Di rectory to  indicate  selected d ata
  10938                           value s in the L ocal Heade r are mask ed to hide  their act ual values .  See
  10939                           the s ection in 
  10940           <a
  10941                           
  10942            href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  10943           >
  10944            the Zip
  10945                            speci fication
  10946           </a>
  10947            describin g the Stro ng Encrypt ion Specif ication fo r
  10948                           detai ls.
  10949                         
  10950          </descript ion>
  10951                        
  10952         </item>
  10953                      
  10954                       
  10955         <item>
  10956                        
  10957          <term>
  10958           14
  10959          </term>
  10960                        
  10961          <descripti on>
  10962           Reserved b y PKWARE.
  10963          </descript ion>
  10964                        
  10965         </item>
  10966                      
  10967                       
  10968         <item>
  10969                        
  10970          <term>
  10971           15
  10972          </term>
  10973                        
  10974          <descripti on>
  10975           Reserved b y PKWARE.
  10976          </descript ion>
  10977                        
  10978         </item>
  10979                      
  10980                       
  10981        </list>
  10982                     
  10983                      
  10984       </remarks>
  10985               
  10986      </member>
  10987              
  10988      <member 
  10989       name="P:Io nic.Zip.Zi pEntry.Com pressionMe thod"
  10990      >
  10991                     
  10992       <summary>
  10993                        The c ompression  method em ployed for  this ZipE ntry.
  10994                      
  10995       </summary>
  10996                    
  10997                     
  10998       <remarks>
  10999                     
  11000                      
  11001        <para>
  11002                         
  11003         <see 
  11004          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  11005         >
  11006          The
  11007                          Zip s pecificati on
  11008         </see>
  11009          allows a  variety of  compressi on methods .  This
  11010                         libra ry support s just two : 0x08 = D eflate.  0 x00 = Stor e (no comp ression),
  11011                         for r eading or  writing.
  11012                       
  11013        </para>
  11014                     
  11015                      
  11016        <para>
  11017                         When  reading an  entry fro m an exist ing zipfil e, the val ue you ret rieve
  11018                         here  indicates  the compre ssion meth od used on  the entry  by the or iginal
  11019                         creat or of the  zip.  When  writing a  zipfile,  you can sp ecify eith er 0x08
  11020                         (Defl ate) or 0x 00 (None).   If you t ry setting  something  else, you  will get
  11021                         an ex ception.
  11022                       
  11023        </para>
  11024                     
  11025                      
  11026        <para>
  11027                         You m ay wish to  set 
  11028         <c>
  11029          Compressio nMethod
  11030         </c>
  11031          to 
  11032         <c>
  11033          Compressio nMethod.No ne
  11034         </c>
  11035          (0)
  11036                         when  zipping al ready-comp ressed dat a like a j pg, png, o r mp3 file .
  11037                         This  can save t ime and cp u cycles.
  11038                       
  11039        </para>
  11040                     
  11041                      
  11042        <para>
  11043                         When  setting th is propert y on a 
  11044         <c>
  11045          ZipEntry
  11046         </c>
  11047          that is r ead from a n
  11048                         exist ing zip fi le, callin
  11049         <c>
  11050          ZipFile.Sa ve()
  11051         </c>
  11052          will caus e the new
  11053                         Compr essionMeth od to be u sed on the  entry in  the newly  saved zip  file.
  11054                       
  11055        </para>
  11056                     
  11057                      
  11058        <para>
  11059                         Setti ng this pr operty may  have the  side effec t of modif ying the
  11060                         
  11061         <c>
  11062          Compressio nLevel
  11063         </c>
  11064          property.  If you se t the 
  11065         <c>
  11066          Compressio nMethod
  11067         </c>
  11068          to a
  11069                         value  other tha
  11070         <c>
  11071          None
  11072         </c>
  11073         , and 
  11074         <c>
  11075          Compressio nLevel
  11076         </c>
  11077          is previo usly
  11078                         set t
  11079         <c>
  11080          None
  11081         </c>
  11082         , then 
  11083         <c>
  11084          Compressio nLevel
  11085         </c>
  11086          will be s et to
  11087                         
  11088         <c>
  11089          Default
  11090         </c>
  11091         .
  11092                       
  11093        </para>
  11094                      
  11095       </remarks>
  11096                    
  11097                     
  11098       <seealso 
  11099        cref="P:Io nic.Zip.Zi pEntry.Com pressionMe thod"
  11100       />
  11101                    
  11102                     
  11103       <example>
  11104                        In th is example , the firs t entry ad ded to the  zip archi ve uses th e default
  11105                        behav ior - comp ression is  used wher e it makes  sense.  T he second  entry,
  11106                        the M P3 file, i s added to  the archi ve without  being com pressed.
  11107                      
  11108        <code>
  11109                       using ( ZipFile zi p = new Zi pFile(ZipF ileToCreat e))
  11110                       {
  11111                         ZipEn try e1= zi p.AddFile( @"notes\Re adme.txt") ;
  11112                         ZipEn try e2= zi p.AddFile( @"music\St opThisTrai n.mp3");
  11113                         e2.Co mpressionM ethod = Co mpressionM ethod.None ;
  11114                         zip.S ave();
  11115                       }
  11116                       
  11117        </code>
  11118                     
  11119                      
  11120        <code 
  11121         lang="VB"
  11122        >
  11123                       Using z ip As New  ZipFile(Zi pFileToCre ate)
  11124                         zip.A ddFile("no tes\Readme .txt")
  11125                         Dim e 2 as ZipEn try = zip. AddFile("m usic\StopT hisTrain.m p3")
  11126                         e2.Co mpressionM ethod = Co mpressionM ethod.None
  11127                         zip.S ave
  11128                       End Usi ng
  11129                       
  11130        </code>
  11131                      
  11132       </example>
  11133               
  11134      </member>
  11135              
  11136      <member 
  11137       name="P:Io nic.Zip.Zi pEntry.Com pressionLe vel"
  11138      >
  11139                     
  11140       <summary>
  11141                        Sets  the compre ssion leve l to be us ed for the  entry whe n saving t he zip
  11142                        archi ve. This a pplies onl y for Comp ressionMet hod = DEFL ATE.
  11143                      
  11144       </summary>
  11145                    
  11146                     
  11147       <remarks>
  11148                       
  11149        <para>
  11150                          When  using the  DEFLATE c ompression  method, V arying the  compressi on
  11151                          leve l used on  entries ca n affect t he size-vs -speed tra deoff when
  11152                          comp ression an d decompre ssing data  streams o r files.
  11153                        
  11154        </para>
  11155                     
  11156                       
  11157        <para>
  11158                          If y ou do not  set this p roperty, t he default  compressi on level i s used,
  11159                          whic h normally  gives a g ood balanc e of compr ession eff iciency an d
  11160                          comp ression sp eed.  In s ome tests,  using 
  11161         <c>
  11162          BestCompre ssion
  11163         </c>
  11164          can
  11165                          doub le the tim e it takes  to compre ss, while  delivering  just a sm all
  11166                          incr ease in co mpression  efficiency .  This be havior wil l vary wit h the
  11167                          type  of data y ou compres s.  If you  are in do ubt, just  leave this  setting
  11168                          alon e, and acc ept the de fault.
  11169                        
  11170        </para>
  11171                     
  11172                       
  11173        <para>
  11174                          When  setting t his proper ty on a 
  11175         <c>
  11176          ZipEntry
  11177         </c>
  11178          that is r ead from a n
  11179                          exis ting zip f ile, calli ng 
  11180         <c>
  11181          ZipFile.Sa ve()
  11182         </c>
  11183          will caus e the new
  11184                          
  11185         <c>
  11186          Compressio nLevel
  11187         </c>
  11188          to be use d on the e ntry in th e newly sa ved zip fi le.
  11189                        
  11190        </para>
  11191                     
  11192                       
  11193        <para>
  11194                          Sett ing this p roperty ma y have the  side effe ct of modi fying the
  11195                          
  11196         <c>
  11197          Compressio nMethod
  11198         </c>
  11199          property.  If you se t the 
  11200         <c>
  11201          Compressio nLevel
  11202         </c>
  11203                          to a  value oth er than 
  11204         <c>
  11205          None
  11206         </c>
  11207        
  11208         <c>
  11209          Compressio nMethod
  11210         </c>
  11211          will be s et
  11212                          to 
  11213         <c>
  11214          Deflate
  11215         </c>
  11216         , if it wa s previous ly 
  11217         <c>
  11218          None
  11219         </c>
  11220         .
  11221                        
  11222        </para>
  11223                     
  11224                       
  11225        <para>
  11226                          Sett ing this p roperty ha s no effec t if the 
  11227         <c>
  11228          Compressio nMethod
  11229         </c>
  11230          is someth ing
  11231                          othe r than 
  11232         <c>
  11233          Deflate
  11234         </c>
  11235          or 
  11236         <c>
  11237          None
  11238         </c>
  11239         .
  11240                        
  11241        </para>
  11242                      
  11243       </remarks>
  11244                    
  11245                     
  11246       <seealso 
  11247        cref="P:Io nic.Zip.Zi pEntry.Com pressionMe thod"
  11248       />
  11249               
  11250      </member>
  11251              
  11252      <member 
  11253       name="P:Io nic.Zip.Zi pEntry.Com pressedSiz e"
  11254      >
  11255                     
  11256       <summary>
  11257                        The c ompressed  size of th e file, in  bytes, wi thin the z ip archive .
  11258                      
  11259       </summary>
  11260                    
  11261                     
  11262       <remarks>
  11263                        When  reading a 
  11264        <c>
  11265         ZipFile
  11266        </c>
  11267        , this val ue is read  in from t he existin g
  11268                        zip f ile. When  creating o r updating  a 
  11269        <c>
  11270         ZipFile
  11271        </c>
  11272        , the comp ressed
  11273                        size  is compute d during c ompression .  Therefo re the val ue on a
  11274                        
  11275        <c>
  11276         ZipEntry
  11277        </c>
  11278         is valid  after a ca ll to 
  11279        <c>
  11280         Save()
  11281        </c>
  11282         (or one o f its
  11283                        overl oads) in t hat case.
  11284                      
  11285       </remarks>
  11286                    
  11287                     
  11288       <seealso 
  11289        cref="P:Io nic.Zip.Zi pEntry.Unc ompressedS ize"
  11290       />
  11291               
  11292      </member>
  11293              
  11294      <member 
  11295       name="P:Io nic.Zip.Zi pEntry.Unc ompressedS ize"
  11296      >
  11297                     
  11298       <summary>
  11299                        The s ize of the  file, in  bytes, bef ore compre ssion, or  after extr action.
  11300                      
  11301       </summary>
  11302                    
  11303                     
  11304       <remarks>
  11305                        When  reading a 
  11306        <c>
  11307         ZipFile
  11308        </c>
  11309        , this val ue is read  in from t he existin g
  11310                        zip f ile. When  creating o r updating  a 
  11311        <c>
  11312         ZipFile
  11313        </c>
  11314        , the unco mpressed
  11315                        size  is compute d during c ompression .  Therefo re the val ue on a
  11316                        
  11317        <c>
  11318         ZipEntry
  11319        </c>
  11320         is valid  after a ca ll to 
  11321        <c>
  11322         Save()
  11323        </c>
  11324         (or one o f its
  11325                        overl oads) in t hat case.
  11326                      
  11327       </remarks>
  11328                    
  11329                     
  11330       <seealso 
  11331        cref="P:Io nic.Zip.Zi pEntry.Com pressedSiz e"
  11332       />
  11333               
  11334      </member>
  11335              
  11336      <member 
  11337       name="P:Io nic.Zip.Zi pEntry.Com pressionRa tio"
  11338      >
  11339                     
  11340       <summary>
  11341                      The rat io of comp ressed siz e to uncom pressed si ze of the  ZipEntry.
  11342                      
  11343       </summary>
  11344                    
  11345                     
  11346       <remarks>
  11347                      
  11348        <para>
  11349                         This  is a ratio  of the co mpressed s ize to the  uncompres sed size o f the
  11350                         entry , expresse d as a dou ble in the  range of  0 to 100+.  A value o f 100
  11351                         indic ates no co mpression  at all.  I t could be  higher th an 100 whe n the
  11352                         compr ession alg orithm act ually infl ates the d ata, as ma y occur fo r small
  11353                         files , or uncom pressible  data that  is encrypt ed.
  11354                       
  11355        </para>
  11356                     
  11357                      
  11358        <para>
  11359                         You c ould forma t it for p resentatio n to a use r via a fo rmat strin g of
  11360                         "{3,5 :F0}%" to  see it as  a percenta ge.
  11361                       
  11362        </para>
  11363                     
  11364                      
  11365        <para>
  11366                         If th e size of  the origin al uncompr essed file  is 0, imp lying a
  11367                         denom inator of  0, the ret urn value  will be ze ro.
  11368                       
  11369        </para>
  11370                     
  11371                      
  11372        <para>
  11373                         This  property i s valid af ter readin g in an ex isting zip  file, or  after
  11374                         savin g the 
  11375         <c>
  11376          ZipFile
  11377         </c>
  11378          that cont ains the Z ipEntry. Y ou cannot  know the
  11379                         effec t of a com pression t ransform u ntil you t ry it.
  11380                       
  11381        </para>
  11382                     
  11383                      
  11384       </remarks>
  11385               
  11386      </member>
  11387              
  11388      <member 
  11389       name="P:Io nic.Zip.Zi pEntry.Crc "
  11390      >
  11391                     
  11392       <summary>
  11393                      The 32- bit CRC (C yclic Redu ndancy Che ck) on the  contents  of the Zip Entry.
  11394                      
  11395       </summary>
  11396                    
  11397                     
  11398       <remarks>
  11399                     
  11400                      
  11401        <para>
  11402          You proba bly don't  need to co ncern your self with  this. It i s used
  11403                       interna lly by Dot NetZip to  verify fil es or stre ams upon e xtraction.   
  11404        </para>
  11405                     
  11406                      
  11407        <para>
  11408          The value  is a 
  11409         <see 
  11410          href="http ://en.wiki pedia.org/ wiki/CRC32 "
  11411         >
  11412          32-bit
  11413                        CRC
  11414         </see>
  11415          using 0xE DB88320 fo r the poly nomial. Th is is the  same CRC-3 2 used in
  11416                       PNG, MP EG-2, and  other prot ocols and  formats.   It is a re ad-only pr operty; wh en
  11417                       creatin g a Zip ar chive, the  CRC for e ach entry  is set onl y after a  call to
  11418                       
  11419         <c>
  11420          Save()
  11421         </c>
  11422          on the co ntaining Z ipFile. Wh en reading  an existi ng zip fil e, the val ue
  11423                       of this  property  reflects t he stored  CRC for th e entry.  
  11424        </para>
  11425                     
  11426                      
  11427       </remarks>
  11428               
  11429      </member>
  11430              
  11431      <member 
  11432       name="P:Io nic.Zip.Zi pEntry.IsD irectory"
  11433      >
  11434                    
  11435       <summary>
  11436                     True if  the entry  is a direc tory (not  a file).
  11437                     This is  a readonly  property  on the ent ry.
  11438                     
  11439       </summary>
  11440               
  11441      </member>
  11442              
  11443      <member 
  11444       name="P:Io nic.Zip.Zi pEntry.Use sEncryptio n"
  11445      >
  11446                     
  11447       <summary>
  11448                      A deriv ed propert y that is 
  11449        <c>
  11450         true
  11451        </c>
  11452         if the en try uses e ncryption.
  11453                      
  11454       </summary>
  11455                    
  11456                     
  11457       <remarks>
  11458                      
  11459        <para>
  11460                         This  is a reado nly proper ty on the  entry.  Wh en reading  a zip fil e,
  11461                         the v alue for t he 
  11462         <c>
  11463          ZipEntry
  11464         </c>
  11465          is determ ined by th e data rea d
  11466                         from  the zip fi le.  After  saving a  ZipFile, t he value o f this
  11467                         prope rty for ea ch 
  11468         <c>
  11469          ZipEntry
  11470         </c>
  11471          indicates  whether e ncryption  was
  11472                         actua lly used ( which will  have been  true if t he 
  11473         <see 
  11474          cref="P:Io nic.Zip.Zi pEntry.Pas sword"
  11475         />
  11476          was set a nd the 
  11477         <see 
  11478          cref="P:Io nic.Zip.Zi pEntry.Enc ryption"
  11479         />
  11480          property
  11481                         was s omething o ther than 
  11482         <see 
  11483          cref="F:Io nic.Zip.En cryptionAl gorithm.No ne"
  11484         />
  11485         .
  11486                       
  11487        </para>
  11488                      
  11489       </remarks>
  11490               
  11491      </member>
  11492              
  11493      <member 
  11494       name="P:Io nic.Zip.Zi pEntry.Enc ryption"
  11495      >
  11496                     
  11497       <summary>
  11498                        Set t his to spe cify which  encryptio n algorith m to use f or the ent ry when
  11499                        savin g it to a  zip archiv e.
  11500                      
  11501       </summary>
  11502                    
  11503                     
  11504       <remarks>
  11505                     
  11506                      
  11507        <para>
  11508                         Set t his proper ty in orde r to encry pt the ent ry when th
  11509         <c>
  11510          ZipFile
  11511         </c>
  11512          is
  11513                         saved . When set ting this  property,  you must a lso set a 
  11514         <see 
  11515          cref="P:Io nic.Zip.Zi pEntry.Pas sword"
  11516         />
  11517          on the en try.  If y ou set a v alue other  than 
  11518         <see 
  11519          cref="F:Io nic.Zip.En cryptionAl gorithm.No ne"
  11520         />
  11521          on this p roperty an d do not s et a
  11522                         
  11523         <c>
  11524          Password
  11525         </c>
  11526          then the  entry will  not be en crypted. T he 
  11527         <c>
  11528          ZipEntry
  11529         </c>
  11530                         data  is encrypt ed as the 
  11531         <c>
  11532          ZipFile
  11533         </c>
  11534          is saved,  when you  call 
  11535         <see 
  11536          cref="M:Io nic.Zip.Zi pFile.Save "
  11537         />
  11538          or one of  its cousi ns on the  containing
  11539                         
  11540         <c>
  11541          ZipFile
  11542         </c>
  11543          instance.  You do no t need to  specify th
  11544         <c>
  11545          Encryption
  11546         </c>
  11547                         when  extracting  entries f rom an arc hive.
  11548                       
  11549        </para>
  11550                     
  11551                      
  11552        <para>
  11553                         The Z ip specifi cation fro m PKWare d efines a s et of encr yption alg orithms,
  11554                         and t he data fo rmats for  the zip ar chive that  support t hem, and P KWare
  11555                         suppo rts those  algorithms  in the to ols it pro duces. Oth er vendors  of tools
  11556                         and l ibraries,  such as Wi nZip or Xc eed, typic ally suppo rt 
  11557         <em>
  11558          a
  11559                          subse t
  11560         </em>
  11561          of the al gorithms s pecified b y PKWare.  These tool s can
  11562                         somet imes suppo rt additio nal differ ent encryp tion algor ithms and  data
  11563                         forma ts, not sp ecified by  PKWare. T he AES Enc ryption sp ecified an d
  11564                         suppo rted by Wi nZip is th e most pop ular examp le. This l ibrary sup ports a
  11565                         subse t of the c omplete se t of algor ithms spec ified by P KWare and  other
  11566                         vendo rs.
  11567                       
  11568        </para>
  11569                     
  11570                      
  11571        <para>
  11572                         There  is no com mon, ubiqu itous mult i-vendor s tandard fo r strong e ncryption
  11573                         withi n zip file s. There i s broad su pport for  so-called  "tradition al" Zip
  11574                         encry ption, som etimes cal led Zip 2. 0 encrypti on, as 
  11575         <see 
  11576          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  11577         >
  11578          specified
  11579                          by PK Ware
  11580         </see>
  11581         , but this  encryptio n is consi dered weak  and
  11582                         break able. This  library c urrently s upports th e Zip 2.0  "weak" enc ryption,
  11583                         and a lso a stro nger WinZi p-compatib le AES enc ryption, u sing eithe r 128-bit
  11584                         or 25 6-bit key  strength.  If you wan t DotNetZi p to suppo rt an algo rithm
  11585                         that  is not cur rently sup ported, ca ll the aut hor of thi s library  and maybe
  11586                         we ca n talk bus iness.
  11587                       
  11588        </para>
  11589                     
  11590                      
  11591        <para>
  11592                         The 
  11593         <see 
  11594          cref="T:Io nic.Zip.Zi pFile"
  11595         />
  11596          class als o has a 
  11597         <see 
  11598          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  11599         />
  11600          property.   In most  cases you  will use
  11601                         
  11602         <em>
  11603          that
  11604         </em>
  11605          property  when setti ng encrypt ion. This  property t akes
  11606                         prece dence over  any 
  11607         <c>
  11608          Encryption
  11609         </c>
  11610          set on th
  11611         <c>
  11612          ZipFile
  11613         </c>
  11614          itself.
  11615                         Typic ally, you  would use  the per-en try Encryp tion when  most entri es in the
  11616                         zip a rchive use  one encry ption algo rithm, and  a few ent ries use a
  11617                         diffe rent one.   If all en tries in t he zip fil e use the  same Encry ption,
  11618                         then  it is simp ler to jus t set this  property  on the Zip File itsel f, when
  11619                         creat ing a zip  archive.
  11620                       
  11621        </para>
  11622                     
  11623                      
  11624        <para>
  11625                         Some  comments o n updating  archives:  If you re ad a 
  11626         <c>
  11627          ZipFile
  11628         </c>
  11629         , you can
  11630                         modif y the Encr yption on  an encrypt ed entry:  you can re move encry ption
  11631                         from  an entry t hat was en crypted; y ou can enc rypt an en try that w as not
  11632                         encry pted previ ously; or,  you can c hange the  encryption  algorithm .  The
  11633                         chang es in encr yption are  not made  permanent  until you  call Save( ) on the
  11634                         
  11635         <c>
  11636          ZipFile
  11637         </c>
  11638         .  To effe ct changes  in encryp tion, the  entry cont ent is
  11639                         strea med throug h several  transforma tions, dep ending on  the modifi cation
  11640                         the a pplication  has reque sted. For  example if  the entry  is not en crypted
  11641                         and t he applica tion sets 
  11642         <c>
  11643          Encryption
  11644         </c>
  11645          to 
  11646         <c>
  11647          PkzipWeak
  11648         </c>
  11649         , then at
  11650                         the t ime of 
  11651         <c>
  11652          Save()
  11653         </c>
  11654         , the orig inal entry  is read a nd decompr essed,
  11655                         then  re-compres sed and en crypted.   Conversely , if the o riginal en try is
  11656                         encry pted with 
  11657         <c>
  11658          PkzipWeak
  11659         </c>
  11660          encryptio n, and the  applicati on sets th e
  11661                         
  11662         <c>
  11663          Encryption
  11664         </c>
  11665          property  to 
  11666         <c>
  11667          WinZipAes1 28
  11668         </c>
  11669         , then at  the time o f
  11670                         
  11671         <c>
  11672          Save()
  11673         </c>
  11674         , the orig inal entry  is decryp ted via PK ZIP encryp tion and
  11675                         decom pressed, t hen re-com pressed an d re-encry pted with  AES.  This  all
  11676                         happe ns automat ically wit hin the li brary, but  it can be  time-cons uming for
  11677                         large  entries.
  11678                       
  11679        </para>
  11680                     
  11681                      
  11682        <para>
  11683                         Addit ionally, w hen updati ng archive s, it is n ot possibl e to chang e the
  11684                         passw ord when c hanging th e encrypti on algorit hm.  To ch ange both  the
  11685                         algor ithm and t he passwor d, you nee d to Save( ) the zipf ile twice.   First
  11686                         set t he 
  11687         <c>
  11688          Encryption
  11689         </c>
  11690          to None,  then call 
  11691         <c>
  11692          Save()
  11693         </c>
  11694         .  Then se t the
  11695                         
  11696         <c>
  11697          Encryption
  11698         </c>
  11699          to the ne w value (n ot "None") , then cal
  11700         <c>
  11701          Save()
  11702         </c>
  11703                         once  again.
  11704                       
  11705        </para>
  11706                     
  11707                      
  11708        <para>
  11709                         The W inZip AES  encryption  algorithm s are not  supported  on the .NE T Compact
  11710                         Frame work.
  11711                       
  11712        </para>
  11713                      
  11714       </remarks>
  11715                    
  11716                     
  11717       <example>
  11718                      
  11719        <para>
  11720                         This  example cr eates a zi p archive  that uses  encryption , and then  extracts
  11721                         entri es from th e archive.   When cre ating the  zip archiv e, the Rea dMe.txt
  11722                         file  is zipped  without us ing a pass word or en cryption.   The other  file
  11723                         uses  encryption .
  11724                       
  11725        </para>
  11726                      
  11727        <code>
  11728                       // Crea te a zip a rchive wit h AES Encr yption.
  11729                       using ( ZipFile zi p = new Zi pFile())
  11730                       {
  11731                           zip .AddFile(" ReadMe.txt ")
  11732                           Zip Entry e1=  zip.AddFil e("2008-Re gional-Sal es-Report. pdf");
  11733                           e1. Encryption = Encrypti onAlgorith m.WinZipAe s256;
  11734                           e1. Password=  "Top.Secre t.No.Peeki ng!";
  11735                           zip .Save("Enc ryptedArch ive.zip");
  11736                       }
  11737                      
  11738                       // Extr act a zip  archive th at uses AE S Encrypti on.
  11739                       // You  do not nee d to speci fy the alg orithm dur ing extrac tion.
  11740                       using ( ZipFile zi p = ZipFil e.Read("En cryptedArc hive.zip") )
  11741                       {
  11742                           //  Specify th e password  that is u sed during  extractio n, for
  11743                           //  all entrie s that req uire a pas sword:
  11744                           zip .Password=  "Top.Secr et.No.Peek ing!";
  11745                           zip .ExtractAl l("extract Directory" );
  11746                       }
  11747                       
  11748        </code>
  11749                     
  11750                      
  11751        <code 
  11752         lang="VB"
  11753        >
  11754                       ' Creat e a zip th at uses En cryption.
  11755                       Using z ip As New  ZipFile()
  11756                           zip .AddFile(" ReadMe.txt ")
  11757                           Dim  e1 as Zip Entry
  11758                           e1=  zip.AddFi le("2008-R egional-Sa les-Report .pdf")
  11759                           e1. Encryption = Encrypti onAlgorith m.WinZipAe s256
  11760                           e1. Password=  "Top.Secre t.No.Peeki ng!"
  11761                           zip .Save("Enc ryptedArch ive.zip")
  11762                       End Usi ng
  11763                      
  11764                       ' Extra ct a zip a rchive tha t uses AES  Encryptio n.
  11765                       ' You d o not need  to specif y the algo rithm duri ng extract ion.
  11766                       Using ( zip as Zip File = Zip File.Read( "Encrypted Archive.zi p"))
  11767                           ' S pecify the  password  that is us ed during  extraction , for
  11768                           ' a ll entries  that requ ire a pass word:
  11769                           zip .Password=  "Top.Secr et.No.Peek ing!"
  11770                           zip .ExtractAl l("extract Directory" )
  11771                       End Usi ng
  11772                       
  11773        </code>
  11774                     
  11775                      
  11776       </example>
  11777                    
  11778                     
  11779       <exception  
  11780        cref="T:Sy stem.Inval idOperatio nException "
  11781       >
  11782                      Thrown  in the set ter if Enc ryptionAlg orithm.Uns upported i s specifie d.
  11783                      
  11784       </exceptio n>
  11785                    
  11786                     
  11787       <seealso 
  11788        cref="P:Io nic.Zip.Zi pEntry.Pas sword"
  11789       >
  11790        ZipEntry.P assword
  11791       </seealso>
  11792                     
  11793       <seealso 
  11794        cref="P:Io nic.Zip.Zi pFile.Encr yption"
  11795       >
  11796        ZipFile.En cryption
  11797       </seealso>
  11798               
  11799      </member>
  11800              
  11801      <member 
  11802       name="P:Io nic.Zip.Zi pEntry.Pas sword"
  11803      >
  11804                     
  11805       <summary>
  11806                      The Pas sword to b e used whe n encrypti ng a 
  11807        <c>
  11808         ZipEntry
  11809        </c>
  11810         upon
  11811                      
  11812        <c>
  11813         ZipFile.Sa ve()
  11814        </c>
  11815        , or when  decrypting  an entry  upon Extra ct().
  11816                      
  11817       </summary>
  11818                    
  11819                     
  11820       <remarks>
  11821                      
  11822        <para>
  11823                         This  is a write -only prop erty on th e entry. S et this to  request t hat the
  11824                         entry  be encryp ted when w riting the  zip archi ve, or set  it to spe cify the
  11825                         passw ord to be  used when  extracting  an existi ng entry t hat is enc rypted.
  11826                       
  11827        </para>
  11828                     
  11829                      
  11830        <para>
  11831                         The p assword se t here is  implicitly  used to e ncrypt the  entry dur ing the
  11832                         
  11833         <see 
  11834          cref="M:Io nic.Zip.Zi pFile.Save "
  11835         />
  11836          operation , or to de crypt duri ng the 
  11837         <see 
  11838          cref="M:Io nic.Zip.Zi pEntry.Ext ract"
  11839         />
  11840          or 
  11841         <see 
  11842          cref="M:Io nic.Zip.Zi pEntry.Ope nReader"
  11843         />
  11844          operation .  If you  set
  11845                         the P assword on  a 
  11846         <c>
  11847          ZipEntry
  11848         </c>
  11849          after cal ling 
  11850         <c>
  11851          Save()
  11852         </c>
  11853         , there is  no
  11854                         effec t.
  11855                       
  11856        </para>
  11857                     
  11858                      
  11859        <para>
  11860                         Consi der settin g the 
  11861         <see 
  11862          cref="P:Io nic.Zip.Zi pEntry.Enc ryption"
  11863         />
  11864          property  when using  a
  11865                         passw ord. Answe ring conce rns that t he standar d password  protectio n
  11866                         suppo rted by al l zip tool s is weak,  WinZip ha s extended  the ZIP
  11867                         speci fication w ith a way  to use AES  Encryptio n to prote ct entries  in the
  11868                         Zip f ile. Unlik e the "PKZ IP 2.0" en cryption s pecified i n the PKZI P
  11869                         speci fication, 
  11870         <see 
  11871          href="http ://en.wiki pedia.org/ wiki/Advan ced_Encryp tion_Stand ard"
  11872         >
  11873          AES
  11874                          Encry ption
  11875         </see>
  11876          uses a st andard, st rong, test ed, encryp tion
  11877                         algor ithm. DotN etZip can  create zip  archives  that use W inZip-comp atible
  11878                         AES e ncryption,  if you se t the 
  11879         <see 
  11880          cref="P:Io nic.Zip.Zi pEntry.Enc ryption"
  11881         />
  11882          property.  But,
  11883                         archi ves create d that use  AES encry ption may  not be rea dable by a ll other
  11884                         tools  and libra ries. For  example, W indows Exp lorer cann ot read a
  11885                         "comp ressed fol der" (a zi p file) th at uses AE S encrypti on, though  it can
  11886                         read  a zip file  that uses  "PKZIP en cryption."
  11887                       
  11888        </para>
  11889                     
  11890                      
  11891        <para>
  11892                         The 
  11893         <see 
  11894          cref="T:Io nic.Zip.Zi pFile"
  11895         />
  11896          class als o has a 
  11897         <see 
  11898          cref="P:Io nic.Zip.Zi pFile.Pass word"
  11899         />
  11900                         prope rty.  This  property  takes prec edence ove r any pass word set o n the
  11901                         ZipFi le itself.   Typicall y, you wou ld use the  per-entry  Password  when most
  11902                         entri es in the  zip archiv e use one  password,  and a few  entries us e a
  11903                         diffe rent passw ord.  If a ll entries  in the zi p file use  the same  password,
  11904                         then  it is simp ler to jus t set this  property  on the Zip File itsel f,
  11905                         wheth er creatin g a zip ar chive or e xtracting  a zip arch ive.
  11906                       
  11907        </para>
  11908                     
  11909                      
  11910        <para>
  11911                         Some  comments o n updating  archives:  If you re ad a 
  11912         <c>
  11913          ZipFile
  11914         </c>
  11915         , you
  11916                         canno t modify t he passwor d on any e ncrypted e ntry, exce pt by extr acting
  11917                         the e ntry with  the origin al passwor d (if any) , removing  the origi nal entry
  11918                         via 
  11919         <see 
  11920          cref="M:Io nic.Zip.Zi pFile.Remo veEntry(Io nic.Zip.Zi pEntry)"
  11921         />
  11922         , and then  adding a  new
  11923                         entry  with a ne w Password .
  11924                       
  11925        </para>
  11926                     
  11927                      
  11928        <para>
  11929                         For e xample, su ppose you  read a 
  11930         <c>
  11931          ZipFile
  11932         </c>
  11933         , and ther e is an en crypted
  11934                         entry .  Setting  the Passw ord proper ty on that  
  11935         <c>
  11936          ZipEntry
  11937         </c>
  11938          and then
  11939                         calli ng 
  11940         <c>
  11941          Save()
  11942         </c>
  11943          on the 
  11944         <c>
  11945          ZipFile
  11946         </c>
  11947          does not  update the  password
  11948                         on th at entry i n the arch ive.  Neit her is an  exception  thrown. In stead,
  11949                         what  happens du ring the 
  11950         <c>
  11951          Save()
  11952         </c>
  11953          is the ex isting ent ry is copi ed
  11954                         throu gh to the  new zip ar chive, in  its origin al encrypt ed form. U pon
  11955                         re-re ading that  archive,  the entry  can be dec rypted wit h its orig inal
  11956                         passw ord.
  11957                       
  11958        </para>
  11959                     
  11960                      
  11961        <para>
  11962                         If yo u read a Z ipFile, an d there is  an un-enc rypted ent ry, you ca n set the
  11963                         
  11964         <c>
  11965          Password
  11966         </c>
  11967          on the en try and th en call Sa ve() on th e ZipFile,  and get
  11968                         encry ption on t hat entry.
  11969                       
  11970        </para>
  11971                     
  11972                      
  11973       </remarks>
  11974                    
  11975                     
  11976       <example>
  11977                      
  11978        <para>
  11979                         This  example cr eates a zi p file wit h two entr ies, and t hen extrac ts the
  11980                         entri es from th e zip file .  When cr eating the  zip file,  the two f iles are
  11981                         added  to the zi p file usi ng passwor d protecti on. Each e ntry uses  a
  11982                         diffe rent passw ord.  Duri ng extract ion, each  file is ex tracted wi th the
  11983                         appro priate pas sword.
  11984                       
  11985        </para>
  11986                      
  11987        <code>
  11988                       // crea te a file  with encry ption
  11989                       using ( ZipFile zi p = new Zi pFile())
  11990                       {
  11991                           Zip Entry entr y;
  11992                           ent ry= zip.Ad dFile("Dec laration.t xt");
  11993                             entry.Pass word= " AI ";
  11994                           ent ry = zip.A ddFile("Re port.xls") ;
  11995                           ent ry.Passwor d= "1Secre t!";
  11996                           zip .Save("Enc ryptedArch ive.zip");
  11997                       }
  11998                      
  11999                       // extr act entrie s that use  encryptio n
  12000                       using ( ZipFile zi p = ZipFil e.Read("En cryptedArc hive.zip") )
  12001                       {
  12002                           Zip Entry entr y;
  12003                           ent ry = zip[" Declaratio n.txt"];
  12004                             entry.Pass word = " AI ";
  12005                           ent ry.Extract ("extractD ir");
  12006                           ent ry = zip[" Report.xls "];
  12007                           ent ry.Passwor d = "1Secr et!";
  12008                           ent ry.Extract ("extractD ir");
  12009                       }
  12010                      
  12011                       
  12012        </code>
  12013                     
  12014                      
  12015        <code 
  12016         lang="VB"
  12017        >
  12018                       Using z ip As New  ZipFile
  12019                           Dim  entry as  ZipEntry
  12020                           ent ry= zip.Ad dFile("Dec laration.t xt")
  12021                             entry.Pass word= " AI "
  12022                           ent ry = zip.A ddFile("Re port.xls")
  12023                           ent ry.Passwor d= "1Secre t!"
  12024                           zip .Save("Enc ryptedArch ive.zip")
  12025                       End Usi ng
  12026                      
  12027                      
  12028                       ' extra ct entries  that use  encryption
  12029                       Using ( zip as Zip File = Zip File.Read( "Encrypted Archive.zi p"))
  12030                           Dim  entry as  ZipEntry
  12031                           ent ry = zip(" Declaratio n.txt")
  12032                             entry.Pass word = " AI "
  12033                           ent ry.Extract ("extractD ir")
  12034                           ent ry = zip(" Report.xls ")
  12035                           ent ry.Passwor d = "1Secr et!"
  12036                           ent ry.Extract ("extractD ir")
  12037                       End Usi ng
  12038                      
  12039                       
  12040        </code>
  12041                     
  12042                      
  12043       </example>
  12044                    
  12045                     
  12046       <seealso 
  12047        cref="P:Io nic.Zip.Zi pEntry.Enc ryption"
  12048       />
  12049                     
  12050       <seealso 
  12051        cref="P:Io nic.Zip.Zi pFile.Pass word"
  12052       >
  12053        ZipFile.Pa ssword
  12054       </seealso>
  12055               
  12056      </member>
  12057              
  12058      <member 
  12059       name="P:Io nic.Zip.Zi pEntry.Ext ractExisti ngFile"
  12060      >
  12061                     
  12062       <summary>
  12063                      The act ion the li brary shou ld take wh en extract ing a file  that alre ady exists .
  12064                      
  12065       </summary>
  12066                    
  12067                     
  12068       <remarks>
  12069                        
  12070        <para>
  12071                           Thi s property  affects t he behavio r of the E xtract met hods (one  of the
  12072                           
  12073         <c>
  12074          Extract()
  12075         </c>
  12076          or 
  12077         <c>
  12078          ExtractWit hPassword( )
  12079         </c>
  12080          overloads ), when
  12081                           ext raction wo uld would  overwrite  an existin g filesyst em file. I f you do
  12082                           not  set this  property,  the librar y throws a n exceptio n when ext racting
  12083                           an  entry woul d overwrit e an exist ing file.
  12084                         
  12085        </para>
  12086                     
  12087                        
  12088        <para>
  12089                           Thi s property  has no ef fect when  extracting  to a stre am, or whe n the file  to be
  12090                           ext racted doe s not alre ady exist.
  12091                         
  12092        </para>
  12093                     
  12094                      
  12095       </remarks>
  12096                     
  12097       <seealso 
  12098        cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  12099       />
  12100                    
  12101                     
  12102       <example>
  12103                        This  example sh ows how to  set the 
  12104        <c>
  12105         ExtractExi stingFile
  12106        </c>
  12107         property  in
  12108                        an 
  12109        <c>
  12110         ExtractPro gress
  12111        </c>
  12112         event, in  response  to user in put. The
  12113                        
  12114        <c>
  12115         ExtractPro gress
  12116        </c>
  12117         event is  invoked if  and only  if the
  12118                        
  12119        <c>
  12120         ExtractExi stingFile
  12121        </c>
  12122         property  was previo usly set t o
  12123                        
  12124        <c>
  12125         ExtractExi stingFileA ction.Invo keExtractP rogressEve nt
  12126        </c>
  12127        .
  12128                      
  12129        <code 
  12130         lang="C#"
  12131        >
  12132                       public  static voi d ExtractP rogress(ob ject sende r, Extract ProgressEv entArgs e)
  12133                       {
  12134                           if  (e.EventTy pe == ZipP rogressEve ntType.Ext racting_Be foreExtrac tEntry)
  12135                                Console.W riteLine(" extract {0 } ", e.Cur rentEntry. FileName);
  12136                      
  12137                           els e if (e.Ev entType ==  ZipProgre ssEventTyp e.Extracti ng_Extract EntryWould Overwrite)
  12138                           {
  12139                                ZipEntry  entry = e. CurrentEnt ry;
  12140                                string re sponse = n ull;
  12141                                // Ask th e user if  he wants o verwrite t he file
  12142                                do
  12143                                {
  12144                                    Conso le.Write(" Overwrite  {0} in {1}  ? (y/n/C)  ", entry. FileName,  e.ExtractL ocation);
  12145                                    respo nse = Cons ole.ReadLi ne();
  12146                                    Conso le.WriteLi ne();
  12147                      
  12148                                } while ( response ! = null &am p;&amp; re sponse[0]! ='Y' &amp; &amp;
  12149                                          response[0 ]!='N' &am p;&amp; re sponse[0]! ='C');
  12150                      
  12151                                if  (resp onse[0]==' C')
  12152                                    e.Can cel = true ;
  12153                                else if ( response[0 ]=='Y')
  12154                                    entry .ExtractEx istingFile  = Extract ExistingFi leAction.O verwriteSi lently;
  12155                                else
  12156                                    entry .ExtractEx istingFile = ExtractE xistingFil eAction.Do NotOverwri te;
  12157                           }
  12158                       }
  12159                       
  12160        </code>
  12161                      
  12162       </example>
  12163               
  12164      </member>
  12165              
  12166      <member 
  12167       name="P:Io nic.Zip.Zi pEntry.Zip ErrorActio n"
  12168      >
  12169                     
  12170       <summary>
  12171                        The a ction to t ake when a n error is  encounter ed while
  12172                        openi ng or read ing files  as they ar e saved in to a zip a rchive.
  12173                      
  12174       </summary>
  12175                    
  12176                     
  12177       <remarks>
  12178                       
  12179        <para>
  12180                           Err ors can oc cur within  a call to  
  12181         <see 
  12182          cref="M:Io nic.Zip.Zi pFile.Save "
  12183         >
  12184          ZipFile.Sa ve
  12185         </see>
  12186         , as the v arious fil es contain ed
  12187                           in  a ZipFile  are being  saved into  the zip a rchive.  D uring the
  12188                           
  12189         <c>
  12190          Save
  12191         </c>
  12192         , DotNetZi p will per form a 
  12193         <c>
  12194          File.Open
  12195         </c>
  12196          on the fi le
  12197                           ass ociated to  the ZipEn try, and t hen will r ead the en tire conte nts of
  12198                           the  file as i t is zippe d. Either  the open o r the Read  may fail,  because
  12199                           of  lock confl icts or ot her reason s.  Using  this prope rty, you c an
  12200                           spe cify the a ction to t ake when s uch errors  occur.
  12201                        
  12202        </para>
  12203                     
  12204                       
  12205        <para>
  12206                           Typ ically you  will NOT  set this p roperty on  individua l ZipEntry
  12207                           ins tances.  I nstead, yo u will set  the 
  12208         <see 
  12209          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  12210         >
  12211          ZipFile.Zi pErrorActi on
  12212         </see>
  12213          property  on
  12214                           the  ZipFile i nstance, b efore addi ng any ent ries to th e
  12215                           
  12216         <c>
  12217          ZipFile
  12218         </c>
  12219         . If you d o this, er rors encou ntered on  behalf of  any of
  12220                           the  entries i n the ZipF ile will b e handled  the same w ay.
  12221                        
  12222        </para>
  12223                     
  12224                       
  12225        <para>
  12226                           But , if you u se a 
  12227         <see 
  12228          cref="E:Io nic.Zip.Zi pFile.ZipE rror"
  12229         />
  12230          handler,  you will w ant
  12231                           to  set this p roperty on  the 
  12232         <c>
  12233          ZipEntry
  12234         </c>
  12235          within th e handler,  to
  12236                           com municate b ack to Dot NetZip wha t you woul d like to  do with th e
  12237                           par ticular er ror.
  12238                        
  12239        </para>
  12240                     
  12241                      
  12242       </remarks>
  12243                     
  12244       <seealso 
  12245        cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  12246       />
  12247                     
  12248       <seealso 
  12249        cref="E:Io nic.Zip.Zi pFile.ZipE rror"
  12250       />
  12251               
  12252      </member>
  12253              
  12254      <member 
  12255       name="P:Io nic.Zip.Zi pEntry.Inc ludedInMos tRecentSav e"
  12256      >
  12257                    
  12258       <summary>
  12259                     Indicate s whether  the entry  was includ ed in the  most recen t save.
  12260                     
  12261       </summary>
  12262                    
  12263       <remarks>
  12264                     An entry  can be ex cluded or  skipped fr om a save  if there i s an error
  12265                     opening  or reading  the entry .
  12266                     
  12267       </remarks>
  12268                    
  12269       <seealso 
  12270        cref="P:Io nic.Zip.Zi pEntry.Zip ErrorActio n"
  12271       />
  12272               
  12273      </member>
  12274              
  12275      <member 
  12276       name="P:Io nic.Zip.Zi pEntry.Set Compressio n"
  12277      >
  12278                     
  12279       <summary>
  12280                        A cal lback that  allows th e applicat ion to spe cify the c ompression  to use
  12281                        for a  given ent ry that is  about to  be added t o the zip  archive.
  12282                      
  12283       </summary>
  12284                    
  12285                     
  12286       <remarks>
  12287                      
  12288        <para>
  12289                         See 
  12290         <see 
  12291          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  12292         />
  12293                       
  12294        </para>
  12295                      
  12296       </remarks>
  12297               
  12298      </member>
  12299              
  12300      <member 
  12301       name="P:Io nic.Zip.Zi pEntry.Use UnicodeAsN ecessary"
  12302      >
  12303                     
  12304       <summary>
  12305                        Set t o indicate  whether t o use UTF- 8 encoding  for filen ames and c omments.
  12306                      
  12307       </summary>
  12308                    
  12309                     
  12310       <remarks>
  12311                     
  12312                      
  12313        <para>
  12314                         If th is flag is  set, the  comment an d filename  for the e ntry will  be
  12315                         encod ed with UT F-8, as de scribed in  
  12316         <see 
  12317          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  12318         >
  12319          the Zip
  12320                          speci fication
  12321         </see>
  12322         , if neces sary. "Nec essary" me ans, the f ilename or
  12323                         entry  comment ( if any) ca nnot be re flexively  encoded an d decoded  using the
  12324                         defau lt code pa ge, IBM437 .
  12325                       
  12326        </para>
  12327                     
  12328                      
  12329        <para>
  12330                         Setti ng this fl ag to true  is equiva lent to se tting 
  12331         <see 
  12332          cref="P:Io nic.Zip.Zi pEntry.Pro visionalAl ternateEnc oding"
  12333         />
  12334          to 
  12335         <c>
  12336          System.Tex t.Encoding .UTF8
  12337         </c>
  12338         .
  12339                       
  12340        </para>
  12341                     
  12342                      
  12343        <para>
  12344                         This  flag has n o effect o r relation  to the te xt encodin g used wit hin the
  12345                         file  itself.
  12346                       
  12347        </para>
  12348                     
  12349                      
  12350       </remarks>
  12351               
  12352      </member>
  12353              
  12354      <member 
  12355       name="P:Io nic.Zip.Zi pEntry.Pro visionalAl ternateEnc oding"
  12356      >
  12357                     
  12358       <summary>
  12359                        The t ext encodi ng to use  for the Fi leName and  Comment o n this Zip Entry,
  12360                        when  the defaul t encoding  is insuff icient.
  12361                      
  12362       </summary>
  12363                    
  12364                     
  12365       <remarks>
  12366                     
  12367                      
  12368        <para>
  12369                         Don't  use this  property.   See 
  12370         <see 
  12371          cref="P:Io nic.Zip.Zi pEntry.Alt ernateEnco ding"
  12372         />
  12373         .
  12374                       
  12375        </para>
  12376                     
  12377                      
  12378       </remarks>
  12379               
  12380      </member>
  12381              
  12382      <member 
  12383       name="P:Io nic.Zip.Zi pEntry.Alt ernateEnco ding"
  12384      >
  12385                    
  12386       <summary>
  12387                       Specif ies the al ternate te xt encodin g used by  this ZipEn try
  12388                     
  12389       </summary>
  12390                    
  12391       <remarks>
  12392                       
  12393        <para>
  12394                          The  default te xt encodin g used in  Zip files  for encodi ng filenam es and
  12395                          comm ents is IB M437, whic h is somet hing like  a superset  of ASCII.   In
  12396                          case s where th is is insu fficient,  applicatio ns can spe cify an
  12397                          alte rnate enco ding.
  12398                        
  12399        </para>
  12400                       
  12401        <para>
  12402                          When  creating  a zip file , the usag e of the a lternate e ncoding is
  12403                          gove rned by th
  12404         <see 
  12405          cref="P:Io nic.Zip.Zi pEntry.Alt ernateEnco dingUsage"
  12406         />
  12407          property.
  12408                          Typi cally you  would set  both prope rties to t ell DotNet Zip to emp loy an
  12409                          enco ding that  is not IBM 437 in the  zipfile y ou are cre ating.
  12410                        
  12411        </para>
  12412                       
  12413        <para>
  12414                          Keep  in mind t hat becaus e the ZIP  specificat ion states  that the  only
  12415                          vali d encoding s to use a re IBM437  and UTF-8,  if you us e somethin g
  12416                          othe r than tha t, then zi p tools an d librarie s may not  be able to
  12417                          succ essfully r ead the zi p archive  you genera te.
  12418                        
  12419        </para>
  12420                       
  12421        <para>
  12422                          The  zip specif ication st ates that  applicatio ns should  presume th at
  12423                          IBM4 37 is in u se, except  when a sp ecial bit  is set, wh ich indica tes
  12424                          UTF- 8. There i s no way t o specify  an arbitra ry code pa ge, within  the
  12425                          zip  file itsel f. When yo u create a  zip file  encoded wi th gb2312  or
  12426                          ibm8 61 or anyt hing other  than IBM4 37 or UTF- 8, then th e applicat ion
  12427                          that  reads the  zip file  needs to " know" whic h code pag e to use.  In
  12428                          some  cases, th e code pag e used whe n reading  is chosen  implicitly . For
  12429                          exam ple, WinRa r uses the  ambient c ode page f or the hos t desktop
  12430                          oper ating syst em. The pi tfall here  is that i f you crea te a zip i n
  12431                          Cope nhagen and  send it t o Tokyo, t he reader  of the zip file may n ot be
  12432                          able  to decode  successfu lly.
  12433                        
  12434        </para>
  12435                     
  12436       </remarks>
  12437                    
  12438       <example>
  12439                       This e xample sho ws how to  create a z ipfile enc oded with  a
  12440                       langua ge-specifi c encoding :
  12441                     
  12442        <code>
  12443                        using  (var zip =  new ZipFi le())
  12444                        {
  12445                           zip .Alternate Enoding =  System.Tex t.Encoding .GetEncodi ng("ibm861 ");
  12446                           zip .Alternate EnodingUsa ge = ZipOp tion.Alway s;
  12447                           zip .AddFileS( arrayOfFil es);
  12448                           zip .Save("Mya rchive-Enc oded-in-IB M861.zip") ;
  12449                        }
  12450                      
  12451        </code>
  12452                     
  12453       </example>
  12454                    
  12455       <seealso 
  12456        cref="P:Io nic.Zip.Zi pFile.Alte rnateEncod ingUsage"
  12457       />
  12458               
  12459      </member>
  12460              
  12461      <member 
  12462       name="P:Io nic.Zip.Zi pEntry.Alt ernateEnco dingUsage"
  12463      >
  12464                    
  12465       <summary>
  12466                       Descri bes if and  when this  instance  should app ly
  12467                       Altern ateEncodin g to encod e the File Name and C omment, wh en
  12468                       saving .
  12469                     
  12470       </summary>
  12471                    
  12472       <seealso 
  12473        cref="P:Io nic.Zip.Zi pFile.Alte rnateEncod ing"
  12474       />
  12475               
  12476      </member>
  12477              
  12478      <member 
  12479       name="P:Io nic.Zip.Zi pEntry.IsT ext"
  12480      >
  12481                     
  12482       <summary>
  12483                        Indic ates wheth er an entr y is marke d as a tex t file. Be  careful w hen
  12484                        using  on this p roperty. U nless you  have a goo d reason,  you should
  12485                        proba bly ignore  this prop erty.
  12486                      
  12487       </summary>
  12488                    
  12489                     
  12490       <remarks>
  12491                      
  12492        <para>
  12493                         The Z IP format  includes a  provision  for speci fying whet her an ent ry in
  12494                         the z ip archive  is a text  or binary  file.  Th is propert y exposes  that
  12495                         metad ata item.  Be careful  when usin g this pro perty: It' s not clea r
  12496                         that  this prope rty as a f irm meanin g, across  tools and  libraries.
  12497                       
  12498        </para>
  12499                     
  12500                      
  12501        <para>
  12502                         To be  clear, wh en reading  a zip fil e, the pro perty valu e may or m ay
  12503                         not b e set, and  its value  may or ma y not be v alid.  Not  all entri es
  12504                         that  you may th ink of as  "text" ent ries will  be so mark ed, and en tries
  12505                         marke d as "text " are not  guaranteed  in any wa y to be te xt entries .
  12506                         Wheth er the val ue is set  and set co rrectly de pends enti rely on th e
  12507                         appli cation tha t produced  the zip f ile.
  12508                       
  12509        </para>
  12510                     
  12511                      
  12512        <para>
  12513                         There  are many  zip tools  available,  and when  creating z ip files,  some
  12514                         of th em "respec t" the IsT ext metada ta field,  and some o f them do  not.
  12515                         Unfor tunately,  even when  an applica tion tries  to do "th e right th ing",
  12516                         it's  not always  clear wha t "the rig ht thing"  is.
  12517                       
  12518        </para>
  12519                     
  12520                      
  12521        <para>
  12522                         There 's no firm  definitio n of just  what it me ans to be  "a text fi le",
  12523                         and t he zip spe cification  does not  help in th is regard.  Twenty ye ars
  12524                         ago,  text was A SCII, each  byte was  less than  127. IsTex t meant, a ll
  12525                         bytes  in the fi le were le ss than 12 7.  These  days, it i s not the  case
  12526                         that  all text f iles have  all bytes  less than  127.  Any  unicode fi le
  12527                         may h ave bytes  that are a bove 0x7f.   The zip  specificat ion has no thing
  12528                         to sa y on this  topic. The refore, it 's not cle ar what Is Text reall y
  12529                         means .
  12530                       
  12531        </para>
  12532                     
  12533                      
  12534        <para>
  12535                         This  property m erely tell s a readin g applicat ion what i s stored i n the
  12536                         metad ata for an  entry, wi thout guar anteeing i ts validit y or its
  12537                         meani ng.
  12538                       
  12539        </para>
  12540                     
  12541                      
  12542        <para>
  12543                         When  DotNetZip  is used to  create a  zipfile, i t attempts  to set th is
  12544                         field  "correctl y." For ex ample, if  a file end s in ".txt ", this fi eld
  12545                         will  be set. Yo ur applica tion may o verride th at default  setting.   When
  12546                         writi ng a zip f ile, you m ust set th e property  before ca lling
  12547                         
  12548         <c>
  12549          Save()
  12550         </c>
  12551          on the Zi pFile.
  12552                       
  12553        </para>
  12554                     
  12555                      
  12556        <para>
  12557                         When  reading a  zip file,  a more gen eral way t o decide j ust what k ind
  12558                         of fi le is cont ained in a  particula r entry is  to use th e file typ e
  12559                         datab ase stored  in the op erating sy stem.  The  operating  system st ores
  12560                         a tab le that sa ys, a file  with .jpg  extension  is a JPG  image file , a
  12561                         file  with a .xm l extensio n is an XM L document , a file w ith a .txt  is a
  12562                         pure  ASCII text  document,  and so on .  To get  this infor mation on
  12563                         Windo ws, 
  12564         <see
  12565                         
  12566          href="http ://www.cod eproject.c om/KB/cs/G etFileType AndIcon.as px"
  12567         >
  12568           you
  12569                          need  to read an d parse th e registry .
  12570         </see>
  12571          
  12572        </para>
  12573                      
  12574       </remarks>
  12575                    
  12576                     
  12577       <example>
  12578                      
  12579        <code>
  12580                       using ( var zip =  new ZipFil e())
  12581                       {
  12582                           var  e = zip.U pdateFile( "Descripti ons.mme",  "");
  12583                           e.I sText = tr ue;
  12584                           zip .Save(zipP ath);
  12585                       }
  12586                       
  12587        </code>
  12588                     
  12589                      
  12590        <code 
  12591         lang="VB"
  12592        >
  12593                       Using z ip As New  ZipFile
  12594                           Dim  e2 as Zip Entry = zi p.AddFile( "Descripti ons.mme",  "")
  12595                           e.I sText= Tru e
  12596                           zip .Save(zipP ath)
  12597                       End Usi ng
  12598                       
  12599        </code>
  12600                      
  12601       </example>
  12602               
  12603      </member>
  12604              
  12605      <member 
  12606       name="T:Io nic.Zip.Zi pEntryTime stamp"
  12607      >
  12608                     
  12609       <summary>
  12610                        An en um that sp ecifies th e type of  timestamp  available  on the Zip Entry.
  12611                      
  12612       </summary>
  12613                    
  12614                     
  12615       <remarks>
  12616                     
  12617                      
  12618        <para>
  12619                         The l ast modifi ed time of  a file ca n be store d in multi ple ways i n
  12620                         a zip  file, and  they are  not mutual ly exclusi ve:
  12621                       
  12622        </para>
  12623                     
  12624                      
  12625        <list 
  12626         type="bull et"
  12627        >
  12628                         
  12629         <item>
  12630                            In  the so-cal led "DOS"  format, wh ich has a  2-second p recision.  Values
  12631                            are  rounded t o the near est even s econd. For  example,  if the tim e on the
  12632                            fil e is 12:34 :43, then  it will be  stored as  12:34:44.  This firs t value
  12633                            is  accessible  via the 
  12634          <c>
  12635           LastModifi ed
  12636          </c>
  12637           property.  This valu e is alway s
  12638                            pre sent in th e metadata  for each  zip entry.   In some  cases the  value is
  12639                            inv alid, or z ero.
  12640                          
  12641         </item>
  12642                      
  12643                         
  12644         <item>
  12645                            In  the so-cal led "Windo ws" or "NT FS" format , as an 8- byte integ er
  12646                            qua ntity expr essed as t he number  of 1/10 mi lliseconds  (in other  words
  12647                            the  number of  100 nanos econd unit s) since J anuary 1,  1601 (UTC) .  This
  12648                            for mat is how  Windows r epresents  file times .  This ti me is acce ssible
  12649                            via  the 
  12650          <c>
  12651           ModifiedTi me
  12652          </c>
  12653           property.
  12654                          
  12655         </item>
  12656                      
  12657                         
  12658         <item>
  12659                            In  the "Unix"  format, a  4-byte qu antity spe cifying th e number o f seconds  since
  12660                            Jan uary 1, 19 70 UTC.
  12661                          
  12662         </item>
  12663                      
  12664                         
  12665         <item>
  12666                            In  an older f ormat, now  deprecate d but stil l used by  some curre nt
  12667                            too ls. This f ormat is a lso a 4-by te quantit y specifyi ng the num ber of
  12668                            sec onds since  January 1 , 1970 UTC .
  12669                          
  12670         </item>
  12671                      
  12672                       
  12673        </list>
  12674                     
  12675                      
  12676        <para>
  12677                         This  bit field  describes  which of t he formats  were foun d in a 
  12678         <c>
  12679          ZipEntry
  12680         </c>
  12681          that was  read.
  12682                       
  12683        </para>
  12684                     
  12685                      
  12686       </remarks>
  12687               
  12688      </member>
  12689              
  12690      <member 
  12691       name="F:Io nic.Zip.Zi pEntryTime stamp.None "
  12692      >
  12693                    
  12694       <summary>
  12695                     Default  value.
  12696                     
  12697       </summary>
  12698               
  12699      </member>
  12700              
  12701      <member 
  12702       name="F:Io nic.Zip.Zi pEntryTime stamp.DOS"
  12703      >
  12704                    
  12705       <summary>
  12706                     A DOS ti mestamp wi th 2-secon d precisio n.
  12707                     
  12708       </summary>
  12709               
  12710      </member>
  12711              
  12712      <member 
  12713       name="F:Io nic.Zip.Zi pEntryTime stamp.Wind ows"
  12714      >
  12715                    
  12716       <summary>
  12717                     A Window s timestam p with 100 -ns precis ion.
  12718                     
  12719       </summary>
  12720               
  12721      </member>
  12722              
  12723      <member 
  12724       name="F:Io nic.Zip.Zi pEntryTime stamp.Unix "
  12725      >
  12726                    
  12727       <summary>
  12728                     A Unix t imestamp w ith 1-seco nd precisi on.
  12729                     
  12730       </summary>
  12731               
  12732      </member>
  12733              
  12734      <member 
  12735       name="F:Io nic.Zip.Zi pEntryTime stamp.Info Zip1"
  12736      >
  12737                    
  12738       <summary>
  12739                     A Unix t imestamp w ith 1-seco nd precisi on, stored  in InfoZi p v1 forma t.  This
  12740                     format i s outdated  and is su pported fo r reading  archives o nly.
  12741                     
  12742       </summary>
  12743               
  12744      </member>
  12745              
  12746      <member 
  12747       name="T:Io nic.Zip.Co mpressionM ethod"
  12748      >
  12749                     
  12750       <summary>
  12751                        The m ethod of c ompression  to use fo r a partic ular ZipEn try.
  12752                      
  12753       </summary>
  12754                    
  12755                     
  12756       <remarks>
  12757                        
  12758        <see
  12759                        
  12760         href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  12761        >
  12762         PKWare's
  12763                         ZIP S pecificati on
  12764        </see>
  12765         describes  a number  of distinc t
  12766                        cmopr ession met hods that  can be use d within a  zip
  12767                        file.  DotNetZip  supports  a subset o f them.
  12768                      
  12769       </remarks>
  12770               
  12771      </member>
  12772              
  12773      <member 
  12774       name="F:Io nic.Zip.Co mpressionM ethod.None "
  12775      >
  12776                    
  12777       <summary>
  12778                     No compr ession at  all. For C OM environ ments, the  value is  0 (zero).
  12779                     
  12780       </summary>
  12781               
  12782      </member>
  12783              
  12784      <member 
  12785       name="F:Io nic.Zip.Co mpressionM ethod.Defl ate"
  12786      >
  12787                    
  12788       <summary>
  12789                       DEFLAT E compress ion, as de scribed in  
  12790        <see
  12791                       
  12792         href="http ://www.iet f.org/rfc/ rfc1951.tx t"
  12793        >
  12794         IETF RFC
  12795                        1951
  12796        </see>
  12797        .  This is  the "norm al" compre ssion used  in zip
  12798                       files.  For COM e nvironment s, the val ue is 8.
  12799                     
  12800       </summary>
  12801               
  12802      </member>
  12803              
  12804      <member 
  12805       name="F:Io nic.Zip.Co mpressionM ethod.BZip 2"
  12806      >
  12807                    
  12808       <summary>
  12809                       BZip2  compressio n, a compr ession alg orithm dev eloped by  Julian Sew ard.
  12810                       For CO M environm ents, the  value is 1 2.
  12811                     
  12812       </summary>
  12813               
  12814      </member>
  12815              
  12816      <member 
  12817       name="T:Io nic.Zip.Zi pFile"
  12818      >
  12819                     
  12820       <summary>
  12821                        The Z ipFile typ e represen ts a zip a rchive fil e.
  12822                      
  12823       </summary>
  12824                    
  12825                     
  12826       <remarks>
  12827                      
  12828        <para>
  12829                         This  is the mai n type in  the DotNet Zip class  library. T his class  reads and
  12830                         write s zip file s, as defi ned in the  
  12831         <see 
  12832          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  12833         >
  12834          specificat ion
  12835                          for z ip files d escribed b y PKWare
  12836         </see>
  12837         .  The com pression f or this
  12838                         imple mentation  is provide d by a man aged-code  version of  Zlib, inc luded with
  12839                         DotNe tZip in th e classes  in the Ion ic.Zlib na mespace.
  12840                       
  12841        </para>
  12842                     
  12843                      
  12844        <para>
  12845                         This  class prov ides a gen eral purpo se zip fil e capabili ty.  Use i t to read,
  12846                         creat e, or upda te zip fil es.  When  you want t o create z ip files u sing a
  12847                         
  12848         <c>
  12849          Stream
  12850         </c>
  12851          type to w rite the z ip file, y ou may wan t to consi der the 
  12852         <see 
  12853          cref="T:Io nic.Zip.Zi pOutputStr eam"
  12854         />
  12855          class.
  12856                       
  12857        </para>
  12858                     
  12859                      
  12860        <para>
  12861                         Both  the 
  12862         <c>
  12863          ZipOutputS tream
  12864         </c>
  12865          class and  the 
  12866         <c>
  12867          ZipFile
  12868         </c>
  12869          class can
  12870                         be us ed to crea te zip fil es. Both o f them sup port many  of the com mon zip
  12871                         featu res, inclu ding Unico de, differ ent compre ssion meth ods and le vels,
  12872                         and Z IP64. They  provide v ery simila r performa nce when c reating zi p
  12873                         files .
  12874                       
  12875        </para>
  12876                     
  12877                      
  12878        <para>
  12879                         The 
  12880         <c>
  12881          ZipFile
  12882         </c>
  12883          class is  generally  easier to  use than
  12884                         
  12885         <c>
  12886          ZipOutputS tream
  12887         </c>
  12888          and shoul d be consi dered a hi gher-level  interface .  For
  12889                         examp le, when c reating a  zip file v ia calls t o the 
  12890         <c>
  12891          PutNextEnt ry()
  12892         </c>
  12893          and
  12894                         
  12895         <c>
  12896          Write()
  12897         </c>
  12898          methods o n the 
  12899         <c>
  12900          ZipOutputS tream
  12901         </c>
  12902          class, th e caller i s
  12903                         respo nsible for  opening t he file, r eading the  bytes fro m the file , writing
  12904                         those  bytes int o the 
  12905         <c>
  12906          ZipOutputS tream
  12907         </c>
  12908         , setting  the attrib utes on th e
  12909                         
  12910         <c>
  12911          ZipEntry
  12912         </c>
  12913         , and sett ing the cr eated, las t modified , and last  accessed
  12914                         times tamps on t he zip ent ry. All of  these thi ngs are do ne automat ically by  a
  12915                         call  to 
  12916         <see 
  12917          cref="M:Io nic.Zip.Zi pFile.AddF ile(System .String,Sy stem.Strin g)"
  12918         >
  12919          ZipFile.Ad dFile()
  12920         </see>
  12921         .
  12922                         For t his reason , the 
  12923         <c>
  12924          ZipOutputS tream
  12925         </c>
  12926          is genera lly recomm ended for  use
  12927                         only  when your  applicatio n emits ar bitrary da ta, not ne cessarily  data from  a
  12928                         files ystem file , directly  into a zi p file, an d does so  using a 
  12929         <c>
  12930          Stream
  12931         </c>
  12932                         metap hor.
  12933                       
  12934        </para>
  12935                     
  12936                      
  12937        <para>
  12938                         Aside  from the  difference s in progr amming mod el, there  are other
  12939                         diffe rences in  capability  between t he two cla sses.
  12940                       
  12941        </para>
  12942                     
  12943                      
  12944        <list 
  12945         type="bull et"
  12946        >
  12947                         
  12948         <item>
  12949                            
  12950          <c>
  12951           ZipFile
  12952          </c>
  12953           can be us ed to read  and extra ct zip fil es, in add ition to
  12954                            cre ating zip  files. 
  12955          <c>
  12956           ZipOutputS tream
  12957          </c>
  12958           cannot re ad zip fil es. If you  want
  12959                            to  use a stre am to read  zip files , check ou t the 
  12960          <see 
  12961           cref="T:Io nic.Zip.Zi pInputStre am"
  12962          />
  12963           class.
  12964                          
  12965         </item>
  12966                      
  12967                         
  12968         <item>
  12969                            
  12970          <c>
  12971           ZipOutputS tream
  12972          </c>
  12973           does not  support th e creation  of segmen ted or spa nned
  12974                            zip  files.
  12975                          
  12976         </item>
  12977                      
  12978                         
  12979         <item>
  12980                            
  12981          <c>
  12982           ZipOutputS tream
  12983          </c>
  12984           cannot pr oduce a se lf-extract ing archiv e.
  12985                          
  12986         </item>
  12987                       
  12988        </list>
  12989                     
  12990                      
  12991        <para>
  12992                         Be aw are that t he 
  12993         <c>
  12994          ZipFile
  12995         </c>
  12996          class imp lements th
  12997         <see 
  12998          cref="T:Sy stem.IDisp osable"
  12999         />
  13000          interface .  In orde r for 
  13001         <c>
  13002          ZipFile
  13003         </c>
  13004          to
  13005                         produ ce a valid  zip file,  you use u se it with in a using  clause (
  13006         <c>
  13007          Using
  13008         </c>
  13009                         in VB ), or call  the 
  13010         <c>
  13011          Dispose()
  13012         </c>
  13013          method ex plicitly.   See the e xamples
  13014                         for h ow to empl oy a using  clause.
  13015                       
  13016        </para>
  13017                     
  13018                      
  13019       </remarks>
  13020               
  13021      </member>
  13022              
  13023      <member 
  13024       name="M:Io nic.Zip.Zi pFile.AddI tem(System .String)"
  13025      >
  13026                     
  13027       <summary>
  13028                        Adds  an item, e ither a fi le or a di rectory, t o a zip fi le archive .
  13029                      
  13030       </summary>
  13031                    
  13032                     
  13033       <remarks>
  13034                      
  13035        <para>
  13036                         This  method is  handy if y ou are add ing things  to zip ar chive and  don't
  13037                         want  to bother  distinguis hing betwe en directo ries or fi les.  Any  files are
  13038                         added  as single  entries.   A directo ry added t hrough thi s method i s added
  13039                         recur sively: al l files an d subdirec tories con tained wit hin the di rectory
  13040                         are a dded to th
  13041         <c>
  13042          ZipFile
  13043         </c>
  13044         .
  13045                       
  13046        </para>
  13047                     
  13048                      
  13049        <para>
  13050                         The n ame of the  item may  be a relat ive path o r a fully- qualified
  13051                         path.  Remember,  the items  contained  in 
  13052         <c>
  13053          ZipFile
  13054         </c>
  13055          instance  get writte n
  13056                         to th e disk onl y when you  call 
  13057         <see 
  13058          cref="M:Io nic.Zip.Zi pFile.Save "
  13059         />
  13060          or a simi lar
  13061                         save  method.
  13062                       
  13063        </para>
  13064                     
  13065                      
  13066        <para>
  13067                         The d irectory n ame used f or the fil e within t he archive  is the sa me
  13068                         as th e director y name (po tentially  a relative  path) spe cified in  the
  13069                         
  13070         <paramref 
  13071          name="file OrDirector yName"
  13072         />
  13073         .
  13074                       
  13075        </para>
  13076                     
  13077                      
  13078        <para>
  13079                         For 
  13080         <c>
  13081          ZipFile
  13082         </c>
  13083          propertie s includin
  13084         <see 
  13085          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  13086         />
  13087        
  13088         <see 
  13089          cref="P:Io nic.Zip.Zi pFile.Pass word"
  13090         />
  13091        
  13092         <see 
  13093          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  13094         />
  13095        
  13096         <see 
  13097          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  13098         />
  13099        
  13100         <see 
  13101          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  13102         />
  13103         ,
  13104                         
  13105         <see 
  13106          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  13107         />
  13108         , and 
  13109         <see 
  13110          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  13111         />
  13112         , their
  13113                         respe ctive valu es at the  time of th is call wi ll be appl ied to the
  13114                         
  13115         <c>
  13116          ZipEntry
  13117         </c>
  13118          added.
  13119                       
  13120        </para>
  13121                     
  13122                      
  13123       </remarks>
  13124                    
  13125                     
  13126       <seealso 
  13127        cref="M:Io nic.Zip.Zi pFile.AddF ile(System .String)"
  13128       />
  13129                     
  13130       <seealso 
  13131        cref="M:Io nic.Zip.Zi pFile.AddD irectory(S ystem.Stri ng)"
  13132       />
  13133                     
  13134       <seealso 
  13135        cref="M:Io nic.Zip.Zi pFile.Upda teItem(Sys tem.String )"
  13136       />
  13137                    
  13138                     
  13139       <overloads >
  13140        This metho d has two  overloads.
  13141       </overload s>
  13142                     
  13143       <param 
  13144        name="file OrDirector yName"
  13145       >
  13146                      the nam e of the f ile or dir ectory to  add.
  13147       </param>
  13148                    
  13149                     
  13150       <returns>
  13151        The 
  13152        <c>
  13153         ZipEntry
  13154        </c>
  13155         added.
  13156       </returns>
  13157               
  13158      </member>
  13159              
  13160      <member 
  13161       name="M:Io nic.Zip.Zi pFile.AddI tem(System .String,Sy stem.Strin g)"
  13162      >
  13163                     
  13164       <summary>
  13165                        Adds  an item, e ither a fi le or a di rectory, t o a zip fi le archive ,
  13166                        expli citly spec ifying the  directory  path to b e used in  the archiv e.
  13167                      
  13168       </summary>
  13169                    
  13170                     
  13171       <remarks>
  13172                      
  13173        <para>
  13174                         If ad ding a dir ectory, th e add is r ecursive o n all file s and
  13175                         subdi rectories  contained  within it.
  13176                       
  13177        </para>
  13178                      
  13179        <para>
  13180                         The n ame of the  item may  be a relat ive path o r a fully- qualified  path.
  13181                         The i tem added  by this ca ll to the 
  13182         <c>
  13183          ZipFile
  13184         </c>
  13185          is not re ad from th e
  13186                         disk  nor writte n to the z ip file ar chive unti l the appl ication ca lls
  13187                         Save( ) on the 
  13188         <c>
  13189          ZipFile
  13190         </c>
  13191         .
  13192                       
  13193        </para>
  13194                     
  13195                      
  13196        <para>
  13197                         This  version of  the metho d allows t he caller  to explici tly specif y the
  13198                         direc tory path  to be used  in the ar chive, whi ch would o verride th e
  13199                         "natu ral" path  of the fil esystem fi le.
  13200                       
  13201        </para>
  13202                     
  13203                      
  13204        <para>
  13205                         Encry ption will  be used o n the file  data if t he 
  13206         <c>
  13207          Password
  13208         </c>
  13209          has
  13210                         been  set on the  
  13211         <c>
  13212          ZipFile
  13213         </c>
  13214          object, p rior to ca lling this  method.
  13215                       
  13216        </para>
  13217                     
  13218                      
  13219        <para>
  13220                         For 
  13221         <c>
  13222          ZipFile
  13223         </c>
  13224          propertie s includin
  13225         <see 
  13226          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  13227         />
  13228        
  13229         <see 
  13230          cref="P:Io nic.Zip.Zi pFile.Pass word"
  13231         />
  13232        
  13233         <see 
  13234          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  13235         />
  13236        
  13237         <see 
  13238          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  13239         />
  13240        
  13241         <see 
  13242          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  13243         />
  13244         ,
  13245                         
  13246         <see 
  13247          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  13248         />
  13249         , and 
  13250         <see 
  13251          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  13252         />
  13253         , their
  13254                         respe ctive valu es at the  time of th is call wi ll be appl ied to the
  13255                         
  13256         <c>
  13257          ZipEntry
  13258         </c>
  13259          added.
  13260                       
  13261        </para>
  13262                     
  13263                      
  13264       </remarks>
  13265                    
  13266                     
  13267       <exception  
  13268        cref="T:Sy stem.IO.Fi leNotFound Exception"
  13269       >
  13270                        Throw n if the f ile or dir ectory pas sed in doe s not exis t.
  13271                      
  13272       </exceptio n>
  13273                    
  13274                     
  13275       <param 
  13276        name="file OrDirector yName"
  13277       >
  13278        the name o f the file  or direct ory to add .
  13279                      
  13280       </param>
  13281                    
  13282                     
  13283       <param 
  13284        name="dire ctoryPathI nArchive"
  13285       >
  13286                        The n ame of the  directory  path to u se within  the zip ar chive.  Th is path
  13287                        need  not refer  to an exta nt directo ry in the  current fi lesystem.   If the
  13288                        files  within th e zip are  later extr acted, thi s is the p ath used f or the
  13289                        extra cted file.   Passing 
  13290        <c>
  13291         null
  13292        </c>
  13293         (
  13294        <c>
  13295         Nothing
  13296        </c>
  13297         in VB) wi ll use the
  13298                        path  on the fil eOrDirecto ryName.  P assing the  empty str ing ("") w ill
  13299                        inser t the item  at the ro ot path wi thin the a rchive.
  13300                      
  13301       </param>
  13302                    
  13303                     
  13304       <seealso 
  13305        cref="M:Io nic.Zip.Zi pFile.AddF ile(System .String,Sy stem.Strin g)"
  13306       />
  13307                     
  13308       <seealso 
  13309        cref="M:Io nic.Zip.Zi pFile.AddD irectory(S ystem.Stri ng,System. String)"
  13310       />
  13311                     
  13312       <seealso 
  13313        cref="M:Io nic.Zip.Zi pFile.Upda teItem(Sys tem.String ,System.St ring)"
  13314       />
  13315                    
  13316                     
  13317       <example>
  13318                        This  example sh ows how to  zip up a  set of fil es into a  flat hiera rchy,
  13319                        regar dless of w here in th e filesyst em the fil es origina ted. The r esulting
  13320                        zip a rchive wil l contain  a toplevel  directory  named "fl at", which  itself
  13321                        will  contain fi les Readme .txt, MyPr oposal.doc x, and Ima ge1.jpg.   A
  13322                        subdi rectory un der "flat"  called Su pportFiles  will cont ain all th e files
  13323                        in th e "c:\Supp ortFiles"  directory  on disk.
  13324                     
  13325                      
  13326        <code>
  13327                       String[ ] itemname s= {
  13328                         "c:\\ fixedConte nt\\Readme .txt",
  13329                         "MyPr oposal.doc x",
  13330                         "c:\\ SupportFil es",  // a  directory
  13331                         "imag es\\Image1 .jpg"
  13332                       };
  13333                      
  13334                       try
  13335                       {
  13336                         using  (ZipFile  zip = new  ZipFile())
  13337                         {
  13338                           for  (int i =  1; i &lt;  itemnames. Length; i+ +)
  13339                           {
  13340                             / / will add  Files or  Dirs, recu rses and f lattens su bdirectori es
  13341                             z ip.AddItem (itemnames [i],"flat" );
  13342                           }
  13343                           zip .Save(ZipT oCreate);
  13344                         }
  13345                       }
  13346                       catch ( System.Exc eption ex1 )
  13347                       {
  13348                         Syste m.Console. Error.Writ eLine("exc eption: {0 }", ex1);
  13349                       }
  13350                       
  13351        </code>
  13352                     
  13353                      
  13354        <code 
  13355         lang="VB"
  13356        >
  13357                         Dim i temnames A s String()  = _
  13358                           New  String()  { "c:\fixe dContent\R eadme.txt" , _
  13359                                            "MyPropo sal.docx",  _
  13360                                            "Support Files", _
  13361                                            "images\ Image1.jpg " }
  13362                         Try
  13363                             U sing zip A s New ZipF ile
  13364                                  Dim i A s Integer
  13365                                  For i =  1 To item names.Leng th - 1
  13366                                      ' w ill add Fi les or Dir s, recursi ng and fla ttening su bdirectori es.
  13367                                      zip .AddItem(i temnames(i ), "flat")
  13368                                  Next i
  13369                                  zip.Sav e(ZipToCre ate)
  13370                             E nd Using
  13371                         Catch  ex1 As Ex ception
  13372                             C onsole.Err or.WriteLi ne("except ion: {0}",  ex1.ToStr ing())
  13373                         End T ry
  13374                       
  13375        </code>
  13376                      
  13377       </example>
  13378                     
  13379       <returns>
  13380        The 
  13381        <c>
  13382         ZipEntry
  13383        </c>
  13384         added.
  13385       </returns>
  13386               
  13387      </member>
  13388              
  13389      <member 
  13390       name="M:Io nic.Zip.Zi pFile.AddF ile(System .String)"
  13391      >
  13392                     
  13393       <summary>
  13394                        Adds  a File to  a Zip file  archive.
  13395                      
  13396       </summary>
  13397                     
  13398       <remarks>
  13399                     
  13400                      
  13401        <para>
  13402                         This  call colle cts metada ta for the  named fil e in the f ilesystem,
  13403                         inclu ding the f ile attrib utes and t he timesta mp, and in serts that  metadata
  13404                         into  the result ing ZipEnt ry.  Only  when the a pplication  calls Sav e() on
  13405                         the 
  13406         <c>
  13407          ZipFile
  13408         </c>
  13409         , does Dot NetZip rea d the file  from the  filesystem  and
  13410                         then  write the  content to  the zip f ile archiv e.
  13411                       
  13412        </para>
  13413                     
  13414                      
  13415        <para>
  13416                         This  method wil l throw an  exception  if an ent ry with th e same nam e already
  13417                         exist s in the 
  13418         <c>
  13419          ZipFile
  13420         </c>
  13421         .
  13422                       
  13423        </para>
  13424                     
  13425                      
  13426        <para>
  13427                         For 
  13428         <c>
  13429          ZipFile
  13430         </c>
  13431          propertie s includin
  13432         <see 
  13433          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  13434         />
  13435        
  13436         <see 
  13437          cref="P:Io nic.Zip.Zi pFile.Pass word"
  13438         />
  13439        
  13440         <see 
  13441          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  13442         />
  13443        
  13444         <see 
  13445          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  13446         />
  13447        
  13448         <see 
  13449          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  13450         />
  13451         ,
  13452                         
  13453         <see 
  13454          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  13455         />
  13456         , and 
  13457         <see 
  13458          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  13459         />
  13460         , their
  13461                         respe ctive valu es at the  time of th is call wi ll be appl ied to the
  13462                         
  13463         <c>
  13464          ZipEntry
  13465         </c>
  13466          added.
  13467                       
  13468        </para>
  13469                     
  13470                      
  13471       </remarks>
  13472                    
  13473                     
  13474       <example>
  13475                      
  13476        <para>
  13477                         In th is example , three fi les are ad ded to a Z ip archive . The Read Me.txt
  13478                         file  will be pl aced in th e root of  the archiv e. The .pn g file wil l be
  13479                         place d in a fol der within  the zip c alled phot os\persona l.  The pd f file
  13480                         will  be include d into a f older with in the zip  called De sktop.
  13481                       
  13482        </para>
  13483                      
  13484        <code>
  13485                          try
  13486                          {
  13487                            us ing (ZipFi le zip = n ew ZipFile ())
  13488                            {
  13489                               zip.AddFil e("c:\\pho tos\\perso nal\\7440- N49th.png" );
  13490                               zip.AddFil e("c:\\Des ktop\\2008 -Regional- Sales-Repo rt.pdf");
  13491                               zip.AddFil e("ReadMe. txt");
  13492                      
  13493                               zip.Save(" Package.zi p");
  13494                            }
  13495                          }
  13496                          catc h (System. Exception  ex1)
  13497                          {
  13498                            Sy stem.Conso le.Error.W riteLine(" exception:  " + ex1);
  13499                          }
  13500                       
  13501        </code>
  13502                     
  13503                      
  13504        <code 
  13505         lang="VB"
  13506        >
  13507                        Try
  13508                             U sing zip A s ZipFile  = New ZipF ile
  13509                                  zip.Add File("c:\p hotos\pers onal\7440- N49th.png" )
  13510                                  zip.Add File("c:\D esktop\200 8-Regional -Sales-Rep ort.pdf")
  13511                                  zip.Add File("Read Me.txt")
  13512                                  zip.Sav e("Package .zip")
  13513                             E nd Using
  13514                         Catch  ex1 As Ex ception
  13515                             C onsole.Err or.WriteLi ne("except ion: {0}",  ex1.ToStr ing)
  13516                         End T ry
  13517                       
  13518        </code>
  13519                      
  13520       </example>
  13521                    
  13522                     
  13523       <overloads >
  13524        This metho d has two  overloads.
  13525       </overload s>
  13526                    
  13527                     
  13528       <seealso 
  13529        cref="M:Io nic.Zip.Zi pFile.AddI tem(System .String)"
  13530       />
  13531                     
  13532       <seealso 
  13533        cref="M:Io nic.Zip.Zi pFile.AddD irectory(S ystem.Stri ng)"
  13534       />
  13535                     
  13536       <seealso 
  13537        cref="M:Io nic.Zip.Zi pFile.Upda teFile(Sys tem.String )"
  13538       />
  13539                    
  13540                     
  13541       <param 
  13542        name="file Name"
  13543       >
  13544                        The n ame of the  file to a dd. It sho uld refer  to a file  in the fil esystem.
  13545                        The n ame of the  file may  be a relat ive path o r a fully- qualified  path.
  13546                      
  13547       </param>
  13548                     
  13549       <returns>
  13550        The 
  13551        <c>
  13552         ZipEntry
  13553        </c>
  13554         correspon ding to th e File add ed.
  13555       </returns>
  13556               
  13557      </member>
  13558              
  13559      <member 
  13560       name="M:Io nic.Zip.Zi pFile.AddF ile(System .String,Sy stem.Strin g)"
  13561      >
  13562                     
  13563       <summary>
  13564                        Adds  a File to  a Zip file  archive,  potentiall y overridi ng the pat h to be
  13565                        used  within the  zip archi ve.
  13566                      
  13567       </summary>
  13568                    
  13569                     
  13570       <remarks>
  13571                      
  13572        <para>
  13573                         The f ile added  by this ca ll to the 
  13574         <c>
  13575          ZipFile
  13576         </c>
  13577          is not wr itten to t he
  13578                         zip f ile archiv e until th e applicat ion calls  Save() on  the 
  13579         <c>
  13580          ZipFile
  13581         </c>
  13582         .
  13583                       
  13584        </para>
  13585                     
  13586                      
  13587        <para>
  13588                         This  method wil l throw an  exception  if an ent ry with th e same nam e already
  13589                         exist s in the 
  13590         <c>
  13591          ZipFile
  13592         </c>
  13593         .
  13594                       
  13595        </para>
  13596                     
  13597                      
  13598        <para>
  13599                         This  version of  the metho d allows t he caller  to explici tly specif y the
  13600                         direc tory path  to be used  in the ar chive.
  13601                       
  13602        </para>
  13603                     
  13604                      
  13605        <para>
  13606                         For 
  13607         <c>
  13608          ZipFile
  13609         </c>
  13610          propertie s includin
  13611         <see 
  13612          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  13613         />
  13614        
  13615         <see 
  13616          cref="P:Io nic.Zip.Zi pFile.Pass word"
  13617         />
  13618        
  13619         <see 
  13620          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  13621         />
  13622        
  13623         <see 
  13624          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  13625         />
  13626        
  13627         <see 
  13628          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  13629         />
  13630         ,
  13631                         
  13632         <see 
  13633          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  13634         />
  13635         , and 
  13636         <see 
  13637          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  13638         />
  13639         , their
  13640                         respe ctive valu es at the  time of th is call wi ll be appl ied to the
  13641                         
  13642         <c>
  13643          ZipEntry
  13644         </c>
  13645          added.
  13646                       
  13647        </para>
  13648                     
  13649                      
  13650       </remarks>
  13651                    
  13652                     
  13653       <example>
  13654                      
  13655        <para>
  13656                         In th is example , three fi les are ad ded to a Z ip archive . The Read Me.txt
  13657                         file  will be pl aced in th e root of  the archiv e. The .pn g file wil l be
  13658                         place d in a fol der within  the zip c alled imag es.  The p df file wi ll be
  13659                         inclu ded into a  folder wi thin the z ip called  files\docs , and will  be
  13660                         encry pted with  the given  password.
  13661                       
  13662        </para>
  13663                      
  13664        <code>
  13665                       try
  13666                       {
  13667                         using  (ZipFile  zip = new  ZipFile())
  13668                         {
  13669                           //  the follow ing entry  will be in serted at  the root i n the arch ive.
  13670                           zip .AddFile(" c:\\datafi les\\ReadM e.txt", "" );
  13671                           //  this image  file will  be insert ed into th e "images"  directory  in the ar chive.
  13672                           zip .AddFile(" c:\\photos \\personal \\7440-N49 th.png", " images");
  13673                           //  the follow ing will r esult in a  password- protected  file calle d
  13674                           //  files\\doc s\\2008-Re gional-Sal es-Report. pdf  in th e archive.
  13675                           zip .Password  = "Encrypt Me!";
  13676                           zip .AddFile(" c:\\Deskto p\\2008-Re gional-Sal es-Report. pdf", "fil es\\docs") ;
  13677                           zip .Save("Arc hive.zip") ;
  13678                         }
  13679                       }
  13680                       catch ( System.Exc eption ex1 )
  13681                       {
  13682                         Syste m.Console. Error.Writ eLine("exc eption: {0 }", ex1);
  13683                       }
  13684                       
  13685        </code>
  13686                     
  13687                      
  13688        <code 
  13689         lang="VB"
  13690        >
  13691                         Try
  13692                             U sing zip A s ZipFile  = New ZipF ile
  13693                                  ' the f ollowing e ntry will  be inserte d at the r oot in the  archive.
  13694                                  zip.Add File("c:\d atafiles\R eadMe.txt" , "")
  13695                                  ' this  image file  will be i nserted in to the "im ages" dire ctory in t he archive .
  13696                                  zip.Add File("c:\p hotos\pers onal\7440- N49th.png" , "images" )
  13697                                  ' the f ollowing w ill result  in a pass word-prote cted file  called
  13698                                  ' files \\docs\\20 08-Regiona l-Sales-Re port.pdf   in the arc hive.
  13699                                  zip.Pas sword = "E ncryptMe!"
  13700                                  zip.Add File("c:\D esktop\200 8-Regional -Sales-Rep ort.pdf",  "files\doc uments")
  13701                                  zip.Sav e("Archive .zip")
  13702                             E nd Using
  13703                         Catch  ex1 As Ex ception
  13704                             C onsole.Err or.WriteLi ne("except ion: {0}",  ex1)
  13705                         End T ry
  13706                       
  13707        </code>
  13708                      
  13709       </example>
  13710                    
  13711                     
  13712       <seealso 
  13713        cref="M:Io nic.Zip.Zi pFile.AddI tem(System .String,Sy stem.Strin g)"
  13714       />
  13715                     
  13716       <seealso 
  13717        cref="M:Io nic.Zip.Zi pFile.AddD irectory(S ystem.Stri ng,System. String)"
  13718       />
  13719                     
  13720       <seealso 
  13721        cref="M:Io nic.Zip.Zi pFile.Upda teFile(Sys tem.String ,System.St ring)"
  13722       />
  13723                    
  13724                     
  13725       <param 
  13726        name="file Name"
  13727       >
  13728                        The n ame of the  file to a dd.  The n ame of the  file may  be a relat ive path
  13729                        or a  fully-qual ified path .
  13730                      
  13731       </param>
  13732                    
  13733                     
  13734       <param 
  13735        name="dire ctoryPathI nArchive"
  13736       >
  13737                        Speci fies a dir ectory pat h to use t o override  any path  in the fil eName.
  13738                        This  path may,  or may not , correspo nd to a re al directo ry in the  current
  13739                        files ystem.  If  the files  within th e zip are  later extr acted, thi s is the
  13740                        path  used for t he extract ed file.   Passing 
  13741        <c>
  13742         null
  13743        </c>
  13744         (
  13745        <c>
  13746         Nothing
  13747        </c>
  13748         in
  13749                        VB) w ill use th e path on  the fileNa me, if any .  Passing  the empty  string
  13750                        ("")  will inser t the item  at the ro ot path wi thin the a rchive.
  13751                      
  13752       </param>
  13753                    
  13754                     
  13755       <returns>
  13756        The 
  13757        <c>
  13758         ZipEntry
  13759        </c>
  13760         correspon ding to th e file add ed.
  13761       </returns>
  13762               
  13763      </member>
  13764              
  13765      <member 
  13766       name="M:Io nic.Zip.Zi pFile.Remo veEntries( System.Col lections.G eneric.ICo llection{I onic.Zip.Z ipEntry})"
  13767      >
  13768                     
  13769       <summary>
  13770                        This  method rem oves a col lection of  entries f rom the 
  13771        <c>
  13772         ZipFile
  13773        </c>
  13774        .
  13775                      
  13776       </summary>
  13777                    
  13778                     
  13779       <param 
  13780        name="entr iesToRemov e"
  13781       >
  13782                        A col lection of  ZipEntry  instances  from this  zip file t o be remov ed. For
  13783                        examp le, you ca n pass in  an array o f ZipEntry  instances ; or you c an call
  13784                        Selec tEntries() , and then  add or re move entri es from th at
  13785                        IColl ection&lt; ZipEntry&g t; (IColle ction(Of Z ipEntry) i n VB), and  pass
  13786                        that  ICollectio n to this  method.
  13787                      
  13788       </param>
  13789                    
  13790                     
  13791       <seealso 
  13792        cref="M:Io nic.Zip.Zi pFile.Sele ctEntries( System.Str ing)"
  13793       />
  13794                     
  13795       <seealso 
  13796        cref="M:Io nic.Zip.Zi pFile.Remo veSelected Entries(Sy stem.Strin g)"
  13797       />
  13798               
  13799      </member>
  13800              
  13801      <member 
  13802       name="M:Io nic.Zip.Zi pFile.Remo veEntries( System.Col lections.G eneric.ICo llection{S ystem.Stri ng})"
  13803      >
  13804                     
  13805       <summary>
  13806                        This  method rem oves a col lection of  entries f rom the 
  13807        <c>
  13808         ZipFile
  13809        </c>
  13810        , by name.
  13811                      
  13812       </summary>
  13813                    
  13814                     
  13815       <param 
  13816        name="entr iesToRemov e"
  13817       >
  13818                        A col lection of  strings t hat refer  to names o f entries  to be remo ved
  13819                        from  the 
  13820        <c>
  13821         ZipFile
  13822        </c>
  13823        .  For exa mple, you  can pass i n an array  or a
  13824                        List  of Strings  that prov ide the na mes of ent ries to be  removed.
  13825                      
  13826       </param>
  13827                    
  13828                     
  13829       <seealso 
  13830        cref="M:Io nic.Zip.Zi pFile.Sele ctEntries( System.Str ing)"
  13831       />
  13832                     
  13833       <seealso 
  13834        cref="M:Io nic.Zip.Zi pFile.Remo veSelected Entries(Sy stem.Strin g)"
  13835       />
  13836               
  13837      </member>
  13838              
  13839      <member 
  13840       name="M:Io nic.Zip.Zi pFile.AddF iles(Syste m.Collecti ons.Generi c.IEnumera ble{System .String})"
  13841      >
  13842                     
  13843       <summary>
  13844                        This  method add s a set of  files to  the 
  13845        <c>
  13846         ZipFile
  13847        </c>
  13848        .
  13849                      
  13850       </summary>
  13851                    
  13852                     
  13853       <remarks>
  13854                      
  13855        <para>
  13856                         Use t his method  to add a  set of fil es to the  zip archiv e, in one  call.
  13857                         For e xample, a  list of fi les receiv ed from
  13858                         
  13859         <c>
  13860          System.IO. Directory. GetFiles()
  13861         </c>
  13862          can be ad ded to a z ip archive  in one
  13863                         call.
  13864                       
  13865        </para>
  13866                     
  13867                      
  13868        <para>
  13869                         For 
  13870         <c>
  13871          ZipFile
  13872         </c>
  13873          propertie s includin
  13874         <see 
  13875          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  13876         />
  13877        
  13878         <see 
  13879          cref="P:Io nic.Zip.Zi pFile.Pass word"
  13880         />
  13881        
  13882         <see 
  13883          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  13884         />
  13885        
  13886         <see 
  13887          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  13888         />
  13889        
  13890         <see 
  13891          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  13892         />
  13893         ,
  13894                         
  13895         <see 
  13896          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  13897         />
  13898         , and 
  13899         <see 
  13900          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  13901         />
  13902         , their
  13903                         respe ctive valu es at the  time of th is call wi ll be appl ied to eac h
  13904                         ZipEn try added.
  13905                       
  13906        </para>
  13907                      
  13908       </remarks>
  13909                    
  13910                     
  13911       <param 
  13912        name="file Names"
  13913       >
  13914                        The c ollection  of names o f the file s to add.  Each strin g should r efer to a
  13915                        file  in the fil esystem. T he name of  the file  may be a r elative pa th or a
  13916                        fully -qualified  path.
  13917                      
  13918       </param>
  13919                    
  13920                     
  13921       <example>
  13922                        This  example sh ows how to  create a  zip file,  and add a  few files  into it.
  13923                      
  13924        <code>
  13925                       String  ZipFileToC reate = "a rchive1.zi p";
  13926                       String  DirectoryT oZip = "c: \\reports" ;
  13927                       using ( ZipFile zi p = new Zi pFile())
  13928                       {
  13929                         // St ore all fi les found  in the top  level dir ectory, in to the zip  archive.
  13930                         Strin g[] filena mes = Syst em.IO.Dire ctory.GetF iles(Direc toryToZip) ;
  13931                         zip.A ddFiles(fi lenames);
  13932                         zip.S ave(ZipFil eToCreate) ;
  13933                       }
  13934                       
  13935        </code>
  13936                     
  13937                      
  13938        <code 
  13939         lang="VB"
  13940        >
  13941                       Dim Zip FileToCrea te As Stri ng = "arch ive1.zip"
  13942                       Dim Dir ectoryToZi p As Strin g = "c:\re ports"
  13943                       Using z ip As ZipF ile = New  ZipFile
  13944                           ' S tore all f iles found  in the to p level di rectory, i nto the zi p archive.
  13945                           Dim  filenames  As String () = Syste m.IO.Direc tory.GetFi les(Direct oryToZip)
  13946                           zip .AddFiles( filenames)
  13947                           zip .Save(ZipF ileToCreat e)
  13948                       End Usi ng
  13949                       
  13950        </code>
  13951                      
  13952       </example>
  13953                    
  13954                     
  13955       <seealso 
  13956        cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String,Sys tem.String )"
  13957       />
  13958               
  13959      </member>
  13960              
  13961      <member 
  13962       name="M:Io nic.Zip.Zi pFile.Upda teFiles(Sy stem.Colle ctions.Gen eric.IEnum erable{Sys tem.String })"
  13963      >
  13964                     
  13965       <summary>
  13966                        Adds  or updates  a set of  files in t he 
  13967        <c>
  13968         ZipFile
  13969        </c>
  13970        .
  13971                      
  13972       </summary>
  13973                    
  13974                     
  13975       <remarks>
  13976                      
  13977        <para>
  13978                         Any f iles that  already ex ist in the  archive a re updated . Any file s that
  13979                         don't  yet exist  in the ar chive are  added.
  13980                       
  13981        </para>
  13982                     
  13983                      
  13984        <para>
  13985                         For 
  13986         <c>
  13987          ZipFile
  13988         </c>
  13989          propertie s includin
  13990         <see 
  13991          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  13992         />
  13993        
  13994         <see 
  13995          cref="P:Io nic.Zip.Zi pFile.Pass word"
  13996         />
  13997        
  13998         <see 
  13999          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  14000         />
  14001        
  14002         <see 
  14003          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  14004         />
  14005        
  14006         <see 
  14007          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  14008         />
  14009         ,
  14010                         
  14011         <see 
  14012          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  14013         />
  14014         , and 
  14015         <see 
  14016          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  14017         />
  14018         , their
  14019                         respe ctive valu es at the  time of th is call wi ll be appl ied to eac h
  14020                         ZipEn try added.
  14021                       
  14022        </para>
  14023                      
  14024       </remarks>
  14025                    
  14026                     
  14027       <param 
  14028        name="file Names"
  14029       >
  14030                        The c ollection  of names o f the file s to updat e. Each st ring shoul d refer to  a file in
  14031                        the f ilesystem.  The name  of the fil e may be a  relative  path or a  fully-qual ified path .
  14032                      
  14033       </param>
  14034                    
  14035               
  14036      </member>
  14037              
  14038      <member 
  14039       name="M:Io nic.Zip.Zi pFile.AddF iles(Syste m.Collecti ons.Generi c.IEnumera ble{System .String},S ystem.Stri ng)"
  14040      >
  14041                     
  14042       <summary>
  14043                        Adds  a set of f iles to th
  14044        <c>
  14045         ZipFile
  14046        </c>
  14047        , using th e
  14048                        speci fied direc tory path  in the arc hive.
  14049                      
  14050       </summary>
  14051                    
  14052                     
  14053       <remarks>
  14054                      
  14055        <para>
  14056                         Any d irectory s tructure t hat may be  present i n the
  14057                         filen ames conta ined in th e list is  "flattened " in the
  14058                         archi ve.  Each  file in th e list is  added to t he archive  in
  14059                         the s pecified t op-level d irectory.
  14060                       
  14061        </para>
  14062                     
  14063                      
  14064        <para>
  14065                         For 
  14066         <c>
  14067          ZipFile
  14068         </c>
  14069          propertie s includin
  14070         <see 
  14071          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  14072         />
  14073        
  14074         <see 
  14075          cref="P:Io nic.Zip.Zi pFile.Pass word"
  14076         />
  14077        
  14078         <see 
  14079          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  14080         />
  14081        
  14082         <see 
  14083          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  14084         />
  14085        
  14086         <see 
  14087          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  14088         />
  14089        
  14090         <see 
  14091          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  14092         />
  14093         , and 
  14094         <see 
  14095          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  14096         />
  14097         , their re spective v alues at t he
  14098                         time  of this ca ll will be  applied t o each Zip Entry adde d.
  14099                       
  14100        </para>
  14101                      
  14102       </remarks>
  14103                    
  14104                     
  14105       <param 
  14106        name="file Names"
  14107       >
  14108                        The n ames of th e files to  add. Each  string sh ould refer  to
  14109                        a fil e in the f ilesystem.   The name  of the fi le may be  a
  14110                        relat ive path o r a fully- qualified  path.
  14111                      
  14112       </param>
  14113                    
  14114                     
  14115       <param 
  14116        name="dire ctoryPathI nArchive"
  14117       >
  14118                        Speci fies a dir ectory pat h to use t o override  any path  in the fil e name.
  14119                        Th is  path may,  or may no t, corresp ond to a r eal direct ory in the  current
  14120                        files ystem.  If  the files  within th e zip are  later extr acted, thi s is the
  14121                        path  used for t he extract ed file.   Passing 
  14122        <c>
  14123         null
  14124        </c>
  14125         (
  14126        <c>
  14127         Nothing
  14128        </c>
  14129         in
  14130                        VB) w ill use th e path on  each of th
  14131        <c>
  14132         fileNames
  14133        </c>
  14134        , if any.   Passing
  14135                        the e mpty strin g ("") wil l insert t he item at  the root  path withi n the
  14136                        archi ve.
  14137                      
  14138       </param>
  14139                    
  14140                     
  14141       <seealso 
  14142        cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String,Sys tem.String )"
  14143       />
  14144               
  14145      </member>
  14146              
  14147      <member 
  14148       name="M:Io nic.Zip.Zi pFile.AddF iles(Syste m.Collecti ons.Generi c.IEnumera ble{System .String},S ystem.Bool ean,System .String)"
  14149      >
  14150                     
  14151       <summary>
  14152                        Adds  a set of f iles to th
  14153        <c>
  14154         ZipFile
  14155        </c>
  14156        , using th e specifie d director y
  14157                        path  in the arc hive, and  preserving  the full  directory  structure  in the
  14158                        filen ames.
  14159                      
  14160       </summary>
  14161                    
  14162                     
  14163       <remarks>
  14164                     
  14165                      
  14166        <para>
  14167                         Think  of the 
  14168         <paramref 
  14169          name="dire ctoryPathI nArchive"
  14170         />
  14171          as a "roo t" or
  14172                         base  directory  used in th e archive  for the fi les that g et added.   when
  14173                         
  14174         <paramref 
  14175          name="pres erveDirHie rarchy"
  14176         />
  14177          is true,  the hierar chy of fil es
  14178                         found  in the fi lesystem w ill be pla ced, with  the hierar chy intact ,
  14179                         start ing at tha t root in  the archiv e. When 
  14180         <c>
  14181          preserveDi rHierarchy
  14182         </c>
  14183                         is fa lse, the p ath hierar chy of fil es is flat tned, and  the flatte ned
  14184                         set o f files ge ts placed  in the roo t within t he archive  as specif ied in
  14185                         
  14186         <c>
  14187          directoryP athInArchi ve
  14188         </c>
  14189         .
  14190                       
  14191        </para>
  14192                     
  14193                      
  14194        <para>
  14195                         For 
  14196         <c>
  14197          ZipFile
  14198         </c>
  14199          propertie s includin
  14200         <see 
  14201          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  14202         />
  14203        
  14204         <see 
  14205          cref="P:Io nic.Zip.Zi pFile.Pass word"
  14206         />
  14207        
  14208         <see 
  14209          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  14210         />
  14211        
  14212         <see 
  14213          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  14214         />
  14215        
  14216         <see 
  14217          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  14218         />
  14219         ,
  14220                         
  14221         <see 
  14222          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  14223         />
  14224         , and 
  14225         <see 
  14226          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  14227         />
  14228         , their
  14229                         respe ctive valu es at the  time of th is call wi ll be appl ied to eac h
  14230                         ZipEn try added.
  14231                       
  14232        </para>
  14233                     
  14234                      
  14235       </remarks>
  14236                    
  14237                     
  14238       <param 
  14239        name="file Names"
  14240       >
  14241                        The n ames of th e files to  add. Each  string sh ould refer  to a file  in the
  14242                        files ystem.  Th e name of  the file m ay be a re lative pat h or a
  14243                        fully -qualified  path.
  14244                      
  14245       </param>
  14246                    
  14247                     
  14248       <param 
  14249        name="dire ctoryPathI nArchive"
  14250       >
  14251                        Speci fies a dir ectory pat h to use a s a prefix  for each  entry name .
  14252                        This  path may,  or may not , correspo nd to a re al directo ry in the  current
  14253                        files ystem.  If  the files  within th e zip are  later extr acted, thi s is the
  14254                        path  used for t he extract ed file.   Passing 
  14255        <c>
  14256         null
  14257        </c>
  14258         (
  14259        <c>
  14260         Nothing
  14261        </c>
  14262         in
  14263                        VB) w ill use th e path on  each of th
  14264        <c>
  14265         fileNames
  14266        </c>
  14267        , if any.   Passing
  14268                        the e mpty strin g ("") wil l insert t he item at  the root  path withi n the
  14269                        archi ve.
  14270                      
  14271       </param>
  14272                    
  14273                     
  14274       <param 
  14275        name="pres erveDirHie rarchy"
  14276       >
  14277                        wheth er the ent ries in th e zip arch ive will r eflect the  directory
  14278                        hiera rchy that  is present  in the va rious file names.  Fo r example,  if
  14279                        
  14280        <paramref 
  14281         name="file Names"
  14282        />
  14283         includes  two paths,
  14284                        \Anim alia\Chord ata\Mammal ia\Info.tx t and
  14285                        \Plan tae\Magnol iophyta\Di cotyledon\ Info.txt,  then calli ng this me thod
  14286                        with 
  14287        <paramref 
  14288         name="pres erveDirHie rarchy"
  14289        />
  14290         = 
  14291        <c>
  14292         false
  14293        </c>
  14294         will
  14295                        resul t in an ex ception be cause of a  duplicate  entry nam e, while
  14296                        calli ng this me thod with 
  14297        <paramref 
  14298         name="pres erveDirHie rarchy"
  14299        />
  14300         =
  14301                        
  14302        <c>
  14303         true
  14304        </c>
  14305         will resu lt in the  full direc ory paths  being incl uded in
  14306                        the e ntries add ed to the  ZipFile.
  14307                      
  14308       </param>
  14309                     
  14310       <seealso 
  14311        cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String,Sys tem.String )"
  14312       />
  14313               
  14314      </member>
  14315              
  14316      <member 
  14317       name="M:Io nic.Zip.Zi pFile.Upda teFiles(Sy stem.Colle ctions.Gen eric.IEnum erable{Sys tem.String },System.S tring)"
  14318      >
  14319                     
  14320       <summary>
  14321                        Adds  or updates  a set of  files to t he 
  14322        <c>
  14323         ZipFile
  14324        </c>
  14325        , using th e specifie d
  14326                        direc tory path  in the arc hive.
  14327                      
  14328       </summary>
  14329                    
  14330                     
  14331       <remarks>
  14332                     
  14333                      
  14334        <para>
  14335                         Any f iles that  already ex ist in the  archive a re updated . Any file s that
  14336                         don't  yet exist  in the ar chive are  added.
  14337                       
  14338        </para>
  14339                     
  14340                      
  14341        <para>
  14342                         For 
  14343         <c>
  14344          ZipFile
  14345         </c>
  14346          propertie s includin
  14347         <see 
  14348          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  14349         />
  14350        
  14351         <see 
  14352          cref="P:Io nic.Zip.Zi pFile.Pass word"
  14353         />
  14354        
  14355         <see 
  14356          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  14357         />
  14358        
  14359         <see 
  14360          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  14361         />
  14362        
  14363         <see 
  14364          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  14365         />
  14366         ,
  14367                         
  14368         <see 
  14369          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  14370         />
  14371         , and 
  14372         <see 
  14373          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  14374         />
  14375         , their
  14376                         respe ctive valu es at the  time of th is call wi ll be appl ied to eac h
  14377                         ZipEn try added.
  14378                       
  14379        </para>
  14380                      
  14381       </remarks>
  14382                    
  14383                     
  14384       <param 
  14385        name="file Names"
  14386       >
  14387                        The n ames of th e files to  add or up date. Each  string sh ould refer  to a
  14388                        file  in the fil esystem.   The name o f the file  may be a  relative p ath or a
  14389                        fully -qualified  path.
  14390                      
  14391       </param>
  14392                    
  14393                     
  14394       <param 
  14395        name="dire ctoryPathI nArchive"
  14396       >
  14397                        Speci fies a dir ectory pat h to use t o override  any path  in the fil e name.
  14398                        This  path may,  or may not , correspo nd to a re al directo ry in the  current
  14399                        files ystem.  If  the files  within th e zip are  later extr acted, thi s is the
  14400                        path  used for t he extract ed file.   Passing 
  14401        <c>
  14402         null
  14403        </c>
  14404         (
  14405        <c>
  14406         Nothing
  14407        </c>
  14408         in
  14409                        VB) w ill use th e path on  each of th
  14410        <c>
  14411         fileNames
  14412        </c>
  14413        , if any.   Passing
  14414                        the e mpty strin g ("") wil l insert t he item at  the root  path withi n the
  14415                        archi ve.
  14416                      
  14417       </param>
  14418                    
  14419                     
  14420       <seealso 
  14421        cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String,Sys tem.String )"
  14422       />
  14423               
  14424      </member>
  14425              
  14426      <member 
  14427       name="M:Io nic.Zip.Zi pFile.Upda teFile(Sys tem.String )"
  14428      >
  14429                     
  14430       <summary>
  14431                        Adds  or Updates  a File in  a Zip fil e archive.
  14432                      
  14433       </summary>
  14434                    
  14435                     
  14436       <remarks>
  14437                      
  14438        <para>
  14439                         This  method add s a file t o a zip ar chive, or,  if the fi le already  exists
  14440                         in th e zip arch ive, this  method Upd ates the c ontent of  that given  filename
  14441                         in th e zip arch ive.  The 
  14442         <c>
  14443          UpdateFile
  14444         </c>
  14445          method mi ght more a ccurately  be
  14446                         calle d "AddOrUp dateFile".
  14447                       
  14448        </para>
  14449                     
  14450                      
  14451        <para>
  14452                         Upon  success, t here is no  way for t he applica tion to le arn whethe r the file
  14453                         was a dded versu s updated.
  14454                       
  14455        </para>
  14456                     
  14457                      
  14458        <para>
  14459                         For 
  14460         <c>
  14461          ZipFile
  14462         </c>
  14463          propertie s includin
  14464         <see 
  14465          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  14466         />
  14467        
  14468         <see 
  14469          cref="P:Io nic.Zip.Zi pFile.Pass word"
  14470         />
  14471        
  14472         <see 
  14473          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  14474         />
  14475        
  14476         <see 
  14477          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  14478         />
  14479        
  14480         <see 
  14481          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  14482         />
  14483         ,
  14484                         
  14485         <see 
  14486          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  14487         />
  14488         , and 
  14489         <see 
  14490          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  14491         />
  14492         , their
  14493                         respe ctive valu es at the  time of th is call wi ll be appl ied to the
  14494                         
  14495         <c>
  14496          ZipEntry
  14497         </c>
  14498          added.
  14499                       
  14500        </para>
  14501                      
  14502       </remarks>
  14503                    
  14504                     
  14505       <example>
  14506                     
  14507                        This  example sh ows how to  Update an  existing  entry in a  zipfile.  The first
  14508                        call  to UpdateF ile adds t he file to  the newly -created z ip archive .  The
  14509                        secon d call to  UpdateFile  updates t he content  for that  file in th e zip
  14510                        archi ve.
  14511                     
  14512                      
  14513        <code>
  14514                       using ( ZipFile zi p1 = new Z ipFile())
  14515                       {
  14516                         // Up dateFile m ight more  accurately  be called  "AddOrUpd ateFile"
  14517                         zip1. UpdateFile ("MyDocume nts\\Readm e.txt");
  14518                         zip1. UpdateFile ("Customer List.csv") ;
  14519                         zip1. Comment =  "This zip  archive ha s been cre ated.";
  14520                         zip1. Save("Cont ent.zip");
  14521                       }
  14522                      
  14523                       using ( ZipFile zi p2 = ZipFi le.Read("C ontent.zip "))
  14524                       {
  14525                         zip2. UpdateFile ("Updates\ \Readme.tx t");
  14526                         zip2. Comment =  "This zip  archive ha s been upd ated: The  Readme.txt  file has  been chang ed.";
  14527                         zip2. Save();
  14528                       }
  14529                      
  14530                       
  14531        </code>
  14532                      
  14533        <code 
  14534         lang="VB"
  14535        >
  14536                         Using  zip1 As N ew ZipFile
  14537                             '  UpdateFil e might mo re accurat ely be cal led "AddOr UpdateFile "
  14538                             z ip1.Update File("MyDo cuments\Re adme.txt")
  14539                             z ip1.Update File("Cust omerList.c sv")
  14540                             z ip1.Commen t = "This  zip archiv e has been  created."
  14541                             z ip1.Save(" Content.zi p")
  14542                         End U sing
  14543                      
  14544                         Using  zip2 As Z ipFile = Z ipFile.Rea d("Content .zip")
  14545                             z ip2.Update File("Upda tes\Readme .txt")
  14546                             z ip2.Commen t = "This  zip archiv e has been  updated:  The Readme .txt file  has been c hanged."
  14547                             z ip2.Save
  14548                         End U sing
  14549                       
  14550        </code>
  14551                      
  14552       </example>
  14553                    
  14554                     
  14555       <seealso 
  14556        cref="M:Io nic.Zip.Zi pFile.AddF ile(System .String)"
  14557       />
  14558                     
  14559       <seealso 
  14560        cref="M:Io nic.Zip.Zi pFile.Upda teDirector y(System.S tring)"
  14561       />
  14562                     
  14563       <seealso 
  14564        cref="M:Io nic.Zip.Zi pFile.Upda teItem(Sys tem.String )"
  14565       />
  14566                    
  14567                     
  14568       <param 
  14569        name="file Name"
  14570       >
  14571                        The n ame of the  file to a dd or upda te. It sho uld refer  to a file  in the
  14572                        files ystem.  Th e name of  the file m ay be a re lative pat h or a
  14573                        fully -qualified  path.
  14574                      
  14575       </param>
  14576                    
  14577                     
  14578       <returns>
  14579                        The 
  14580        <c>
  14581         ZipEntry
  14582        </c>
  14583         correspon ding to th e File tha t was adde d or updat ed.
  14584                      
  14585       </returns>
  14586               
  14587      </member>
  14588              
  14589      <member 
  14590       name="M:Io nic.Zip.Zi pFile.Upda teFile(Sys tem.String ,System.St ring)"
  14591      >
  14592                     
  14593       <summary>
  14594                        Adds  or Updates  a File in  a Zip fil e archive.
  14595                      
  14596       </summary>
  14597                    
  14598                     
  14599       <remarks>
  14600                      
  14601        <para>
  14602                         This  method add s a file t o a zip ar chive, or,  if the fi le already  exists
  14603                         in th e zip arch ive, this  method Upd ates the c ontent of  that given  filename
  14604                         in th e zip arch ive.
  14605                       
  14606        </para>
  14607                     
  14608                      
  14609        <para>
  14610                         This  version of  the metho d allows t he caller  to explici tly specif y the
  14611                         direc tory path  to be used  in the ar chive.  Th e entry to  be added  or
  14612                         updat ed is foun d by using  the speci fied direc tory path,  combined  with the
  14613                         basen ame of the  specified  filename.
  14614                       
  14615        </para>
  14616                     
  14617                      
  14618        <para>
  14619                         Upon  success, t here is no  way for t he applica tion to le arn if the  file was
  14620                         added  versus up dated.
  14621                       
  14622        </para>
  14623                     
  14624                      
  14625        <para>
  14626                         For 
  14627         <c>
  14628          ZipFile
  14629         </c>
  14630          propertie s includin
  14631         <see 
  14632          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  14633         />
  14634        
  14635         <see 
  14636          cref="P:Io nic.Zip.Zi pFile.Pass word"
  14637         />
  14638        
  14639         <see 
  14640          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  14641         />
  14642        
  14643         <see 
  14644          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  14645         />
  14646        
  14647         <see 
  14648          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  14649         />
  14650         ,
  14651                         
  14652         <see 
  14653          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  14654         />
  14655         , and 
  14656         <see 
  14657          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  14658         />
  14659         , their
  14660                         respe ctive valu es at the  time of th is call wi ll be appl ied to the
  14661                         
  14662         <c>
  14663          ZipEntry
  14664         </c>
  14665          added.
  14666                       
  14667        </para>
  14668                      
  14669       </remarks>
  14670                    
  14671                     
  14672       <seealso 
  14673        cref="M:Io nic.Zip.Zi pFile.AddF ile(System .String,Sy stem.Strin g)"
  14674       />
  14675                     
  14676       <seealso 
  14677        cref="M:Io nic.Zip.Zi pFile.Upda teDirector y(System.S tring,Syst em.String) "
  14678       />
  14679                     
  14680       <seealso 
  14681        cref="M:Io nic.Zip.Zi pFile.Upda teItem(Sys tem.String ,System.St ring)"
  14682       />
  14683                    
  14684                     
  14685       <param 
  14686        name="file Name"
  14687       >
  14688                        The n ame of the  file to a dd or upda te. It sho uld refer  to a file  in the
  14689                        files ystem.  Th e name of  the file m ay be a re lative pat h or a
  14690                        fully -qualified  path.
  14691                      
  14692       </param>
  14693                    
  14694                     
  14695       <param 
  14696        name="dire ctoryPathI nArchive"
  14697       >
  14698                        Speci fies a dir ectory pat h to use t o override  any path  in the
  14699                        
  14700        <c>
  14701         fileName
  14702        </c>
  14703        .  This pa th may, or  may not,  correspond  to a real
  14704                        direc tory in th e current  filesystem .  If the  files with in the zip  are
  14705                        later  extracted , this is  the path u sed for th e extracte d file.  P assing
  14706                        
  14707        <c>
  14708         null
  14709        </c>
  14710         (
  14711        <c>
  14712         Nothing
  14713        </c>
  14714         in VB) wi ll use the  path on t he
  14715                        
  14716        <c>
  14717         fileName
  14718        </c>
  14719        , if any.   Passing t he empty s tring ("")  will inse rt the
  14720                        item  at the roo t path wit hin the ar chive.
  14721                      
  14722       </param>
  14723                    
  14724                     
  14725       <returns>
  14726                        The 
  14727        <c>
  14728         ZipEntry
  14729        </c>
  14730         correspon ding to th e File tha t was adde d or updat ed.
  14731                      
  14732       </returns>
  14733               
  14734      </member>
  14735              
  14736      <member 
  14737       name="M:Io nic.Zip.Zi pFile.Upda teDirector y(System.S tring)"
  14738      >
  14739                     
  14740       <summary>
  14741                        Add o r update a  directory  in a zip  archive.
  14742                      
  14743       </summary>
  14744                    
  14745                     
  14746       <remarks>
  14747                        If th e specifie d director y does not  exist in  the archiv e, then th is method
  14748                        is eq uivalent t o calling 
  14749        <c>
  14750         AddDirecto ry()
  14751        </c>
  14752        .  If the  specified
  14753                        direc tory alrea dy exists  in the arc hive, then  this meth od updates  any
  14754                        exist ing entrie s, and add s any new  entries. A ny entries  that are  in the
  14755                        zip a rchive but  not in th e specifie d director y, are lef t alone.   In other
  14756                        words , the cont ents of th e zip file  will be a  union of  the previo us
  14757                        conte nts and th e new file s.
  14758                      
  14759       </remarks>
  14760                    
  14761                     
  14762       <seealso 
  14763        cref="M:Io nic.Zip.Zi pFile.Upda teFile(Sys tem.String )"
  14764       />
  14765                     
  14766       <seealso 
  14767        cref="M:Io nic.Zip.Zi pFile.AddD irectory(S ystem.Stri ng)"
  14768       />
  14769                     
  14770       <seealso 
  14771        cref="M:Io nic.Zip.Zi pFile.Upda teItem(Sys tem.String )"
  14772       />
  14773                    
  14774                     
  14775       <param 
  14776        name="dire ctoryName"
  14777       >
  14778                        The p ath to the  directory  to be add ed to the  zip archiv e, or upda ted in
  14779                        the z ip archive .
  14780                      
  14781       </param>
  14782                    
  14783                     
  14784       <returns>
  14785                      The 
  14786        <c>
  14787         ZipEntry
  14788        </c>
  14789         correspon ding to th e Director y that was  added or  updated.
  14790                      
  14791       </returns>
  14792               
  14793      </member>
  14794              
  14795      <member 
  14796       name="M:Io nic.Zip.Zi pFile.Upda teDirector y(System.S tring,Syst em.String) "
  14797      >
  14798                     
  14799       <summary>
  14800                        Add o r update a  directory  in the zi p archive  at the spe cified roo t
  14801                        direc tory in th e archive.
  14802                      
  14803       </summary>
  14804                    
  14805                     
  14806       <remarks>
  14807                        If th e specifie d director y does not  exist in  the archiv e, then th is method
  14808                        is eq uivalent t o calling 
  14809        <c>
  14810         AddDirecto ry()
  14811        </c>
  14812        .  If the  specified
  14813                        direc tory alrea dy exists  in the arc hive, then  this meth od updates  any
  14814                        exist ing entrie s, and add s any new  entries. A ny entries  that are  in the
  14815                        zip a rchive but  not in th e specifie d director y, are lef t alone.   In other
  14816                        words , the cont ents of th e zip file  will be a  union of  the previo us
  14817                        conte nts and th e new file s.
  14818                      
  14819       </remarks>
  14820                    
  14821                     
  14822       <seealso 
  14823        cref="M:Io nic.Zip.Zi pFile.Upda teFile(Sys tem.String ,System.St ring)"
  14824       />
  14825                     
  14826       <seealso 
  14827        cref="M:Io nic.Zip.Zi pFile.AddD irectory(S ystem.Stri ng,System. String)"
  14828       />
  14829                     
  14830       <seealso 
  14831        cref="M:Io nic.Zip.Zi pFile.Upda teItem(Sys tem.String ,System.St ring)"
  14832       />
  14833                    
  14834                     
  14835       <param 
  14836        name="dire ctoryName"
  14837       >
  14838                        The p ath to the  directory  to be add ed to the  zip archiv e, or upda ted
  14839                        in th e zip arch ive.
  14840                      
  14841       </param>
  14842                    
  14843                     
  14844       <param 
  14845        name="dire ctoryPathI nArchive"
  14846       >
  14847                        Speci fies a dir ectory pat h to use t o override  any path  in the
  14848                        
  14849        <c>
  14850         directoryN ame
  14851        </c>
  14852        .  This pa th may, or  may not,  correspond  to a real
  14853                        direc tory in th e current  filesystem .  If the  files with in the zip  are
  14854                        later  extracted , this is  the path u sed for th e extracte d file.  P assing
  14855                        
  14856        <c>
  14857         null
  14858        </c>
  14859         (
  14860        <c>
  14861         Nothing
  14862        </c>
  14863         in VB) wi ll use the  path on t he
  14864                        
  14865        <c>
  14866         directoryN ame
  14867        </c>
  14868        , if any.   Passing t he empty s tring ("")  will inse rt
  14869                        the i tem at the  root path  within th e archive.
  14870                      
  14871       </param>
  14872                    
  14873                     
  14874       <returns>
  14875                        The 
  14876        <c>
  14877         ZipEntry
  14878        </c>
  14879         correspon ding to th e Director y that was  added or  updated.
  14880                      
  14881       </returns>
  14882               
  14883      </member>
  14884              
  14885      <member 
  14886       name="M:Io nic.Zip.Zi pFile.Upda teItem(Sys tem.String )"
  14887      >
  14888                     
  14889       <summary>
  14890                        Add o r update a  file or d irectory i n the zip  archive.
  14891                      
  14892       </summary>
  14893                    
  14894                     
  14895       <remarks>
  14896                      
  14897        <para>
  14898                         This  is useful  when the a pplication  is not su re or does  not care  if the
  14899                         item  to be adde d is a fil e or direc tory, and  does not k now or doe s not
  14900                         care  if the ite m already  exists in  the 
  14901         <c>
  14902          ZipFile
  14903         </c>
  14904         . Calling  this metho d
  14905                         is eq uivalent t o calling 
  14906         <c>
  14907          RemoveEntr y()
  14908         </c>
  14909          if an ent ry by the  same name
  14910                         alrea dy exists,  followed  calling by  
  14911         <c>
  14912          AddItem()
  14913         </c>
  14914         .
  14915                       
  14916        </para>
  14917                     
  14918                      
  14919        <para>
  14920                         For 
  14921         <c>
  14922          ZipFile
  14923         </c>
  14924          propertie s includin
  14925         <see 
  14926          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  14927         />
  14928        
  14929         <see 
  14930          cref="P:Io nic.Zip.Zi pFile.Pass word"
  14931         />
  14932        
  14933         <see 
  14934          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  14935         />
  14936        
  14937         <see 
  14938          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  14939         />
  14940        
  14941         <see 
  14942          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  14943         />
  14944         ,
  14945                         
  14946         <see 
  14947          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  14948         />
  14949         , and 
  14950         <see 
  14951          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  14952         />
  14953         , their
  14954                         respe ctive valu es at the  time of th is call wi ll be appl ied to the
  14955                         
  14956         <c>
  14957          ZipEntry
  14958         </c>
  14959          added.
  14960                       
  14961        </para>
  14962                      
  14963       </remarks>
  14964                    
  14965                     
  14966       <seealso 
  14967        cref="M:Io nic.Zip.Zi pFile.AddI tem(System .String)"
  14968       />
  14969                     
  14970       <seealso 
  14971        cref="M:Io nic.Zip.Zi pFile.Upda teFile(Sys tem.String )"
  14972       />
  14973                     
  14974       <seealso 
  14975        cref="M:Io nic.Zip.Zi pFile.Upda teDirector y(System.S tring)"
  14976       />
  14977                    
  14978                     
  14979       <param 
  14980        name="item Name"
  14981       >
  14982                       the pa th to the  file or di rectory to  be added  or updated .
  14983                      
  14984       </param>
  14985               
  14986      </member>
  14987              
  14988      <member 
  14989       name="M:Io nic.Zip.Zi pFile.Upda teItem(Sys tem.String ,System.St ring)"
  14990      >
  14991                     
  14992       <summary>
  14993                        Add o r update a  file or d irectory.
  14994                      
  14995       </summary>
  14996                    
  14997                     
  14998       <remarks>
  14999                      
  15000        <para>
  15001                         This  method is  useful whe n the appl ication is  not sure  or does no t care if
  15002                         the i tem to be  added is a  file or d irectory,  and does n ot know or  does not
  15003                         care  if the ite m already  exists in  the 
  15004         <c>
  15005          ZipFile
  15006         </c>
  15007         . Calling  this metho d
  15008                         is eq uivalent t o calling 
  15009         <c>
  15010          RemoveEntr y()
  15011         </c>
  15012         , if an en try by tha t name
  15013                         exist s, and the n calling 
  15014         <c>
  15015          AddItem()
  15016         </c>
  15017         .
  15018                       
  15019        </para>
  15020                     
  15021                      
  15022        <para>
  15023                         This  version of  the metho d allows t he caller  to explici tly specif y the
  15024                         direc tory path  to be used  for the i tem being  added to t he archive .  The
  15025                         entry  or entrie s that are  added or  updated wi ll use the  specified
  15026                         
  15027         <c>
  15028          DirectoryP athInArchi ve
  15029         </c>
  15030         . Extracti ng the ent ry from th e archive  will
  15031                         resul t in a fil e stored i n that dir ectory pat h.
  15032                       
  15033        </para>
  15034                     
  15035                      
  15036        <para>
  15037                         For 
  15038         <c>
  15039          ZipFile
  15040         </c>
  15041          propertie s includin
  15042         <see 
  15043          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  15044         />
  15045        
  15046         <see 
  15047          cref="P:Io nic.Zip.Zi pFile.Pass word"
  15048         />
  15049        
  15050         <see 
  15051          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  15052         />
  15053        
  15054         <see 
  15055          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  15056         />
  15057        
  15058         <see 
  15059          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  15060         />
  15061         ,
  15062                         
  15063         <see 
  15064          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  15065         />
  15066         , and 
  15067         <see 
  15068          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  15069         />
  15070         , their
  15071                         respe ctive valu es at the  time of th is call wi ll be appl ied to the
  15072                         
  15073         <c>
  15074          ZipEntry
  15075         </c>
  15076          added.
  15077                       
  15078        </para>
  15079                      
  15080       </remarks>
  15081                    
  15082                     
  15083       <seealso 
  15084        cref="M:Io nic.Zip.Zi pFile.AddI tem(System .String,Sy stem.Strin g)"
  15085       />
  15086                     
  15087       <seealso 
  15088        cref="M:Io nic.Zip.Zi pFile.Upda teFile(Sys tem.String ,System.St ring)"
  15089       />
  15090                     
  15091       <seealso 
  15092        cref="M:Io nic.Zip.Zi pFile.Upda teDirector y(System.S tring,Syst em.String) "
  15093       />
  15094                    
  15095                     
  15096       <param 
  15097        name="item Name"
  15098       >
  15099                        The p ath for th e File or  Directory  to be adde d or updat ed.
  15100                      
  15101       </param>
  15102                     
  15103       <param 
  15104        name="dire ctoryPathI nArchive"
  15105       >
  15106                        Speci fies a dir ectory pat h to use t o override  any path  in the
  15107                        
  15108        <c>
  15109         itemName
  15110        </c>
  15111        .  This pa th may, or  may not,  correspond  to a real
  15112                        direc tory in th e current  filesystem .  If the  files with in the zip  are
  15113                        later  extracted , this is  the path u sed for th e extracte d file.  P assing
  15114                        
  15115        <c>
  15116         null
  15117        </c>
  15118         (
  15119        <c>
  15120         Nothing
  15121        </c>
  15122         in VB) wi ll use the  path on t he
  15123                        
  15124        <c>
  15125         itemName
  15126        </c>
  15127        , if any.   Passing t he empty s tring ("")  will inse rt the
  15128                        item  at the roo t path wit hin the ar chive.
  15129                      
  15130       </param>
  15131               
  15132      </member>
  15133              
  15134      <member 
  15135       name="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,S ystem.Stri ng)"
  15136      >
  15137                     
  15138       <summary>
  15139                        Adds  a named en try into t he zip arc hive, taki ng content  for the e ntry
  15140                        from  a string.
  15141                      
  15142       </summary>
  15143                    
  15144                     
  15145       <remarks>
  15146                        Calli ng this me thod creat es an entr y using th e given fi leName and
  15147                        direc tory path  within the  archive.   There is  no need fo r a file b y the
  15148                        given  name to e xist in th e filesyst em; the na me is used  within th e zip
  15149                        archi ve only. T he content  for the e ntry is en coded usin g the defa ult text
  15150                        encod ing for th e machine,  or on Sil verlight,  using UTF- 8.
  15151                      
  15152       </remarks>
  15153                    
  15154                     
  15155       <param 
  15156        name="cont ent"
  15157       >
  15158                        The c ontent of  the file,  should it  be extract ed from th e zip.
  15159                      
  15160       </param>
  15161                    
  15162                     
  15163       <param 
  15164        name="entr yName"
  15165       >
  15166                        The n ame, inclu ding any p ath, to us e for the  entry with in the arc hive.
  15167                      
  15168       </param>
  15169                    
  15170                     
  15171       <returns>
  15172        The 
  15173        <c>
  15174         ZipEntry
  15175        </c>
  15176         added.
  15177       </returns>
  15178                    
  15179                     
  15180       <example>
  15181                     
  15182                      This ex ample show s how to a dd an entr y to the z ipfile, us ing a stri ng as
  15183                      content  for that  entry.
  15184                     
  15185                      
  15186        <code 
  15187         lang="C#"
  15188        >
  15189                       string  Content =  "This stri ng will be  the conte nt of the  Readme.txt  file in t he zip arc hive.";
  15190                       using ( ZipFile zi p1 = new Z ipFile())
  15191                       {
  15192                         zip1. AddFile("M yDocuments \\Resume.d oc", "file s");
  15193                         zip1. AddEntry(" Readme.txt ", Content );
  15194                         zip1. Comment =  "This zip  file was c reated at  " + System .DateTime. Now.ToStri ng("G");
  15195                         zip1. Save("Cont ent.zip");
  15196                       }
  15197                      
  15198                       
  15199        </code>
  15200                      
  15201        <code 
  15202         lang="VB"
  15203        >
  15204                       Public  Sub Run()
  15205                         Dim C ontent As  String = " This strin g will be  the conten t of the R eadme.txt  file in th e zip arch ive."
  15206                         Using  zip1 As Z ipFile = N ew ZipFile
  15207                           zip 1.AddEntry ("Readme.t xt", Conte nt)
  15208                           zip 1.AddFile( "MyDocumen ts\Resume. doc", "fil es")
  15209                           zip 1.Comment  = ("This z ip file wa s created  at " &amp;  DateTime. Now.ToStri ng("G"))
  15210                           zip 1.Save("Co ntent.zip" )
  15211                         End U sing
  15212                       End Sub
  15213                       
  15214        </code>
  15215                      
  15216       </example>
  15217               
  15218      </member>
  15219              
  15220      <member 
  15221       name="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,S ystem.Stri ng,System. Text.Encod ing)"
  15222      >
  15223                     
  15224       <summary>
  15225                        Adds  a named en try into t he zip arc hive, taki ng content  for the e ntry
  15226                        from  a string,  and using  the specif ied text e ncoding.
  15227                      
  15228       </summary>
  15229                    
  15230                     
  15231       <remarks>
  15232                     
  15233                      
  15234        <para>
  15235                         Calli ng this me thod creat es an entr y using th e given fi leName and
  15236                         direc tory path  within the  archive.   There is  no need fo r a file b y the
  15237                         given  name to e xist in th e filesyst em; the na me is used  within th e zip
  15238                         archi ve only.
  15239                       
  15240        </para>
  15241                     
  15242                      
  15243        <para>
  15244                         The c ontent for  the entry , a string  value, is  encoded u sing the g iven
  15245                         text  encoding.  A BOM (byt e-order-ma rk) is emi tted into  the file,  if the
  15246                         Encod ing parame ter is set  for that.
  15247                       
  15248        </para>
  15249                     
  15250                      
  15251        <para>
  15252                         Most  Encoding c lasses sup port a con structor t hat accept s a boolea n,
  15253                         indic ating whet her to emi t a BOM or  not. For  example se
  15254         <see 
  15255          cref="M:Sy stem.Text. UTF8Encodi ng.#ctor(S ystem.Bool ean)"
  15256         />
  15257         .
  15258                       
  15259        </para>
  15260                     
  15261                      
  15262       </remarks>
  15263                    
  15264                     
  15265       <param 
  15266        name="entr yName"
  15267       >
  15268                        The n ame, inclu ding any p ath, to us e within t he archive  for the e ntry.
  15269                      
  15270       </param>
  15271                    
  15272                     
  15273       <param 
  15274        name="cont ent"
  15275       >
  15276                        The c ontent of  the file,  should it  be extract ed from th e zip.
  15277                      
  15278       </param>
  15279                    
  15280                     
  15281       <param 
  15282        name="enco ding"
  15283       >
  15284                        The t ext encodi ng to use  when encod ing the st ring. Be a ware: This  is
  15285                        disti nct from t he text en coding use d to encod e the file Name, as s pecified
  15286                        in 
  15287        <see 
  15288         cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  15289        />
  15290        .
  15291                      
  15292       </param>
  15293                    
  15294                     
  15295       <returns>
  15296        The 
  15297        <c>
  15298         ZipEntry
  15299        </c>
  15300         added.
  15301       </returns>
  15302                    
  15303               
  15304      </member>
  15305              
  15306      <member 
  15307       name="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,S ystem.IO.S tream)"
  15308      >
  15309                     
  15310       <summary>
  15311                        Creat e an entry  in the 
  15312        <c>
  15313         ZipFile
  15314        </c>
  15315         using the  given 
  15316        <c>
  15317         Stream
  15318        </c>
  15319                        as in put.  The  entry will  have the  given file name.
  15320                      
  15321       </summary>
  15322                    
  15323                     
  15324       <remarks>
  15325                     
  15326                      
  15327        <para>
  15328                         The a pplication  should pr ovide an o pen, reada ble stream ; in this  case it
  15329                         will  be read du ring the c all to 
  15330         <see 
  15331          cref="M:Io nic.Zip.Zi pFile.Save "
  15332         />
  15333          or one of
  15334                         its o verloads.
  15335                       
  15336        </para>
  15337                     
  15338                      
  15339        <para>
  15340                         The p assed stre am will be  read from  its curre nt positio n. If
  15341                         neces sary, call ers should  set the p osition in  the strea m before
  15342                         calli ng AddEntr y(). This  might be a ppropriate  when usin g this met hod
  15343                         with  a MemorySt ream, for  example.
  15344                       
  15345        </para>
  15346                     
  15347                      
  15348        <para>
  15349                         In ca ses where  a large nu mber of st reams will  be added  to the
  15350                         
  15351         <c>
  15352          ZipFile
  15353         </c>
  15354         , the appl ication ma y wish to  avoid main taining al l of the
  15355                         strea ms open si multaneous ly.  To ha ndle this  situation,  the appli cation
  15356                         shoul d use the 
  15357         <see 
  15358          cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,I onic.Zip.O penDelegat e,Ionic.Zi p.CloseDel egate)"
  15359         />
  15360                         overl oad.
  15361                       
  15362        </para>
  15363                     
  15364                      
  15365        <para>
  15366                         For 
  15367         <c>
  15368          ZipFile
  15369         </c>
  15370          propertie s includin
  15371         <see 
  15372          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  15373         />
  15374        
  15375         <see 
  15376          cref="P:Io nic.Zip.Zi pFile.Pass word"
  15377         />
  15378        
  15379         <see 
  15380          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  15381         />
  15382        
  15383         <see 
  15384          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  15385         />
  15386        
  15387         <see 
  15388          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  15389         />
  15390         ,
  15391                         
  15392         <see 
  15393          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  15394         />
  15395         , and 
  15396         <see 
  15397          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  15398         />
  15399         , their
  15400                         respe ctive valu es at the  time of th is call wi ll be appl ied to the
  15401                         
  15402         <c>
  15403          ZipEntry
  15404         </c>
  15405          added.
  15406                       
  15407        </para>
  15408                     
  15409                      
  15410       </remarks>
  15411                    
  15412                     
  15413       <example>
  15414                      
  15415        <para>
  15416                         This  example ad ds a singl e entry to  a 
  15417         <c>
  15418          ZipFile
  15419         </c>
  15420          via a 
  15421         <c>
  15422          Stream
  15423         </c>
  15424         .
  15425                       
  15426        </para>
  15427                     
  15428                      
  15429        <code 
  15430         lang="C#"
  15431        >
  15432                       String  zipToCreat e = "Conte nt.zip";
  15433                       String  fileNameIn Archive =  "Content-F rom-Stream .bin";
  15434                       using ( System.IO. Stream str eamToRead  = MyStream Opener())
  15435                       {
  15436                         using  (ZipFile  zip = new  ZipFile())
  15437                         {
  15438                           Zip Entry entr y= zip.Add Entry(file NameInArch ive, strea mToRead);
  15439                           zip .AddFile(" Readme.txt ");
  15440                           zip .Save(zipT oCreate);   // the st ream is re ad implici tly here
  15441                         }
  15442                       }
  15443                       
  15444        </code>
  15445                     
  15446                      
  15447        <code 
  15448         lang="VB"
  15449        >
  15450                       Dim zip ToCreate A s String =  "Content. zip"
  15451                       Dim fil eNameInArc hive As St ring = "Co ntent-From -Stream.bi n"
  15452                       Using s treamToRea d as Syste m.IO.Strea m = MyStre amOpener()
  15453                         Using  zip As Zi pFile = Ne w ZipFile( )
  15454                           Dim  entry as  ZipEntry =  zip.AddEn try(fileNa meInArchiv e, streamT oRead)
  15455                           zip .AddFile(" Readme.txt ")
  15456                           zip .Save(zipT oCreate)   '' the str eam is rea d implicit ly, here
  15457                         End U sing
  15458                       End Usi ng
  15459                       
  15460        </code>
  15461                      
  15462       </example>
  15463                    
  15464                     
  15465       <seealso 
  15466        cref="M:Io nic.Zip.Zi pFile.Upda teEntry(Sy stem.Strin g,System.I O.Stream)"
  15467       />
  15468                    
  15469                     
  15470       <param 
  15471        name="entr yName"
  15472       >
  15473                        The n ame, inclu ding any p ath, which  is shown  in the zip  file for  the added
  15474                        entry .
  15475                      
  15476       </param>
  15477                     
  15478       <param 
  15479        name="stre am"
  15480       >
  15481                        The i nput strea m from whi ch to grab  content f or the fil e
  15482                      
  15483       </param>
  15484                     
  15485       <returns>
  15486        The 
  15487        <c>
  15488         ZipEntry
  15489        </c>
  15490         added.
  15491       </returns>
  15492               
  15493      </member>
  15494              
  15495      <member 
  15496       name="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,I onic.Zip.W riteDelega te)"
  15497      >
  15498                     
  15499       <summary>
  15500                        Add a  ZipEntry  for which  content is  written d irectly by  the appli cation.
  15501                      
  15502       </summary>
  15503                    
  15504                     
  15505       <remarks>
  15506                      
  15507        <para>
  15508                         When  the applic ation need s to write  the zip e ntry data,  use this
  15509                         metho d to add t he ZipEntr y. For exa mple, in t he case th at the
  15510                         appli cation wis hes to wri te the XML  represent ation of a  DataSet i nto
  15511                         a Zip Entry, the  applicati on can use  this meth od to do s o.
  15512                       
  15513        </para>
  15514                     
  15515                      
  15516        <para>
  15517                         For 
  15518         <c>
  15519          ZipFile
  15520         </c>
  15521          propertie s includin
  15522         <see 
  15523          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  15524         />
  15525        
  15526         <see 
  15527          cref="P:Io nic.Zip.Zi pFile.Pass word"
  15528         />
  15529        
  15530         <see 
  15531          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  15532         />
  15533        
  15534         <see 
  15535          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  15536         />
  15537        
  15538         <see 
  15539          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  15540         />
  15541         ,
  15542                         
  15543         <see 
  15544          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  15545         />
  15546         , and 
  15547         <see 
  15548          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  15549         />
  15550         , their
  15551                         respe ctive valu es at the  time of th is call wi ll be appl ied to the
  15552                         
  15553         <c>
  15554          ZipEntry
  15555         </c>
  15556          added.
  15557                       
  15558        </para>
  15559                     
  15560                      
  15561        <para>
  15562                         About  progress  events: Wh en using t he WriteDe legate, Do tNetZip do es
  15563                         not i ssue any S aveProgres s events w ith 
  15564         <c>
  15565          EventType
  15566         </c>
  15567          = 
  15568         <see 
  15569          cref="F:Io nic.Zip.Zi pProgressE ventType.S aving_Entr yBytesRead "
  15570         >
  15571                          Savin g_EntryByt esRead
  15572         </see>
  15573         . (This is  because i t is the
  15574                         appli cation's c ode that r uns in Wri teDelegate  - there's  no way fo r
  15575                         DotNe tZip to kn ow when to  issue a E ntryBytesR ead event. )
  15576                         Appli cations th at want to  update a  progress b ar or simi lar status
  15577                         indic ator shoul d do so fr om within  the WriteD elegate
  15578                         itsel f. DotNetZ ip will is sue the ot her SavePr ogress eve nts,
  15579                         inclu ding 
  15580         <see 
  15581          cref="F:Io nic.Zip.Zi pProgressE ventType.S aving_Star ted"
  15582         >
  15583                          Savin g_Started
  15584         </see>
  15585         ,
  15586                         
  15587         <see 
  15588          cref="F:Io nic.Zip.Zi pProgressE ventType.S aving_Befo reWriteEnt ry"
  15589         >
  15590                          Savin g_BeforeWr iteEntry
  15591         </see>
  15592         , and 
  15593         <see 
  15594          cref="F:Io nic.Zip.Zi pProgressE ventType.S aving_Afte rWriteEntr y"
  15595         >
  15596                          Savin g_AfterWri teEntry
  15597         </see>
  15598         .
  15599                       
  15600        </para>
  15601                     
  15602                      
  15603        <para>
  15604                         Note:  When you  use PKZip  encryption , it's nor mally nece ssary to
  15605                         compu te the CRC  of the co ntent to b e encrypte d, before  compressin g or
  15606                         encry pting it.  Therefore,  when usin g PKZip en cryption w ith a
  15607                         Write Delegate,  the WriteD elegate CA N BE calle d twice: o nce to com pute
  15608                         the C RC, and th e second t ime to pot entially c ompress an d
  15609                         encry pt. Surpri sing, but  true. This  is becaus e PKWARE s pecified t hat
  15610                         the e ncryption  initializa tion data  depends on  the CRC.
  15611                         If th is happens , for each  call of t he delegat e, your
  15612                         appli cation mus t stream t he same en try data i n its enti rety. If y our
  15613                         appli cation wri tes differ ent data d uring the  second cal l, it will
  15614                         resul t in a cor rupt zip f ile.
  15615                       
  15616        </para>
  15617                     
  15618                      
  15619        <para>
  15620                         The d ouble-read  behavior  happens wi th all typ es of entr ies, not o nly
  15621                         those  that use  WriteDeleg ate. It ha ppens if y ou add an  entry from  a
  15622                         files ystem file , or using  a string,  or a stre am, or an  opener/clo ser
  15623                         pair.  But in th ose cases,  DotNetZip  takes car e of readi ng twice;  in
  15624                         the c ase of the  WriteDele gate, the  applicatio n code get s invoked
  15625                         twice . Be aware .
  15626                       
  15627        </para>
  15628                     
  15629                      
  15630        <para>
  15631                         As yo u can imag ine, this  can cause  performanc e problems  for large
  15632                         strea ms, and it  can lead  to correct ness probl ems when y ou use a
  15633                         
  15634         <c>
  15635          WriteDeleg ate
  15636         </c>
  15637         . This is  a pretty b ig pitfall .  There a re two
  15638                         ways  to avoid i t.  First,  and most  preferred:  don't use  PKZIP
  15639                         encry ption.  If  you use t he WinZip  AES encryp tion, this  problem
  15640                         doesn 't occur,  because th e encrypti on protoco l doesn't  require th e CRC
  15641                         up fr ont. Secon d: if you  do choose  to use PKZ IP encrypt ion, write  out
  15642                         to a  non-seekab le stream  (like stan dard outpu t, or the
  15643                         Respo nse.Output Stream in  an ASP.NET  applicati on).  In t his case,
  15644                         DotNe tZip will  use an alt ernative e ncryption  protocol t hat does n ot
  15645                         rely  on the CRC  of the co ntent.  Th is also im plies sett ing bit 3  in
  15646                         the z ip entry,  which stil l presents  problems  for some z ip tools.
  15647                       
  15648        </para>
  15649                     
  15650                      
  15651        <para>
  15652                         In th e future I  may modif y DotNetZi p to *alwa ys* use bi t 3 when P KZIP
  15653                         encry ption is i n use.  Th is seems l ike a win  overall, b ut there w ill
  15654                         be so me work in volved.  I f you feel  strongly  about it,  visit the
  15655                         DotNe tZip forum s and vote  up 
  15656         <see 
  15657          href="http ://dotnetz ip.codeple x.com/work item/13686 "
  15658         >
  15659          the Workit em
  15660                          track ing this i ssue
  15661         </see>
  15662         .
  15663                       
  15664        </para>
  15665                     
  15666                      
  15667       </remarks>
  15668                    
  15669                     
  15670       <param 
  15671        name="entr yName"
  15672       >
  15673        the name o f the entr y to add
  15674       </param>
  15675                     
  15676       <param 
  15677        name="writ er"
  15678       >
  15679        the delega te which w ill write  the entry  content
  15680       </param>
  15681                     
  15682       <returns>
  15683        the ZipEnt ry added
  15684       </returns>
  15685                    
  15686                     
  15687       <example>
  15688                     
  15689                        This  example sh ows an app lication f illing a D ataSet, th en saving  the
  15690                        conte nts of tha t DataSet  as XML, in to a ZipEn try in a Z ipFile, us ing an
  15691                        anony mous deleg ate in C#.  The DataS et XML is  never save d to a dis k file.
  15692                     
  15693                      
  15694        <code 
  15695         lang="C#"
  15696        >
  15697                       var c1=  new Syste m.Data.Sql Client.Sql Connection (connstrin g1);
  15698                       var da  = new Syst em.Data.Sq lClient.Sq lDataAdapt er()
  15699                           {
  15700                                SelectCom mand=  new  System.Da ta.SqlClie nt.SqlComm and(strSel ect, c1)
  15701                           };
  15702                      
  15703                       DataSet  ds1 = new  DataSet() ;
  15704                       da.Fill (ds1, "Inv oices");
  15705                      
  15706                       using(I onic.Zip.Z ipFile zip  = new Ion ic.Zip.Zip File())
  15707                       {
  15708                           zip .AddEntry( zipEntryNa me, (name, stream) =& gt; ds1.Wr iteXml(str eam) );
  15709                           zip .Save(zipF ileName);
  15710                       }
  15711                       
  15712        </code>
  15713                      
  15714       </example>
  15715                    
  15716                     
  15717       <example>
  15718                     
  15719                      This ex ample uses  an anonym ous method  in C# as  the WriteD elegate to  provide
  15720                      the dat a for the  ZipEntry.  The exampl e is a bit  contrived  - the
  15721                      
  15722        <c>
  15723         AddFile()
  15724        </c>
  15725         method is  a simpler  way to in sert the c ontents of  a file
  15726                      into an  entry in  a zip file . On the o ther hand,  if there  is some so rt of
  15727                      process ing or tra nsformatio n of the f ile conten ts require d before w riting,
  15728                      the app lication c ould use t he 
  15729        <c>
  15730         WriteDeleg ate
  15731        </c>
  15732         to do it,  in this w ay.
  15733                     
  15734                      
  15735        <code 
  15736         lang="C#"
  15737        >
  15738                       using ( var input  = File.Ope n(filename , FileMode .Open, Fil eAccess.Re ad, FileSh are.ReadWr ite ))
  15739                       {
  15740                           usi ng(Ionic.Z ip.ZipFile  zip = new  Ionic.Zip .ZipFile() )
  15741                           {
  15742                                zip.AddEn try(zipEnt ryName, (n ame,output ) =&gt;
  15743                                    {
  15744                                        b yte[] buff er = new b yte[Buffer Size];
  15745                                        i nt n;
  15746                                        w hile ((n =  input.Rea d(buffer,  0, buffer. Length)) ! = 0)
  15747                                        {
  15748                                             // coul d transfor m the data  here...
  15749                                             output. Write(buff er, 0, n);
  15750                                             // coul d update a  progress  bar here
  15751                                        }
  15752                                    });
  15753                      
  15754                                zip.Save( zipFileNam e);
  15755                           }
  15756                       }
  15757                       
  15758        </code>
  15759                      
  15760       </example>
  15761                    
  15762                     
  15763       <example>
  15764                     
  15765                      This ex ample uses  a named d elegate in  VB to wri te data fo r the give n
  15766                      ZipEntr y (VB9 doe s not have  anonymous  delegates ). The exa mple here  is a bit
  15767                      contriv ed - a sim pler way t o add the  contents o f a file t o a ZipEnt ry is to
  15768                      simply  use the ap propriate 
  15769        <c>
  15770         AddFile()
  15771        </c>
  15772         method.   The key sc enario for
  15773                      which t he 
  15774        <c>
  15775         WriteDeleg ate
  15776        </c>
  15777         makes sen se is savi ng a DataS et, in XML
  15778                      format,  to the zi p file. Th e DataSet  can write  XML to a s tream, and  the
  15779                      WriteDe legate is  the perfec t place to  write int o the zip  file.  The re may be
  15780                      other d ata struct ures that  can write  to a strea m, but can not be rea d as a
  15781                      stream.   The 
  15782        <c>
  15783         WriteDeleg ate
  15784        </c>
  15785         would be  appropriat e for thos e cases as
  15786                      well.
  15787                     
  15788                      
  15789        <code 
  15790         lang="VB"
  15791        >
  15792                       Private  Sub Write Entry (ByV al name As  String, B yVal outpu t As Strea m)
  15793                           Usi ng input A s FileStre am = File. Open(filen ame, FileM ode.Open,  FileAccess .Read, Fil eShare.Rea dWrite)
  15794                                Dim n As  Integer =  -1
  15795                                Dim buffe r As Byte( ) = New By te(BufferS ize){}
  15796                                Do While  n &lt;&gt;  0
  15797                                    n = i nput.Read( buffer, 0,  buffer.Le ngth)
  15798                                    outpu t.Write(bu ffer, 0, n )
  15799                                Loop
  15800                           End  Using
  15801                       End Sub
  15802                      
  15803                       Public  Sub Run()
  15804                           Usi ng zip = N ew ZipFile
  15805                                zip.AddEn try(zipEnt ryName, Ne w WriteDel egate(Addr essOf Writ eEntry))
  15806                                zip.Save( zipFileNam e)
  15807                           End  Using
  15808                       End Sub
  15809                       
  15810        </code>
  15811                      
  15812       </example>
  15813               
  15814      </member>
  15815              
  15816      <member 
  15817       name="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,I onic.Zip.O penDelegat e,Ionic.Zi p.CloseDel egate)"
  15818      >
  15819                     
  15820       <summary>
  15821                        Add a n entry, f or which t he applica tion will  provide a  stream
  15822                        conta ining the  entry data , on a jus t-in-time  basis.
  15823                      
  15824       </summary>
  15825                    
  15826                     
  15827       <remarks>
  15828                      
  15829        <para>
  15830                         In ca ses where  the applic ation wish es to open  the strea m that
  15831                         holds  the conte nt for the  ZipEntry,  on a just -in-time b asis, the
  15832                         appli cation can  use this  method.  T he applica tion provi des an
  15833                         opene r delegate  that will  be called  by the Do tNetZip li brary to
  15834                         obtai n a readab le stream  that can b e read to  get the by tes for
  15835                         the g iven entry .  Typical ly, this d elegate op ens a stre am.
  15836                         Optio nally, the  applicati on can pro vide a clo ser delega te as
  15837                         well,  which wil l be calle d by DotNe tZip when  all bytes  have been
  15838                         read  from the e ntry.
  15839                       
  15840        </para>
  15841                     
  15842                      
  15843        <para>
  15844                         These  delegates  are calle d from wit hin the sc ope of the  call to
  15845                         ZipFi le.Save().
  15846                       
  15847        </para>
  15848                     
  15849                      
  15850        <para>
  15851                         For 
  15852         <c>
  15853          ZipFile
  15854         </c>
  15855          propertie s includin
  15856         <see 
  15857          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  15858         />
  15859        
  15860         <see 
  15861          cref="P:Io nic.Zip.Zi pFile.Pass word"
  15862         />
  15863        
  15864         <see 
  15865          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  15866         />
  15867        
  15868         <see 
  15869          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  15870         />
  15871        
  15872         <see 
  15873          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  15874         />
  15875         ,
  15876                         
  15877         <see 
  15878          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  15879         />
  15880         , and 
  15881         <see 
  15882          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  15883         />
  15884         , their
  15885                         respe ctive valu es at the  time of th is call wi ll be appl ied to the
  15886                         
  15887         <c>
  15888          ZipEntry
  15889         </c>
  15890          added.
  15891                       
  15892        </para>
  15893                     
  15894                      
  15895       </remarks>
  15896                    
  15897                     
  15898       <example>
  15899                     
  15900                        This  example us es anonymo us methods  in C# to  open and c lose the
  15901                        sourc e stream f or the con tent for a  zip entry .
  15902                     
  15903                      
  15904        <code 
  15905         lang="C#"
  15906        >
  15907                       using(I onic.Zip.Z ipFile zip  = new Ion ic.Zip.Zip File())
  15908                       {
  15909                           zip .AddEntry( zipEntryNa me,
  15910                                          (name) =&g t;  File.O pen(filena me, FileMo de.Open, F ileAccess. Read, File Share.Read Write ),
  15911                                          (name, str eam) =&gt;   stream.C lose()
  15912                                          );
  15913                      
  15914                           zip .Save(zipF ileName);
  15915                       }
  15916                       
  15917        </code>
  15918                     
  15919                      
  15920       </example>
  15921                    
  15922                     
  15923       <example>
  15924                     
  15925                        This  example us es delegat es in VB.N ET to open  and close  the
  15926                        the s ource stre am for the  content f or a zip e ntry.  VB  9.0 lacks
  15927                        suppo rt for "Su b" lambda  expression s, and so  the CloseD elegate mu st
  15928                        be an  actual, n amed Sub.
  15929                     
  15930                      
  15931        <code 
  15932         lang="VB"
  15933        >
  15934                      
  15935                       Functio n MyStream Opener(ByV al entryNa me As Stri ng) As Str eam
  15936                           ''  This simpl y opens a  file.  You  probably  want to do  somethini g
  15937                           ''  more invol ved here:  open a str eam to rea d from a d atabase,
  15938                           ''  open a str eam on an  HTTP conne ction, and  so on.
  15939                           Ret urn File.O penRead(en tryName)
  15940                       End Fun ction
  15941                      
  15942                       Sub MyS treamClose r(entryNam e As Strin g, stream  As Stream)
  15943                           str eam.Close( )
  15944                       End Sub
  15945                      
  15946                       Public  Sub Run()
  15947                           Dim  dirToZip  As String  = "fodder"
  15948                           Dim  zipFileTo Create As  String = " Archive.zi p"
  15949                           Dim  opener As  OpenDeleg ate = Addr essOf MySt reamOpener
  15950                           Dim  closer As  CloseDele gate = Add ressOf MyS treamClose r
  15951                           Dim  numFilest oAdd As In t32 = 4
  15952                           Usi ng zip As  ZipFile =  New ZipFil e
  15953                                Dim i As  Integer
  15954                                For i = 0  To numFil esToAdd -  1
  15955                                    zip.A ddEntry(St ring.Forma t("content -{0:000}.t xt"), open er, closer )
  15956                                Next i
  15957                                zip.Save( zipFileToC reate)
  15958                           End  Using
  15959                       End Sub
  15960                      
  15961                       
  15962        </code>
  15963                      
  15964       </example>
  15965                    
  15966                     
  15967       <param 
  15968        name="entr yName"
  15969       >
  15970        the name o f the entr y to add
  15971       </param>
  15972                     
  15973       <param 
  15974        name="open er"
  15975       >
  15976                       the de legate tha t will be  invoked by  ZipFile.S ave() to g et the
  15977                       readab le stream  for the gi ven entry.  ZipFile.S ave() will  call
  15978                       read o n this str eam to obt ain the da ta for the  entry. Th is data
  15979                       will t hen be com pressed an d written  to the new ly created  zip
  15980                       file.
  15981                      
  15982       </param>
  15983                     
  15984       <param 
  15985        name="clos er"
  15986       >
  15987                       the de legate tha t will be  invoked to  close the  stream. T his may
  15988                       be nul l (Nothing  in VB), i n which ca se no call  is makde  to close
  15989                       the st ream.
  15990                      
  15991       </param>
  15992                     
  15993       <returns>
  15994        the ZipEnt ry added
  15995       </returns>
  15996                    
  15997               
  15998      </member>
  15999              
  16000      <member 
  16001       name="M:Io nic.Zip.Zi pFile.Upda teEntry(Sy stem.Strin g,System.S tring)"
  16002      >
  16003                     
  16004       <summary>
  16005                        Updat es the giv en entry i n the 
  16006        <c>
  16007         ZipFile
  16008        </c>
  16009        , using th e given
  16010                        strin g as conte nt for the  
  16011        <c>
  16012         ZipEntry
  16013        </c>
  16014        .
  16015                      
  16016       </summary>
  16017                    
  16018                     
  16019       <remarks>
  16020                     
  16021                      
  16022        <para>
  16023                         Calli ng this me thod is eq uivalent t o removing  the 
  16024         <c>
  16025          ZipEntry
  16026         </c>
  16027          for
  16028                         the g iven file  name and d irectory p ath, if it  exists, a nd then ca lling
  16029                         
  16030         <see 
  16031          cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,S ystem.Stri ng)"
  16032         />
  16033         .  See the  documenta tion for
  16034                         that  method for  further e xplanation . The stri ng content  is encode d
  16035                         using  the defau lt encodin g for the  machine, o r on Silve rlight, us ing
  16036                         UTF-8 . This enc oding is d istinct fr om the enc oding used  for the
  16037                         filen ame itself .  See 
  16038         <see 
  16039          cref="P:Io nic.Zip.Zi pFile.Alte rnateEncod ing"
  16040         />
  16041         .
  16042                       
  16043        </para>
  16044                     
  16045                      
  16046       </remarks>
  16047                    
  16048                     
  16049       <param 
  16050        name="entr yName"
  16051       >
  16052                        The n ame, inclu ding any p ath, to us e within t he archive  for the e ntry.
  16053                      
  16054       </param>
  16055                    
  16056                     
  16057       <param 
  16058        name="cont ent"
  16059       >
  16060                        The c ontent of  the file,  should it  be extract ed from th e zip.
  16061                      
  16062       </param>
  16063                    
  16064                     
  16065       <returns>
  16066        The 
  16067        <c>
  16068         ZipEntry
  16069        </c>
  16070         added.
  16071       </returns>
  16072                    
  16073               
  16074      </member>
  16075              
  16076      <member 
  16077       name="M:Io nic.Zip.Zi pFile.Upda teEntry(Sy stem.Strin g,System.S tring,Syst em.Text.En coding)"
  16078      >
  16079                     
  16080       <summary>
  16081                        Updat es the giv en entry i n the 
  16082        <c>
  16083         ZipFile
  16084        </c>
  16085        , using th e given st ring as
  16086                        conte nt for the  
  16087        <c>
  16088         ZipEntry
  16089        </c>
  16090        .
  16091                      
  16092       </summary>
  16093                    
  16094                     
  16095       <remarks>
  16096                        Calli ng this me thod is eq uivalent t o removing  the 
  16097        <c>
  16098         ZipEntry
  16099        </c>
  16100         for the
  16101                        given  file name  and direc tory path,  if it exi sts, and t hen callin
  16102        <see 
  16103         cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,S ystem.Stri ng,System. Text.Encod ing)"
  16104        />
  16105        .  See the
  16106                        docum entation f or that me thod for f urther exp lanation.
  16107                      
  16108       </remarks>
  16109                    
  16110                     
  16111       <param 
  16112        name="entr yName"
  16113       >
  16114                        The n ame, inclu ding any p ath, to us e within t he archive  for the e ntry.
  16115                      
  16116       </param>
  16117                    
  16118                     
  16119       <param 
  16120        name="cont ent"
  16121       >
  16122                        The c ontent of  the file,  should it  be extract ed from th e zip.
  16123                      
  16124       </param>
  16125                    
  16126                     
  16127       <param 
  16128        name="enco ding"
  16129       >
  16130                        The t ext encodi ng to use  when encod ing the st ring. Be a ware: This  is
  16131                        disti nct from t he text en coding use d to encod e the file name. See 
  16132        <see 
  16133         cref="P:Io nic.Zip.Zi pFile.Alte rnateEncod ing"
  16134        />
  16135        .
  16136                      
  16137       </param>
  16138                    
  16139                     
  16140       <returns>
  16141        The 
  16142        <c>
  16143         ZipEntry
  16144        </c>
  16145         added.
  16146       </returns>
  16147                    
  16148               
  16149      </member>
  16150              
  16151      <member 
  16152       name="M:Io nic.Zip.Zi pFile.Upda teEntry(Sy stem.Strin g,Ionic.Zi p.WriteDel egate)"
  16153      >
  16154                     
  16155       <summary>
  16156                        Updat es the giv en entry i n the 
  16157        <c>
  16158         ZipFile
  16159        </c>
  16160        , using th e given de legate
  16161                        as th e source f or content  for the 
  16162        <c>
  16163         ZipEntry
  16164        </c>
  16165        .
  16166                      
  16167       </summary>
  16168                    
  16169                     
  16170       <remarks>
  16171                        Calli ng this me thod is eq uivalent t o removing  the 
  16172        <c>
  16173         ZipEntry
  16174        </c>
  16175         for the
  16176                        given  file name  and direc tory path,  if it exi sts, and t hen callin
  16177        <see 
  16178         cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,I onic.Zip.W riteDelega te)"
  16179        />
  16180        .  See the
  16181                        docum entation f or that me thod for f urther exp lanation.
  16182                      
  16183       </remarks>
  16184                    
  16185                     
  16186       <param 
  16187        name="entr yName"
  16188       >
  16189                        The n ame, inclu ding any p ath, to us e within t he archive  for the e ntry.
  16190                      
  16191       </param>
  16192                    
  16193                     
  16194       <param 
  16195        name="writ er"
  16196       >
  16197        the delega te which w ill write  the entry  content.
  16198       </param>
  16199                    
  16200                     
  16201       <returns>
  16202        The 
  16203        <c>
  16204         ZipEntry
  16205        </c>
  16206         added.
  16207       </returns>
  16208                    
  16209               
  16210      </member>
  16211              
  16212      <member 
  16213       name="M:Io nic.Zip.Zi pFile.Upda teEntry(Sy stem.Strin g,Ionic.Zi p.OpenDele gate,Ionic .Zip.Close Delegate)"
  16214      >
  16215                     
  16216       <summary>
  16217                        Updat es the giv en entry i n the 
  16218        <c>
  16219         ZipFile
  16220        </c>
  16221        , using th e given de legates
  16222                        to op en and clo se the str eam that p rovides th e content  for the 
  16223        <c>
  16224         ZipEntry
  16225        </c>
  16226        .
  16227                      
  16228       </summary>
  16229                    
  16230                     
  16231       <remarks>
  16232                        Calli ng this me thod is eq uivalent t o removing  the 
  16233        <c>
  16234         ZipEntry
  16235        </c>
  16236         for the
  16237                        given  file name  and direc tory path,  if it exi sts, and t hen callin
  16238        <see 
  16239         cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,I onic.Zip.O penDelegat e,Ionic.Zi p.CloseDel egate)"
  16240        />
  16241        .  See the
  16242                        docum entation f or that me thod for f urther exp lanation.
  16243                      
  16244       </remarks>
  16245                    
  16246                     
  16247       <param 
  16248        name="entr yName"
  16249       >
  16250                        The n ame, inclu ding any p ath, to us e within t he archive  for the e ntry.
  16251                      
  16252       </param>
  16253                    
  16254                     
  16255       <param 
  16256        name="open er"
  16257       >
  16258                       the de legate tha t will be  invoked to  open the  stream
  16259                      
  16260       </param>
  16261                     
  16262       <param 
  16263        name="clos er"
  16264       >
  16265                       the de legate tha t will be  invoked to  close the  stream
  16266                      
  16267       </param>
  16268                    
  16269                     
  16270       <returns>
  16271        The 
  16272        <c>
  16273         ZipEntry
  16274        </c>
  16275         added or  updated.
  16276       </returns>
  16277                    
  16278               
  16279      </member>
  16280              
  16281      <member 
  16282       name="M:Io nic.Zip.Zi pFile.Upda teEntry(Sy stem.Strin g,System.I O.Stream)"
  16283      >
  16284                     
  16285       <summary>
  16286                        Updat es the giv en entry i n the 
  16287        <c>
  16288         ZipFile
  16289        </c>
  16290        , using th e given st ream as
  16291                        input , and the  given file name and g iven direc tory Path.
  16292                      
  16293       </summary>
  16294                    
  16295                     
  16296       <remarks>
  16297                      
  16298        <para>
  16299                         Calli ng the met hod is equ ivalent to  calling 
  16300         <c>
  16301          RemoveEntr y()
  16302         </c>
  16303          if an
  16304                         entry  by the sa me name al ready exis ts, and th en calling  
  16305         <c>
  16306          AddEntry()
  16307         </c>
  16308                         with  the given 
  16309         <c>
  16310          fileName
  16311         </c>
  16312          and strea m.
  16313                       
  16314        </para>
  16315                     
  16316                      
  16317        <para>
  16318                         The s tream must  be open a nd readabl e during t he call to
  16319                         
  16320         <c>
  16321          ZipFile.Sa ve
  16322         </c>
  16323         .  You can  dispense  the stream  on a just -in-time b asis
  16324                         using  the 
  16325         <see 
  16326          cref="P:Io nic.Zip.Zi pEntry.Inp utStream"
  16327         />
  16328          property.  Check the
  16329                         docum entation o f that pro perty for  more infor mation.
  16330                       
  16331        </para>
  16332                     
  16333                      
  16334        <para>
  16335                         For 
  16336         <c>
  16337          ZipFile
  16338         </c>
  16339          propertie s includin
  16340         <see 
  16341          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  16342         />
  16343        
  16344         <see 
  16345          cref="P:Io nic.Zip.Zi pFile.Pass word"
  16346         />
  16347        
  16348         <see 
  16349          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  16350         />
  16351        
  16352         <see 
  16353          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  16354         />
  16355        
  16356         <see 
  16357          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  16358         />
  16359         ,
  16360                         
  16361         <see 
  16362          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  16363         />
  16364         , and 
  16365         <see 
  16366          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  16367         />
  16368         , their
  16369                         respe ctive valu es at the  time of th is call wi ll be appl ied to the
  16370                         
  16371         <c>
  16372          ZipEntry
  16373         </c>
  16374          added.
  16375                       
  16376        </para>
  16377                     
  16378                      
  16379       </remarks>
  16380                    
  16381                     
  16382       <seealso 
  16383        cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,S ystem.IO.S tream)"
  16384       />
  16385                     
  16386       <seealso 
  16387        cref="P:Io nic.Zip.Zi pEntry.Inp utStream"
  16388       />
  16389                    
  16390                     
  16391       <param 
  16392        name="entr yName"
  16393       >
  16394                        The n ame, inclu ding any p ath, to us e within t he archive  for the e ntry.
  16395                      
  16396       </param>
  16397                    
  16398                     
  16399       <param 
  16400        name="stre am"
  16401       >
  16402        The input  stream fro m which to  read file  data.
  16403       </param>
  16404                     
  16405       <returns>
  16406        The 
  16407        <c>
  16408         ZipEntry
  16409        </c>
  16410         added.
  16411       </returns>
  16412               
  16413      </member>
  16414              
  16415      <member 
  16416       name="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,S ystem.Byte [])"
  16417      >
  16418                     
  16419       <summary>
  16420                        Add a n entry in to the zip  archive u sing the g iven filen ame and
  16421                        direc tory path  within the  archive,  and the gi ven conten t for the
  16422                        file.  No file i s created  in the fil esystem.
  16423                      
  16424       </summary>
  16425                    
  16426                     
  16427       <param 
  16428        name="byte Content"
  16429       >
  16430        The data t o use for  the entry.
  16431       </param>
  16432                    
  16433                     
  16434       <param 
  16435        name="entr yName"
  16436       >
  16437                        The n ame, inclu ding any p ath, to us e within t he archive  for the e ntry.
  16438                      
  16439       </param>
  16440                    
  16441                     
  16442       <returns>
  16443        The 
  16444        <c>
  16445         ZipEntry
  16446        </c>
  16447         added.
  16448       </returns>
  16449               
  16450      </member>
  16451              
  16452      <member 
  16453       name="M:Io nic.Zip.Zi pFile.Upda teEntry(Sy stem.Strin g,System.B yte[])"
  16454      >
  16455                     
  16456       <summary>
  16457                        Updat es the giv en entry i n the 
  16458        <c>
  16459         ZipFile
  16460        </c>
  16461        , using th e given by te
  16462                        array  as conten t for the  entry.
  16463                      
  16464       </summary>
  16465                    
  16466                     
  16467       <remarks>
  16468                        Calli ng this me thod is eq uivalent t o removing  the 
  16469        <c>
  16470         ZipEntry
  16471        </c>
  16472                        for t he given f ilename an d director y path, if  it exists , and then
  16473                        calli ng 
  16474        <see 
  16475         cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,S ystem.Byte [])"
  16476        />
  16477        .  See the
  16478                        docum entation f or that me thod for f urther exp lanation.
  16479                      
  16480       </remarks>
  16481                    
  16482                     
  16483       <param 
  16484        name="entr yName"
  16485       >
  16486                        The n ame, inclu ding any p ath, to us e within t he archive  for the e ntry.
  16487                      
  16488       </param>
  16489                    
  16490                     
  16491       <param 
  16492        name="byte Content"
  16493       >
  16494        The conten t to use f or the 
  16495        <c>
  16496         ZipEntry
  16497        </c>
  16498        .
  16499       </param>
  16500                    
  16501                     
  16502       <returns>
  16503        The 
  16504        <c>
  16505         ZipEntry
  16506        </c>
  16507         added.
  16508       </returns>
  16509                    
  16510               
  16511      </member>
  16512              
  16513      <member 
  16514       name="M:Io nic.Zip.Zi pFile.AddD irectory(S ystem.Stri ng)"
  16515      >
  16516                     
  16517       <summary>
  16518                        Adds  the conten ts of a fi lesystem d irectory t o a Zip fi le archive .
  16519                      
  16520       </summary>
  16521                    
  16522                     
  16523       <remarks>
  16524                     
  16525                      
  16526        <para>
  16527                         The n ame of the  directory  may be a  relative p ath or a f ully-quali fied
  16528                         path.  Any files  within th e named di rectory ar e added to  the archi ve.  Any
  16529                         subdi rectories  within the  named dir ectory are  also adde d to the a rchive,
  16530                         recur sively.
  16531                       
  16532        </para>
  16533                     
  16534                      
  16535        <para>
  16536                         Top-l evel entri es in the  named dire ctory will  appear as  top-level  entries
  16537                         in th e zip arch ive.  Entr ies in sub directorie s in the n amed direc tory will
  16538                         resul t in entri es in subd irectories  in the zi p archive.
  16539                       
  16540        </para>
  16541                     
  16542                      
  16543        <para>
  16544                         If yo u want the  entries t o appear i n a contai ning direc tory in th e zip
  16545                         archi ve itself,  then you  should cal l the AddD irectory()  overload  that
  16546                         allow s you to e xplicitly  specify a  directory  path for u se in the  archive.
  16547                       
  16548        </para>
  16549                     
  16550                      
  16551        <para>
  16552                         For 
  16553         <c>
  16554          ZipFile
  16555         </c>
  16556          propertie s includin
  16557         <see 
  16558          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  16559         />
  16560        
  16561         <see 
  16562          cref="P:Io nic.Zip.Zi pFile.Pass word"
  16563         />
  16564        
  16565         <see 
  16566          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  16567         />
  16568        
  16569         <see 
  16570          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  16571         />
  16572        
  16573         <see 
  16574          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  16575         />
  16576         ,
  16577                         
  16578         <see 
  16579          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  16580         />
  16581         , and 
  16582         <see 
  16583          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  16584         />
  16585         , their
  16586                         respe ctive valu es at the  time of th is call wi ll be appl ied to eac h
  16587                         ZipEn try added.
  16588                       
  16589        </para>
  16590                     
  16591                      
  16592       </remarks>
  16593                    
  16594                     
  16595       <seealso 
  16596        cref="M:Io nic.Zip.Zi pFile.AddI tem(System .String)"
  16597       />
  16598                     
  16599       <seealso 
  16600        cref="M:Io nic.Zip.Zi pFile.AddF ile(System .String)"
  16601       />
  16602                     
  16603       <seealso 
  16604        cref="M:Io nic.Zip.Zi pFile.Upda teDirector y(System.S tring)"
  16605       />
  16606                     
  16607       <seealso 
  16608        cref="M:Io nic.Zip.Zi pFile.AddD irectory(S ystem.Stri ng,System. String)"
  16609       />
  16610                    
  16611                     
  16612       <overloads >
  16613        This metho d has 2 ov erloads.
  16614       </overload s>
  16615                    
  16616                     
  16617       <param 
  16618        name="dire ctoryName"
  16619       >
  16620        The name o f the dire ctory to a dd.
  16621       </param>
  16622                     
  16623       <returns>
  16624        The 
  16625        <c>
  16626         ZipEntry
  16627        </c>
  16628         added.
  16629       </returns>
  16630               
  16631      </member>
  16632              
  16633      <member 
  16634       name="M:Io nic.Zip.Zi pFile.AddD irectory(S ystem.Stri ng,System. String)"
  16635      >
  16636                     
  16637       <summary>
  16638                        Adds  the conten ts of a fi lesystem d irectory t o a Zip fi le archive ,
  16639                        overr iding the  path to be  used for  entries in  the archi ve.
  16640                      
  16641       </summary>
  16642                    
  16643                     
  16644       <remarks>
  16645                      
  16646        <para>
  16647                         The n ame of the  directory  may be a  relative p ath or a f ully-quali fied
  16648                         path.  The add o peration i s recursiv e, so that  any files  or subdir ectories
  16649                         withi n the name  directory  are also  added to t he archive .
  16650                       
  16651        </para>
  16652                     
  16653                      
  16654        <para>
  16655                         Top-l evel entri es in the  named dire ctory will  appear as  top-level  entries
  16656                         in th e zip arch ive.  Entr ies in sub directorie s in the n amed direc tory will
  16657                         resul t in entri es in subd irectories  in the zi p archive.
  16658                       
  16659        </para>
  16660                     
  16661                      
  16662        <para>
  16663                         For 
  16664         <c>
  16665          ZipFile
  16666         </c>
  16667          propertie s includin
  16668         <see 
  16669          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  16670         />
  16671        
  16672         <see 
  16673          cref="P:Io nic.Zip.Zi pFile.Pass word"
  16674         />
  16675        
  16676         <see 
  16677          cref="P:Io nic.Zip.Zi pFile.SetC ompression "
  16678         />
  16679        
  16680         <see 
  16681          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  16682         />
  16683        
  16684         <see 
  16685          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  16686         />
  16687         ,
  16688                         
  16689         <see 
  16690          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  16691         />
  16692         , and 
  16693         <see 
  16694          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  16695         />
  16696         , their
  16697                         respe ctive valu es at the  time of th is call wi ll be appl ied to eac h
  16698                         ZipEn try added.
  16699                       
  16700        </para>
  16701                     
  16702                      
  16703       </remarks>
  16704                    
  16705                     
  16706       <example>
  16707                      
  16708        <para>
  16709                         In th is code, c alling the  ZipUp() m ethod with  a value o f "c:\repo rts" for
  16710                         the d irectory p arameter w ill result  in a zip  file struc ture in wh ich all
  16711                         entri es are con tained in  a toplevel  "reports"  directory .
  16712                       
  16713        </para>
  16714                     
  16715                      
  16716        <code 
  16717         lang="C#"
  16718        >
  16719                       public  void ZipUp (string ta rgetZip, s tring dire ctory)
  16720                       {
  16721                         using  (var zip  = new ZipF ile())
  16722                         {
  16723                           zip .AddDirect ory(direct ory, Syste m.IO.Path. GetFileNam e(director y));
  16724                           zip .Save(targ etZip);
  16725                         }
  16726                       }
  16727                       
  16728        </code>
  16729                      
  16730       </example>
  16731                    
  16732                     
  16733       <seealso 
  16734        cref="M:Io nic.Zip.Zi pFile.AddI tem(System .String,Sy stem.Strin g)"
  16735       />
  16736                     
  16737       <seealso 
  16738        cref="M:Io nic.Zip.Zi pFile.AddF ile(System .String,Sy stem.Strin g)"
  16739       />
  16740                     
  16741       <seealso 
  16742        cref="M:Io nic.Zip.Zi pFile.Upda teDirector y(System.S tring,Syst em.String) "
  16743       />
  16744                    
  16745                     
  16746       <param 
  16747        name="dire ctoryName"
  16748       >
  16749        The name o f the dire ctory to a dd.
  16750       </param>
  16751                    
  16752                     
  16753       <param 
  16754        name="dire ctoryPathI nArchive"
  16755       >
  16756                        Speci fies a dir ectory pat h to use t o override  any path  in the
  16757                        Direc toryName.   This path  may, or m ay not, co rrespond t o a real d irectory
  16758                        in th e current  filesystem .  If the  zip is lat er extract ed, this i s the
  16759                        path  used for t he extract ed file or  directory .  Passing  
  16760        <c>
  16761         null
  16762        </c>
  16763                        (
  16764        <c>
  16765         Nothing
  16766        </c>
  16767         in VB) or  the empty  string (" ") will in sert the i tems at
  16768                        the r oot path w ithin the  archive.
  16769                      
  16770       </param>
  16771                    
  16772                     
  16773       <returns>
  16774        The 
  16775        <c>
  16776         ZipEntry
  16777        </c>
  16778         added.
  16779       </returns>
  16780               
  16781      </member>
  16782              
  16783      <member 
  16784       name="M:Io nic.Zip.Zi pFile.AddD irectoryBy Name(Syste m.String)"
  16785      >
  16786                     
  16787       <summary>
  16788                        Creat es a direc tory in th e zip arch ive.
  16789                      
  16790       </summary>
  16791                    
  16792                     
  16793       <remarks>
  16794                     
  16795                      
  16796        <para>
  16797                         Use t his when y ou want to  create a  directory  in the arc hive but t here is
  16798                         no co rrespondin g filesyst em represe ntation fo r that dir ectory.
  16799                       
  16800        </para>
  16801                     
  16802                      
  16803        <para>
  16804                         You w ill probab ly not nee d to do th is in your  code. One  of the on ly times
  16805                         you w ill want t o do this  is if you  want an em pty direct ory in the  zip
  16806                         archi ve.  The r eason: if  you add a  file to a  zip archiv e that is  stored
  16807                         withi n a multi- level dire ctory, all  of the di rectory tr ee is impl icitly
  16808                         creat ed in the  zip archiv e.
  16809                       
  16810        </para>
  16811                     
  16812                      
  16813       </remarks>
  16814                    
  16815                     
  16816       <param 
  16817        name="dire ctoryNameI nArchive"
  16818       >
  16819                        The n ame of the  directory  to create  in the ar chive.
  16820                      
  16821       </param>
  16822                     
  16823       <returns>
  16824        The 
  16825        <c>
  16826         ZipEntry
  16827        </c>
  16828         added.
  16829       </returns>
  16830               
  16831      </member>
  16832              
  16833      <member 
  16834       name="M:Io nic.Zip.Zi pFile.Chec kZip(Syste m.String)"
  16835      >
  16836                     
  16837       <summary>
  16838                        Check s a zip fi le to see  if its dir ectory is  consistent .
  16839                      
  16840       </summary>
  16841                    
  16842                     
  16843       <remarks>
  16844                     
  16845                      
  16846        <para>
  16847                         In ca ses of dat a error, t he directo ry within  a zip file  can get o ut
  16848                         of sy nch with t he entries  in the zi p file.  T his method  checks th e
  16849                         given  zip file  and return s true if  this has o ccurred.
  16850                       
  16851        </para>
  16852                     
  16853                      
  16854        <para>
  16855          This meth od may tak e a long t ime to run  for large  zip files .  
  16856        </para>
  16857                     
  16858                      
  16859        <para>
  16860                         This  method is  not suppor ted in the  Reduced o r Compact  Framework
  16861                         versi ons of Dot NetZip.
  16862                       
  16863        </para>
  16864                     
  16865                      
  16866        <para>
  16867                         Devel opers usin g COM can  use the 
  16868         <see 
  16869          cref="M:Io nic.Zip.Co mHelper.Ch eckZip(Sys tem.String )"
  16870         >
  16871          ComHelper. CheckZip(S tring)
  16872         </see>
  16873                         metho d.
  16874                       
  16875        </para>
  16876                     
  16877                      
  16878       </remarks>
  16879                    
  16880                     
  16881       <param 
  16882        name="zipF ileName"
  16883       >
  16884        The filena me to of t he zip fil e to check .
  16885       </param>
  16886                    
  16887                     
  16888       <returns>
  16889        true if th e named zi p file che cks OK. Ot herwise, f alse. 
  16890       </returns>
  16891                    
  16892                     
  16893       <seealso 
  16894        cref="M:Io nic.Zip.Zi pFile.FixZ ipDirector y(System.S tring)"
  16895       />
  16896                     
  16897       <seealso 
  16898        cref="M:Io nic.Zip.Zi pFile.Chec kZip(Syste m.String,S ystem.Bool ean,System .IO.TextWr iter)"
  16899       />
  16900               
  16901      </member>
  16902              
  16903      <member 
  16904       name="M:Io nic.Zip.Zi pFile.Chec kZip(Syste m.String,S ystem.Bool ean,System .IO.TextWr iter)"
  16905      >
  16906                     
  16907       <summary>
  16908                        Check s a zip fi le to see  if its dir ectory is  consistent ,
  16909                        and o ptionally  fixes the  directory  if necessa ry.
  16910                      
  16911       </summary>
  16912                    
  16913                     
  16914       <remarks>
  16915                     
  16916                      
  16917        <para>
  16918                         In ca ses of dat a error, t he directo ry within  a zip file  can get o ut of
  16919                         synch  with the  entries in  the zip f ile.  This  method ch ecks the g iven
  16920                         zip f ile, and r eturns tru e if this  has occurr ed. It als o optional ly
  16921                         fixes  the zipfi le, saving  the fixed  copy in 
  16922         <em>
  16923          Name
  16924         </em>
  16925         _Fixed.zip .
  16926                       
  16927        </para>
  16928                     
  16929                      
  16930        <para>
  16931                         This  method may  take a lo ng time to  run for l arge zip f iles.  It
  16932                         will  take even  longer if  the file a ctually ne eds to be  fixed, and  if
  16933                         
  16934         <c>
  16935          fixIfNeces sary
  16936         </c>
  16937          is true.
  16938                       
  16939        </para>
  16940                     
  16941                      
  16942        <para>
  16943                         This  method is  not suppor ted in the  Reduced o r Compact
  16944                         Frame work versi ons of Dot NetZip.
  16945                       
  16946        </para>
  16947                     
  16948                      
  16949       </remarks>
  16950                    
  16951                     
  16952       <param 
  16953        name="zipF ileName"
  16954       >
  16955        The filena me to of t he zip fil e to check .
  16956       </param>
  16957                    
  16958                     
  16959       <param 
  16960        name="fixI fNecessary "
  16961       >
  16962        If true, t he method  will fix t he zip fil e if
  16963                          nec essary.
  16964       </param>
  16965                    
  16966                     
  16967       <param 
  16968        name="writ er"
  16969       >
  16970                      a TextW riter in w hich messa ges genera ted while  checking w ill be wri tten.
  16971                      
  16972       </param>
  16973                    
  16974                     
  16975       <returns>
  16976        true if th e named zi p is OK; f alse if th e file nee ds to be f ixed.
  16977       </returns>
  16978                    
  16979                     
  16980       <seealso 
  16981        cref="M:Io nic.Zip.Zi pFile.Chec kZip(Syste m.String)"
  16982       />
  16983                     
  16984       <seealso 
  16985        cref="M:Io nic.Zip.Zi pFile.FixZ ipDirector y(System.S tring)"
  16986       />
  16987               
  16988      </member>
  16989              
  16990      <member 
  16991       name="M:Io nic.Zip.Zi pFile.FixZ ipDirector y(System.S tring)"
  16992      >
  16993                     
  16994       <summary>
  16995                        Rewri te the dir ectory wit hin a zipf ile.
  16996                      
  16997       </summary>
  16998                    
  16999                     
  17000       <remarks>
  17001                     
  17002                      
  17003        <para>
  17004                         In ca ses of dat a error, t he directo ry in a zi p file can  get out o f
  17005                         synch  with the  entries in  the zip f ile.  This  method at tempts to  fix
  17006                         the z ip file if  this has  occurred.
  17007                       
  17008        </para>
  17009                     
  17010                      
  17011        <para>
  17012          This can  take a lon g time for  large zip  files. 
  17013        </para>
  17014                     
  17015                      
  17016        <para>
  17017          This won' t work if  the zip fi le uses a  non-standa rd
  17018                       code pa ge - neith er IBM437  nor UTF-8.  
  17019        </para>
  17020                     
  17021                      
  17022        <para>
  17023                         This  method is  not suppor ted in the  Reduced o r Compact  Framework
  17024                         versi ons of Dot NetZip.
  17025                       
  17026        </para>
  17027                     
  17028                      
  17029        <para>
  17030                         Devel opers usin g COM can  use the 
  17031         <see 
  17032          cref="M:Io nic.Zip.Co mHelper.Fi xZipDirect ory(System .String)"
  17033         >
  17034          ComHelper. FixZipDire ctory(Stri ng)
  17035         </see>
  17036                         metho d.
  17037                       
  17038        </para>
  17039                     
  17040                      
  17041       </remarks>
  17042                    
  17043                     
  17044       <param 
  17045        name="zipF ileName"
  17046       >
  17047        The filena me to of t he zip fil e to fix.
  17048       </param>
  17049                    
  17050                     
  17051       <seealso 
  17052        cref="M:Io nic.Zip.Zi pFile.Chec kZip(Syste m.String)"
  17053       />
  17054                     
  17055       <seealso 
  17056        cref="M:Io nic.Zip.Zi pFile.Chec kZip(Syste m.String,S ystem.Bool ean,System .IO.TextWr iter)"
  17057       />
  17058               
  17059      </member>
  17060              
  17061      <member 
  17062       name="M:Io nic.Zip.Zi pFile.Chec kZipPasswo rd(System. String,Sys tem.String )"
  17063      >
  17064                     
  17065       <summary>
  17066                        Verif y the pass word on a  zip file.
  17067                      
  17068       </summary>
  17069                    
  17070                     
  17071       <remarks>
  17072                        
  17073        <para>
  17074                           Kee p in mind  that passw ords in zi pfiles are  applied t o
  17075                           zip  entries,  not to the  entire zi p file. So  testing a
  17076                           zip file for a  particula r password  doesn't w ork in the
  17077                           gen eral case.  On the ot her hand,  it's often  the case
  17078                           tha t a single  password  will be us ed on all  entries in  a
  17079                           zip  file. Thi s method w orks for t hat case.
  17080                         
  17081        </para>
  17082                        
  17083        <para>
  17084                           The re is no w ay to chec k a passwo rd without  doing the
  17085                           dec ryption. S o this cod e decrypts  and extra cts the gi ven
  17086                           zip file into 
  17087         <see 
  17088          cref="F:Sy stem.IO.St ream.Null"
  17089         />
  17090                         
  17091        </para>
  17092                      
  17093       </remarks>
  17094                    
  17095                     
  17096       <param 
  17097        name="zipF ileName"
  17098       >
  17099        The filena me to of t he zip fil e to fix.
  17100       </param>
  17101                    
  17102                     
  17103       <param 
  17104        name="pass word"
  17105       >
  17106        The passwo rd to chec k.
  17107       </param>
  17108                    
  17109                     
  17110       <returns>
  17111        a bool ind icating wh ether the  password m atches.
  17112       </returns>
  17113               
  17114      </member>
  17115              
  17116      <member 
  17117       name="M:Io nic.Zip.Zi pFile.Cont ainsEntry( System.Str ing)"
  17118      >
  17119                     
  17120       <summary>
  17121                        Retur ns true if  an entry  by the giv en name ex ists in th e ZipFile.
  17122                      
  17123       </summary>
  17124                    
  17125                     
  17126       <param 
  17127        name='name '
  17128       >
  17129        the name o f the entr y to find
  17130       </param>
  17131                     
  17132       <returns>
  17133        true if an  entry wit h the give n name exi sts; other wise false .
  17134                      
  17135       </returns>
  17136               
  17137      </member>
  17138              
  17139      <member 
  17140       name="M:Io nic.Zip.Zi pFile.ToSt ring"
  17141      >
  17142                    
  17143       <summary>
  17144        Provides a  string re presentati on of the  instance.
  17145       </summary>
  17146                    
  17147       <returns>
  17148        a string r epresentat ion of the  instance.
  17149       </returns>
  17150               
  17151      </member>
  17152              
  17153      <member 
  17154       name="M:Io nic.Zip.Zi pFile.#cto r(System.S tring)"
  17155      >
  17156                     
  17157       <summary>
  17158                        Creat es a new 
  17159        <c>
  17160         ZipFile
  17161        </c>
  17162         instance,  using the  specified  filename.
  17163                      
  17164       </summary>
  17165                    
  17166                     
  17167       <remarks>
  17168                      
  17169        <para>
  17170                         Appli cations ca n use this  construct or to crea te a new Z ipFile for  writing,
  17171                         or to  slurp in  an existin g zip arch ive for re ad and upd ate purpos es.
  17172                       
  17173        </para>
  17174                     
  17175                      
  17176        <para>
  17177                         To cr eate a new  zip archi ve, an app lication c an call th is constru ctor,
  17178                         passi ng the nam e of a fil e that doe s not exis t.  The na me may be  a fully
  17179                         quali fied path.  Then the  applicatio n can add  directorie s or files  to the
  17180                         
  17181         <c>
  17182          ZipFile
  17183         </c>
  17184          via 
  17185         <c>
  17186          AddDirecto ry()
  17187         </c>
  17188        
  17189         <c>
  17190          AddFile()
  17191         </c>
  17192        
  17193         <c>
  17194          AddItem()
  17195         </c>
  17196                         and t hen write  the zip ar chive to t he disk by  calling 
  17197         <c>
  17198          Save()
  17199         </c>
  17200         . The
  17201                         zip f ile is not  actually  opened and  written t o the disk  until the
  17202                         appli cation cal ls 
  17203         <c>
  17204          ZipFile.Sa ve()
  17205         </c>
  17206         .  At that  point the  new zip f ile
  17207                         with  the given  name is cr eated.
  17208                       
  17209        </para>
  17210                     
  17211                      
  17212        <para>
  17213                         If yo u won't kn ow the nam e of the 
  17214         <c>
  17215          Zipfile
  17216         </c>
  17217          until the  time you  call
  17218                         
  17219         <c>
  17220          ZipFile.Sa ve()
  17221         </c>
  17222         , or if yo u plan to  save to a  stream (wh ich has no
  17223                         name) , then you  should us e the no-a rgument co nstructor.
  17224                       
  17225        </para>
  17226                     
  17227                      
  17228        <para>
  17229                         The a pplication  can also  call this  constructo r to read  an existin g zip
  17230                         archi ve.  passi ng the nam e of a val id zip fil e that doe s exist. B ut, it's
  17231                         bette r form to  use the st atic 
  17232         <see 
  17233          cref="M:Io nic.Zip.Zi pFile.Read (System.St ring)"
  17234         />
  17235          method,
  17236                         passi ng the nam e of the z ip file, b ecause usi ng 
  17237         <c>
  17238          ZipFile.Re ad()
  17239         </c>
  17240          in
  17241                         your  code commu nicates ve ry clearly  what you  are doing.   In eithe r case,
  17242                         the f ile is the n read int o the 
  17243         <c>
  17244          ZipFile
  17245         </c>
  17246          instance.   The app  can then
  17247                         enume rate the e ntries or  can modify  the zip f ile, for e xample add ing
  17248                         entri es, removi ng entries , changing  comments,  and so on .
  17249                       
  17250        </para>
  17251                     
  17252                      
  17253        <para>
  17254                         One a dvantage t o this par ameterized  construct or: it all ows applic ations to
  17255                         use t he same co de to add  items to a  zip archi ve, regard less of wh ether the
  17256                         zip f ile exists .
  17257                       
  17258        </para>
  17259                     
  17260                      
  17261        <para>
  17262                         Insta nces of th
  17263         <c>
  17264          ZipFile
  17265         </c>
  17266          class are  not multi -thread sa fe.  You m ay
  17267                         not p arty on a  single ins tance with  multiple  threads.   You may ha ve
  17268                         multi ple thread s that eac h use a di stinct 
  17269         <c>
  17270          ZipFile
  17271         </c>
  17272          instance,  or you
  17273                         can s ynchronize  multi-thr ead access  to a sing le instanc e.
  17274                       
  17275        </para>
  17276                     
  17277                      
  17278        <para>
  17279                         By th e way, sin ce DotNetZ ip is so e asy to use , don't yo u think 
  17280         <see 
  17281          href="http ://cheeso. members.wi nisp.net/D otNetZipDo nate.aspx"
  17282         >
  17283          you should
  17284                          donat e $5 or $1 0
  17285         </see>
  17286         ?
  17287                       
  17288        </para>
  17289                     
  17290                      
  17291       </remarks>
  17292                    
  17293                     
  17294       <exception  
  17295        cref="T:Io nic.Zip.Zi pException "
  17296       >
  17297                      Thrown  if name re fers to an  existing  file that  is not a v alid zip f ile.
  17298                      
  17299       </exceptio n>
  17300                    
  17301                     
  17302       <example>
  17303                      This ex ample show s how to c reate a zi pfile, and  add a few  files int o it.
  17304                      
  17305        <code>
  17306                       String  ZipFileToC reate = "a rchive1.zi p";
  17307                       String  DirectoryT oZip  = "c :\\reports ";
  17308                       using ( ZipFile zi p = new Zi pFile())
  17309                       {
  17310                         // St ore all fi les found  in the top  level dir ectory, in to the zip  archive.
  17311                         Strin g[] filena mes = Syst em.IO.Dire ctory.GetF iles(Direc toryToZip) ;
  17312                         zip.A ddFiles(fi lenames, " files");
  17313                         zip.S ave(ZipFil eToCreate) ;
  17314                       }
  17315                       
  17316        </code>
  17317                     
  17318                      
  17319        <code 
  17320         lang="VB"
  17321        >
  17322                       Dim Zip FileToCrea te As Stri ng = "arch ive1.zip"
  17323                       Dim Dir ectoryToZi p As Strin g = "c:\re ports"
  17324                       Using z ip As ZipF ile = New  ZipFile()
  17325                           Dim  filenames  As String () = Syste m.IO.Direc tory.GetFi les(Direct oryToZip)
  17326                           zip .AddFiles( filenames,  "files")
  17327                           zip .Save(ZipF ileToCreat e)
  17328                       End Usi ng
  17329                       
  17330        </code>
  17331                      
  17332       </example>
  17333                    
  17334                     
  17335       <param 
  17336        name="file Name"
  17337       >
  17338        The filena me to use  for the ne w zip arch ive.
  17339       </param>
  17340                    
  17341               
  17342      </member>
  17343              
  17344      <member 
  17345       name="M:Io nic.Zip.Zi pFile.#cto r(System.S tring,Syst em.Text.En coding)"
  17346      >
  17347                     
  17348       <summary>
  17349                        Creat es a new 
  17350        <c>
  17351         ZipFile
  17352        </c>
  17353         instance,  using the  specified  name for  the
  17354                        filen ame, and t he specifi ed Encodin g.
  17355                      
  17356       </summary>
  17357                    
  17358                     
  17359       <remarks>
  17360                      
  17361        <para>
  17362                         See t he documen tation on  the 
  17363         <see 
  17364          cref="M:Io nic.Zip.Zi pFile.#cto r(System.S tring)"
  17365         >
  17366          ZipFile
  17367                          const ructor tha t accepts  a single s tring argu ment
  17368         </see>
  17369          for basic
  17370                         infor mation on  all the 
  17371         <c>
  17372          ZipFile
  17373         </c>
  17374          construct ors.
  17375                       
  17376        </para>
  17377                     
  17378                      
  17379        <para>
  17380                         The E ncoding is  used as t he default  alternate  encoding  for entrie s with
  17381                         filen ames or co mments tha t cannot b e encoded  with the I BM437 code  page.
  17382                         This  is equival ent to set ting the 
  17383         <see 
  17384          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  17385         />
  17386          property  on the 
  17387         <c>
  17388          ZipFile
  17389         </c>
  17390                         insta nce after  constructi on.
  17391                       
  17392        </para>
  17393                     
  17394                      
  17395        <para>
  17396                         Insta nces of th
  17397         <c>
  17398          ZipFile
  17399         </c>
  17400          class are  not multi -thread sa fe.  You m ay
  17401                         not p arty on a  single ins tance with  multiple  threads.   You may ha ve
  17402                         multi ple thread s that eac h use a di stinct 
  17403         <c>
  17404          ZipFile
  17405         </c>
  17406          instance,  or you
  17407                         can s ynchronize  multi-thr ead access  to a sing le instanc e.
  17408                       
  17409        </para>
  17410                     
  17411                      
  17412       </remarks>
  17413                    
  17414                     
  17415       <exception  
  17416        cref="T:Io nic.Zip.Zi pException "
  17417       >
  17418                      Thrown  if name re fers to an  existing  file that  is not a v alid zip f ile.
  17419                      
  17420       </exceptio n>
  17421                    
  17422                     
  17423       <param 
  17424        name="file Name"
  17425       >
  17426        The filena me to use  for the ne w zip arch ive.
  17427       </param>
  17428                     
  17429       <param 
  17430        name="enco ding"
  17431       >
  17432        The Encodi ng is used  as the de fault alte rnate
  17433                      encodin g for entr ies with f ilenames o r comments  that cann ot be enco ded
  17434                      with th e IBM437 c ode page. 
  17435       </param>
  17436               
  17437      </member>
  17438              
  17439      <member 
  17440       name="M:Io nic.Zip.Zi pFile.#cto r"
  17441      >
  17442                     
  17443       <summary>
  17444                        Creat e a zip fi le, withou t specifyi ng a targe t filename  or stream  to save t o.
  17445                      
  17446       </summary>
  17447                    
  17448                     
  17449       <remarks>
  17450                      
  17451        <para>
  17452                         See t he documen tation on  the 
  17453         <see 
  17454          cref="M:Io nic.Zip.Zi pFile.#cto r(System.S tring)"
  17455         >
  17456          ZipFile
  17457                          const ructor tha t accepts  a single s tring argu ment
  17458         </see>
  17459          for basic
  17460                         infor mation on  all the 
  17461         <c>
  17462          ZipFile
  17463         </c>
  17464          construct ors.
  17465                       
  17466        </para>
  17467                     
  17468                      
  17469        <para>
  17470                         After  instantia ting with  this const ructor and  adding en tries to t he
  17471                         archi ve, the ap plication  should cal
  17472         <see 
  17473          cref="M:Io nic.Zip.Zi pFile.Save (System.St ring)"
  17474         />
  17475          or
  17476                         
  17477         <see 
  17478          cref="M:Io nic.Zip.Zi pFile.Save (System.IO .Stream)"
  17479         />
  17480          to save t o a file o r a
  17481                         strea m, respect ively.  Th e applicat ion can al so set the  
  17482         <see 
  17483          cref="P:Io nic.Zip.Zi pFile.Name "
  17484         />
  17485                         prope rty and th en call th e no-argum ent 
  17486         <see 
  17487          cref="M:Io nic.Zip.Zi pFile.Save "
  17488         />
  17489          method.   (This
  17490                         is th e preferre d approach  for appli cations th at use the  library t hrough
  17491                         COM i nterop.)   If you cal l the no-a rgument 
  17492         <see 
  17493          cref="M:Io nic.Zip.Zi pFile.Save "
  17494         />
  17495          method
  17496                         witho ut having  set the 
  17497         <c>
  17498          Name
  17499         </c>
  17500          of the 
  17501         <c>
  17502          ZipFile
  17503         </c>
  17504         , either t hrough
  17505                         the p arameteriz ed constru ctor or th rough the  explicit p roperty ,  the
  17506                         Save( ) will thr ow, becaus e there is  no place  to save th e file.  
  17507        </para>
  17508                     
  17509                      
  17510        <para>
  17511                         Insta nces of th
  17512         <c>
  17513          ZipFile
  17514         </c>
  17515          class are  not multi -thread sa fe.  You m ay
  17516                         have  multiple t hreads tha t each use  a distinc
  17517         <c>
  17518          ZipFile
  17519         </c>
  17520          instance,  or
  17521                         you c an synchro nize multi -thread ac cess to a  single ins tance.  
  17522        </para>
  17523                     
  17524                      
  17525       </remarks>
  17526                    
  17527                     
  17528       <example>
  17529                      This ex ample crea tes a Zip  archive ca lled Backu p.zip, con taining al l the file s
  17530                      in the  directory  DirectoryT oZip. File s within s ubdirector ies are no t zipped u p.
  17531                      
  17532        <code>
  17533                       using ( ZipFile zi p = new Zi pFile())
  17534                       {
  17535                         // St ore all fi les found  in the top  level dir ectory, in to the zip  archive.
  17536                         // no te: this c ode does n ot recurse  subdirect ories!
  17537                         Strin g[] filena mes = Syst em.IO.Dire ctory.GetF iles(Direc toryToZip) ;
  17538                         zip.A ddFiles(fi lenames, " files");
  17539                         zip.S ave("Backu p.zip");
  17540                       }
  17541                       
  17542        </code>
  17543                     
  17544                      
  17545        <code 
  17546         lang="VB"
  17547        >
  17548                       Using z ip As New  ZipFile
  17549                           ' S tore all f iles found  in the to p level di rectory, i nto the zi p archive.
  17550                           ' n ote: this  code does  not recurs e subdirec tories!
  17551                           Dim  filenames  As String () = Syste m.IO.Direc tory.GetFi les(Direct oryToZip)
  17552                           zip .AddFiles( filenames,  "files")
  17553                           zip .Save("Bac kup.zip")
  17554                       End Usi ng
  17555                       
  17556        </code>
  17557                      
  17558       </example>
  17559               
  17560      </member>
  17561              
  17562      <member 
  17563       name="M:Io nic.Zip.Zi pFile.#cto r(System.T ext.Encodi ng)"
  17564      >
  17565                     
  17566       <summary>
  17567                        Creat e a zip fi le, specif ying a tex t Encoding , but with out specif ying a
  17568                        targe t filename  or stream  to save t o.
  17569                      
  17570       </summary>
  17571                    
  17572                     
  17573       <remarks>
  17574                      
  17575        <para>
  17576                         See t he documen tation on  the 
  17577         <see 
  17578          cref="M:Io nic.Zip.Zi pFile.#cto r(System.S tring)"
  17579         >
  17580          ZipFile
  17581                          const ructor tha t accepts  a single s tring argu ment
  17582         </see>
  17583          for basic
  17584                         infor mation on  all the 
  17585         <c>
  17586          ZipFile
  17587         </c>
  17588          construct ors.
  17589                       
  17590        </para>
  17591                     
  17592                      
  17593       </remarks>
  17594                    
  17595                     
  17596       <param 
  17597        name="enco ding"
  17598       >
  17599                      The Enc oding is u sed as the  default a lternate e ncoding fo r entries  with
  17600                      filenam es or comm ents that  cannot be  encoded wi th the IBM 437 code p age.
  17601                      
  17602       </param>
  17603               
  17604      </member>
  17605              
  17606      <member 
  17607       name="M:Io nic.Zip.Zi pFile.#cto r(System.S tring,Syst em.IO.Text Writer)"
  17608      >
  17609                     
  17610       <summary>
  17611                        Creat es a new 
  17612        <c>
  17613         ZipFile
  17614        </c>
  17615         instance,  using the  specified  name for  the
  17616                        filen ame, and t he specifi ed status  message wr iter.
  17617                      
  17618       </summary>
  17619                    
  17620                     
  17621       <remarks>
  17622                      
  17623        <para>
  17624                         See t he documen tation on  the 
  17625         <see 
  17626          cref="M:Io nic.Zip.Zi pFile.#cto r(System.S tring)"
  17627         >
  17628          ZipFile
  17629                          const ructor tha t accepts  a single s tring argu ment
  17630         </see>
  17631          for basic
  17632                         infor mation on  all the 
  17633         <c>
  17634          ZipFile
  17635         </c>
  17636          construct ors.
  17637                       
  17638        </para>
  17639                     
  17640                      
  17641        <para>
  17642                         This  version of  the const ructor all ows the ca ller to pa ss in a Te xtWriter,
  17643                         to wh ich verbos e messages  will be w ritten dur ing extrac tion or cr eation of
  17644                         the z ip archive .  A conso le applica tion may w ish to pas s
  17645                         Syste m.Console. Out to get  messages  on the Con sole. A gr aphical or  headless
  17646                         appli cation may  wish to c apture the  messages  in a diffe rent
  17647                         
  17648         <c>
  17649          TextWriter
  17650         </c>
  17651         , for exam ple, a 
  17652         <c>
  17653          StringWrit er
  17654         </c>
  17655         , and then  display
  17656                         the m essages in  a TextBox , or gener ate an aud it log of  ZipFile op erations.
  17657                       
  17658        </para>
  17659                     
  17660                      
  17661        <para>
  17662                         To en crypt the  data for t he files a dded to th
  17663         <c>
  17664          ZipFile
  17665         </c>
  17666          instance,
  17667                         set t he Passwor d property  after cre ating the 
  17668         <c>
  17669          ZipFile
  17670         </c>
  17671          instance.
  17672                       
  17673        </para>
  17674                     
  17675                      
  17676        <para>
  17677                         Insta nces of th
  17678         <c>
  17679          ZipFile
  17680         </c>
  17681          class are  not multi -thread sa fe.  You m ay
  17682                         not p arty on a  single ins tance with  multiple  threads.   You may ha ve
  17683                         multi ple thread s that eac h use a di stinct 
  17684         <c>
  17685          ZipFile
  17686         </c>
  17687          instance,  or you
  17688                         can s ynchronize  multi-thr ead access  to a sing le instanc e.
  17689                       
  17690        </para>
  17691                     
  17692                      
  17693       </remarks>
  17694                    
  17695                     
  17696       <exception  
  17697        cref="T:Io nic.Zip.Zi pException "
  17698       >
  17699                      Thrown  if name re fers to an  existing  file that  is not a v alid zip f ile.
  17700                      
  17701       </exceptio n>
  17702                    
  17703                     
  17704       <example>
  17705                      
  17706        <code>
  17707                       using ( ZipFile zi p = new Zi pFile("Bac kup.zip",  Console.Ou t))
  17708                       {
  17709                         // St ore all fi les found  in the top  level dir ectory, in to the zip  archive.
  17710                         // no te: this c ode does n ot recurse  subdirect ories!
  17711                         // St atus messa ges will b e written  to Console .Out
  17712                         Strin g[] filena mes = Syst em.IO.Dire ctory.GetF iles(Direc toryToZip) ;
  17713                         zip.A ddFiles(fi lenames);
  17714                         zip.S ave();
  17715                       }
  17716                       
  17717        </code>
  17718                     
  17719                      
  17720        <code 
  17721         lang="VB"
  17722        >
  17723                       Using z ip As New  ZipFile("B ackup.zip" , Console. Out)
  17724                           ' S tore all f iles found  in the to p level di rectory, i nto the zi p archive.
  17725                           ' n ote: this  code does  not recurs e subdirec tories!
  17726                           ' S tatus mess ages will  be written  to Consol e.Out
  17727                           Dim  filenames  As String () = Syste m.IO.Direc tory.GetFi les(Direct oryToZip)
  17728                           zip .AddFiles( filenames)
  17729                           zip .Save()
  17730                       End Usi ng
  17731                       
  17732        </code>
  17733                      
  17734       </example>
  17735                    
  17736                     
  17737       <param 
  17738        name="file Name"
  17739       >
  17740        The filena me to use  for the ne w zip arch ive.
  17741       </param>
  17742                     
  17743       <param 
  17744        name="stat usMessageW riter"
  17745       >
  17746        A TextWrit er to use  for writin g
  17747                      verbose  status me ssages.
  17748       </param>
  17749               
  17750      </member>
  17751              
  17752      <member 
  17753       name="M:Io nic.Zip.Zi pFile.#cto r(System.S tring,Syst em.IO.Text Writer,Sys tem.Text.E ncoding)"
  17754      >
  17755                     
  17756       <summary>
  17757                        Creat es a new 
  17758        <c>
  17759         ZipFile
  17760        </c>
  17761         instance,  using the  specified  name for  the
  17762                        filen ame, the s pecified s tatus mess age writer , and the  specified  Encoding.
  17763                      
  17764       </summary>
  17765                    
  17766                     
  17767       <remarks>
  17768                      
  17769        <para>
  17770                         This  constructo r works li ke the 
  17771         <see 
  17772          cref="M:Io nic.Zip.Zi pFile.#cto r(System.S tring)"
  17773         >
  17774          ZipFile
  17775                          const ructor tha t accepts  a single s tring argu ment.
  17776         </see>
  17777          See that
  17778                         refer ence for d etail on w hat this c onstructor  does.
  17779                       
  17780        </para>
  17781                     
  17782                      
  17783        <para>
  17784                         This  version of  the const ructor all ows the ca ller to pa ss in a
  17785                         
  17786         <c>
  17787          TextWriter
  17788         </c>
  17789         , and an E ncoding.   The 
  17790         <c>
  17791          TextWriter
  17792         </c>
  17793          will coll ect
  17794                         verbo se message s that are  generated  by the li brary duri ng extract ion or
  17795                         creat ion of the  zip archi ve.  A con sole appli cation may  wish to p ass
  17796                         
  17797         <c>
  17798          System.Con sole.Out
  17799         </c>
  17800          to get me ssages on  the Consol e. A graph ical or
  17801                         headl ess applic ation may  wish to ca pture the  messages i n a differ ent
  17802                         
  17803         <c>
  17804          TextWriter
  17805         </c>
  17806         , for exam ple, a 
  17807         <c>
  17808          StringWrit er
  17809         </c>
  17810         , and then  display
  17811                         the m essages in  a 
  17812         <c>
  17813          TextBox
  17814         </c>
  17815         , or gener ate an aud it log of
  17816                         
  17817         <c>
  17818          ZipFile
  17819         </c>
  17820          operation s.
  17821                       
  17822        </para>
  17823                     
  17824                      
  17825        <para>
  17826                         The 
  17827         <c>
  17828          Encoding
  17829         </c>
  17830          is used a s the defa ult altern ate encodi ng for ent ries
  17831                         with  filenames  or comment s that can not be enc oded with  the IBM437  code
  17832                         page.   This is  a equivale nt to sett ing the 
  17833         <see 
  17834          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  17835         />
  17836          property  on the 
  17837         <c>
  17838          ZipFile
  17839         </c>
  17840                         insta nce after  constructi on.
  17841                       
  17842        </para>
  17843                     
  17844                      
  17845        <para>
  17846                         To en crypt the  data for t he files a dded to th
  17847         <c>
  17848          ZipFile
  17849         </c>
  17850          instance,
  17851                         set t he 
  17852         <c>
  17853          Password
  17854         </c>
  17855          property  after crea ting the 
  17856         <c>
  17857          ZipFile
  17858         </c>
  17859                         insta nce.
  17860                       
  17861        </para>
  17862                     
  17863                      
  17864        <para>
  17865                         Insta nces of th
  17866         <c>
  17867          ZipFile
  17868         </c>
  17869          class are  not multi -thread sa fe.  You m ay
  17870                         not p arty on a  single ins tance with  multiple  threads.   You may ha ve
  17871                         multi ple thread s that eac h use a di stinct 
  17872         <c>
  17873          ZipFile
  17874         </c>
  17875          instance,  or you
  17876                         can s ynchronize  multi-thr ead access  to a sing le instanc e.
  17877                       
  17878        </para>
  17879                     
  17880                      
  17881       </remarks>
  17882                    
  17883                     
  17884       <exception  
  17885        cref="T:Io nic.Zip.Zi pException "
  17886       >
  17887                      Thrown  if 
  17888        <c>
  17889         fileName
  17890        </c>
  17891         refers to  an existi ng file th at is not  a valid zi p file.
  17892                      
  17893       </exceptio n>
  17894                    
  17895                     
  17896       <param 
  17897        name="file Name"
  17898       >
  17899        The filena me to use  for the ne w zip arch ive.
  17900       </param>
  17901                     
  17902       <param 
  17903        name="stat usMessageW riter"
  17904       >
  17905        A TextWrit er to use  for writin g verbose
  17906                      status  messages.
  17907       </param>
  17908                     
  17909       <param 
  17910        name="enco ding"
  17911       >
  17912                      The Enc oding is u sed as the  default a lternate e ncoding fo r entries  with
  17913                      filenam es or comm ents that  cannot be  encoded wi th the IBM 437 code p age.
  17914                      
  17915       </param>
  17916               
  17917      </member>
  17918              
  17919      <member 
  17920       name="M:Io nic.Zip.Zi pFile.Init ialize(Sys tem.String )"
  17921      >
  17922                     
  17923       <summary>
  17924                        Initi alize a 
  17925        <c>
  17926         ZipFile
  17927        </c>
  17928         instance  by reading  in a zip  file.
  17929                      
  17930       </summary>
  17931                    
  17932                     
  17933       <remarks>
  17934                     
  17935                      
  17936        <para>
  17937                         This  method is  primarily  useful fro m COM Auto mation env ironments,  when
  17938                         readi ng or extr acting zip  files. In  COM, it i s not poss ible to in voke
  17939                         param eterized c onstructor s for a cl ass. A COM  Automatio n applicat ion can
  17940                         updat e a zip fi le by usin g the 
  17941         <see 
  17942          cref="M:Io nic.Zip.Zi pFile.#cto r"
  17943         >
  17944          default (n o argument )
  17945                          const ructor
  17946         </see>
  17947         , then cal ling 
  17948         <c>
  17949          Initialize ()
  17950         </c>
  17951          to read t he content s
  17952                         of an  on-disk z ip archive  into the 
  17953         <c>
  17954          ZipFile
  17955         </c>
  17956          instance.
  17957                       
  17958        </para>
  17959                     
  17960                      
  17961        <para>
  17962                         .NET  applicatio ns are enc ouraged to  use the 
  17963         <c>
  17964          ZipFile.Re ad()
  17965         </c>
  17966          methods
  17967                         for b etter clar ity.
  17968                       
  17969        </para>
  17970                     
  17971                      
  17972       </remarks>
  17973                     
  17974       <param 
  17975        name="file Name"
  17976       >
  17977        the name o f the exis ting zip f ile to rea d in.
  17978       </param>
  17979               
  17980      </member>
  17981              
  17982      <member 
  17983       name="M:Io nic.Zip.Zi pFile.Remo veEntry(Io nic.Zip.Zi pEntry)"
  17984      >
  17985                     
  17986       <summary>
  17987                        Remov es the giv en 
  17988        <c>
  17989         ZipEntry
  17990        </c>
  17991         from the  zip archiv e.
  17992                      
  17993       </summary>
  17994                    
  17995                     
  17996       <remarks>
  17997                      
  17998        <para>
  17999                         After  calling 
  18000         <c>
  18001          RemoveEntr y
  18002         </c>
  18003         , the appl ication mu st call 
  18004         <c>
  18005          Save
  18006         </c>
  18007          to
  18008                         make  the change s permanen t.
  18009                       
  18010        </para>
  18011                      
  18012       </remarks>
  18013                    
  18014                     
  18015       <exception  
  18016        cref="T:Sy stem.Argum entExcepti on"
  18017       >
  18018                        Throw n if the s pecified 
  18019        <c>
  18020         ZipEntry
  18021        </c>
  18022         does not  exist in t he 
  18023        <c>
  18024         ZipFile
  18025        </c>
  18026        .
  18027                      
  18028       </exceptio n>
  18029                    
  18030                     
  18031       <example>
  18032                        In th is example , all entr ies in the  zip archi ve dating  from befor e
  18033                        Decem ber 31st,  2007, are  removed fr om the arc hive.  Thi s is actua lly much
  18034                        easie r if you u se the Rem oveSelecte dEntries m ethod.  Bu t I needed  an
  18035                        examp le for Rem oveEntry,  so here it  is.
  18036                      
  18037        <code>
  18038                       String  ZipFileToR ead = "Arc hiveToModi fy.zip";
  18039                       System. DateTime T hreshold =  new Syste m.DateTime (2007,12,3 1);
  18040                       using ( ZipFile zi p = ZipFil e.Read(Zip FileToRead ))
  18041                       {
  18042                         var E ntriesToRe move = new  System.Co llections. Generic.Li st&lt;ZipE ntry&gt;() ;
  18043                         forea ch (ZipEnt ry e in zi p)
  18044                         {
  18045                           if  (e.LastMod ified &lt;  Threshold )
  18046                           {
  18047                             / / We canno t remove t he entry f rom the li st, within  the conte xt of
  18048                             / / an enume ration of  said list.
  18049                             / / So we ad d the doom ed entry t o a list t o be remov ed later.
  18050                             E ntriesToRe move.Add(e );
  18051                           }
  18052                         }
  18053                      
  18054                         // ac tually rem ove the do omed entri es.
  18055                         forea ch (ZipEnt ry zombie  in Entries ToRemove)
  18056                           zip .RemoveEnt ry(zombie) ;
  18057                      
  18058                         zip.C omment= St ring.Forma t("This zi p archive  was update d at {0}." ,
  18059                                                       System.D ateTime.No w.ToString ("G"));
  18060                      
  18061                         // sa ve with a  different  name
  18062                         zip.S ave("Archi ve-Updated .zip");
  18063                       }
  18064                       
  18065        </code>
  18066                     
  18067                      
  18068        <code 
  18069         lang="VB"
  18070        >
  18071                         Dim Z ipFileToRe ad As Stri ng = "Arch iveToModif y.zip"
  18072                         Dim T hreshold A s New Date Time(2007,  12, 31)
  18073                         Using  zip As Zi pFile = Zi pFile.Read (ZipFileTo Read)
  18074                             D im Entries ToRemove A s New Syst em.Collect ions.Gener ic.List(Of  ZipEntry)
  18075                             D im e As Zi pEntry
  18076                             F or Each e  In zip
  18077                                  If (e.L astModifie d &lt; Thr eshold) Th en
  18078                                      ' W e cannot r emove the  entry from  the list,  within th e context  of
  18079                                      ' a n enumerat ion of sai d list.
  18080                                      ' S o we add t he doomed  entry to a  list to b e removed  later.
  18081                                      Ent riesToRemo ve.Add(e)
  18082                                  End If
  18083                             N ext
  18084                      
  18085                             '  actually  remove the  doomed en tries.
  18086                             D im zombie  As ZipEntr y
  18087                             F or Each zo mbie In En triesToRem ove
  18088                                  zip.Rem oveEntry(z ombie)
  18089                             N ext
  18090                             z ip.Comment  = String. Format("Th is zip arc hive was u pdated at  {0}.", Dat eTime.Now. ToString(" G"))
  18091                             ' save as a  different  name
  18092                             z ip.Save("A rchive-Upd ated.zip")
  18093                         End U sing
  18094                       
  18095        </code>
  18096                      
  18097       </example>
  18098                    
  18099                     
  18100       <param 
  18101        name="entr y"
  18102       >
  18103                      The 
  18104        <c>
  18105         ZipEntry
  18106        </c>
  18107         to remove  from the  zip.
  18108                      
  18109       </param>
  18110                    
  18111                     
  18112       <seealso 
  18113        cref="M:Io nic.Zip.Zi pFile.Remo veSelected Entries(Sy stem.Strin g)"
  18114       />
  18115                    
  18116               
  18117      </member>
  18118              
  18119      <member 
  18120       name="M:Io nic.Zip.Zi pFile.Remo veEntry(Sy stem.Strin g)"
  18121      >
  18122                     
  18123       <summary>
  18124                      Removes  the 
  18125        <c>
  18126         ZipEntry
  18127        </c>
  18128         with the  given file name from  the zip ar chive.
  18129                      
  18130       </summary>
  18131                    
  18132                     
  18133       <remarks>
  18134                      
  18135        <para>
  18136                         After  calling 
  18137         <c>
  18138          RemoveEntr y
  18139         </c>
  18140         , the appl ication mu st call 
  18141         <c>
  18142          Save
  18143         </c>
  18144          to
  18145                         make  the change s permanen t.
  18146                       
  18147        </para>
  18148                     
  18149                      
  18150       </remarks>
  18151                    
  18152                     
  18153       <exception  
  18154        cref="T:Sy stem.Inval idOperatio nException "
  18155       >
  18156                        Throw n if the 
  18157        <c>
  18158         ZipFile
  18159        </c>
  18160         is not up datable.
  18161                      
  18162       </exceptio n>
  18163                    
  18164                     
  18165       <exception  
  18166        cref="T:Sy stem.Argum entExcepti on"
  18167       >
  18168                        Throw n if a 
  18169        <c>
  18170         ZipEntry
  18171        </c>
  18172         with the  specified  filename d oes not ex ist in
  18173                        the 
  18174        <c>
  18175         ZipFile
  18176        </c>
  18177        .
  18178                      
  18179       </exceptio n>
  18180                    
  18181                     
  18182       <example>
  18183                     
  18184                        This  example sh ows one wa y to remov e an entry  with a gi ven filena me from
  18185                        an ex isting zip  archive.
  18186                     
  18187                      
  18188        <code>
  18189                       String  zipFileToR ead= "Pack edDocument s.zip";
  18190                       string  candidate  = "DatedMa terial.xps ";
  18191                       using ( ZipFile zi p = ZipFil e.Read(zip FileToRead ))
  18192                       {
  18193                         if (z ip.EntryFi lenames.Co ntains(can didate))
  18194                         {
  18195                           zip .RemoveEnt ry(candida te);
  18196                           zip .Comment=  String.For mat("The f ile '{0}'  has been r emoved fro m this arc hive.",
  18197                                                         Candid ate);
  18198                           zip .Save();
  18199                         }
  18200                       }
  18201                       
  18202        </code>
  18203                      
  18204        <code 
  18205         lang="VB"
  18206        >
  18207                         Dim z ipFileToRe ad As Stri ng = "Pack edDocument s.zip"
  18208                         Dim c andidate A s String =  "DatedMat erial.xps"
  18209                         Using  zip As Zi pFile = Zi pFile.Read (zipFileTo Read)
  18210                             I f zip.Entr yFilenames .Contains( candidate)  Then
  18211                                  zip.Rem oveEntry(c andidate)
  18212                                  zip.Com ment = Str ing.Format ("The file  '{0}' has  been remo ved from t his archiv e.", Candi date)
  18213                                  zip.Sav e
  18214                             E nd If
  18215                         End U sing
  18216                       
  18217        </code>
  18218                      
  18219       </example>
  18220                    
  18221                     
  18222       <param 
  18223        name="file Name"
  18224       >
  18225                      The nam e of the f ile, inclu ding any d irectory p ath, to re move from  the zip.
  18226                      The fil ename matc h is not c ase-sensit ive by def ault; you  can use th e
  18227                      
  18228        <c>
  18229         CaseSensit iveRetriev al
  18230        </c>
  18231         property  to change  this behav ior. The
  18232                      pathnam e can use  forward-sl ashes or b ackward sl ashes.
  18233                      
  18234       </param>
  18235                    
  18236               
  18237      </member>
  18238              
  18239      <member 
  18240       name="M:Io nic.Zip.Zi pFile.Disp ose"
  18241      >
  18242                     
  18243       <summary>
  18244                        Close s the read  and write  streams a ssociated
  18245                        to th
  18246        <c>
  18247         ZipFile
  18248        </c>
  18249        , if neces sary.
  18250                      
  18251       </summary>
  18252                    
  18253                     
  18254       <remarks>
  18255                        The D ispose() m ethod is g enerally e mployed im plicitly,  via a 
  18256        <c>
  18257         using(..)  {..}
  18258        </c>
  18259                        state ment. (
  18260        <c>
  18261         Using...En d Using
  18262        </c>
  18263         in VB) If  you do no t employ a  using
  18264                        state ment, insu re that yo ur applica tion calls  Dispose()  explicitl y.  For
  18265                        examp le, in a P owershell  applicatio n, or an a pplication  that uses  the COM
  18266                        inter op interfa ce, you mu st call Di spose() ex plicitly.
  18267                      
  18268       </remarks>
  18269                    
  18270                     
  18271       <example>
  18272                      This ex ample extr acts an en try select ed by name , from the  Zip file  to the
  18273                      Console .
  18274                      
  18275        <code>
  18276                       using ( ZipFile zi p = ZipFil e.Read(zip file))
  18277                       {
  18278                         forea ch (ZipEnt ry e in zi p)
  18279                         {
  18280                           if  (WantThisE ntry(e.Fil eName))
  18281                             z ip.Extract (e.FileNam e, Console .OpenStand ardOutput( ));
  18282                         }
  18283                       } // Di spose() is  called im plicitly h ere.
  18284                       
  18285        </code>
  18286                     
  18287                      
  18288        <code 
  18289         lang="VB"
  18290        >
  18291                       Using z ip As ZipF ile = ZipF ile.Read(z ipfile)
  18292                           Dim  e As ZipE ntry
  18293                           For  Each e In  zip
  18294                             I f WantThis Entry(e.Fi leName) Th en
  18295                                  zip.Ext ract(e.Fil eName, Con sole.OpenS tandardOut put())
  18296                             E nd If
  18297                           Nex t
  18298                       End Usi ng ' Dispo se is impl icity call ed here
  18299                       
  18300        </code>
  18301                      
  18302       </example>
  18303               
  18304      </member>
  18305              
  18306      <member 
  18307       name="M:Io nic.Zip.Zi pFile.Disp ose(System .Boolean)"
  18308      >
  18309                     
  18310       <summary>
  18311                        Dispo ses any ma naged reso urces, if  the flag i s set, the n marks th e
  18312                        insta nce dispos ed.  This  method is  typically  not called  explicitl y from
  18313                        appli cation cod e.
  18314                      
  18315       </summary>
  18316                    
  18317                     
  18318       <remarks>
  18319                        Appli cations sh ould call 
  18320        <see 
  18321         cref="M:Io nic.Zip.Zi pFile.Disp ose"
  18322        >
  18323         the no-arg  Dispose m ethod
  18324        </see>
  18325        .
  18326                      
  18327       </remarks>
  18328                    
  18329                     
  18330       <param 
  18331        name="disp oseManaged Resources"
  18332       >
  18333                        indic ates wheth er the met hod should  dispose s treams or  not.
  18334                      
  18335       </param>
  18336               
  18337      </member>
  18338              
  18339      <member 
  18340       name="F:Io nic.Zip.Zi pFile.Buff erSizeDefa ult"
  18341      >
  18342                    
  18343       <summary>
  18344                       Defaul t size of  the buffer  used for  IO.
  18345                     
  18346       </summary>
  18347               
  18348      </member>
  18349              
  18350      <member 
  18351       name="M:Io nic.Zip.Zi pFile.Extr actAll(Sys tem.String )"
  18352      >
  18353                     
  18354       <summary>
  18355                      Extract s all of t he items i n the zip  archive, t o the spec ified path  in the
  18356                      filesys tem.  The  path can b e relative  or fully- qualified.
  18357                      
  18358       </summary>
  18359                    
  18360                     
  18361       <remarks>
  18362                      
  18363        <para>
  18364                         This  method wil l extract  all entrie s in the 
  18365         <c>
  18366          ZipFile
  18367         </c>
  18368          to the
  18369                         speci fied path.
  18370                       
  18371        </para>
  18372                     
  18373                      
  18374        <para>
  18375                         If an  extractio n of a fil e from the  zip archi ve would o verwrite a n
  18376                         exist ing file i n the file system, th e action t aken is di ctated by  the
  18377                         Extra ctExisting File prope rty, which  overrides  any setti ng you may  have
  18378                         made  on individ ual ZipEnt ry instanc es.  By de fault, if  you have n ot
  18379                         set t hat proper ty on the 
  18380         <c>
  18381          ZipFile
  18382         </c>
  18383          instance,  the entry  will not
  18384                         be ex tracted, t he existin g file wil l not be o verwritten  and an
  18385                         excep tion will  be thrown.  To change  this, set  the prope rty, or us e the
  18386                         
  18387         <see 
  18388          cref="M:Io nic.Zip.Zi pFile.Extr actAll(Sys tem.String ,Ionic.Zip .ExtractEx istingFile Action)"
  18389         />
  18390          overload  that allow s you to
  18391                         speci fy an Extr actExistin gFileActio n paramete r.
  18392                       
  18393        </para>
  18394                     
  18395                      
  18396        <para>
  18397                         The a ction to t ake when a n extract  would over write an e xisting fi le
  18398                         appli es to all  entries.   If you wan t to set t his on a p er-entry b asis,
  18399                         then  you must u se one of  the 
  18400         <see 
  18401          cref="M:Io nic.Zip.Zi pEntry.Ext ract"
  18402         >
  18403          ZipEntry.E xtract
  18404         </see>
  18405          methods.
  18406                       
  18407        </para>
  18408                     
  18409                      
  18410        <para>
  18411                         This  method wil l send ver bose outpu t messages  to the 
  18412         <see 
  18413          cref="P:Io nic.Zip.Zi pFile.Stat usMessageT extWriter"
  18414         />
  18415         , if it is  set on th
  18416         <c>
  18417          ZipFile
  18418         </c>
  18419                         insta nce.
  18420                       
  18421        </para>
  18422                     
  18423                      
  18424        <para>
  18425                       You may  wish to t ake advant age of the  
  18426         <c>
  18427          ExtractPro gress
  18428         </c>
  18429          event.
  18430                       
  18431        </para>
  18432                     
  18433                      
  18434        <para>
  18435                         About  timestamp s: When ex tracting a  file entr y from a z ip archive , the
  18436                         extra cted file  gets the l ast modifi ed time of  the entry  as stored  in
  18437                         the a rchive. Th e archive  may also s tore exten ded file t imestamp
  18438                         infor mation, in cluding la st accesse d and crea ted times.  If these  are
  18439                         prese nt in the 
  18440         <c>
  18441          ZipEntry
  18442         </c>
  18443         , then the  extracted  file will  also get
  18444                         these  times.
  18445                       
  18446        </para>
  18447                     
  18448                      
  18449        <para>
  18450                         A Dir ectory ent ry is some what diffe rent. It w ill get th e times as
  18451                         descr ibed for a  file entr y, but, if  there are  file entr ies in the  zip
  18452                         archi ve that, w hen extrac ted, appea r in the j ust-create d director y,
  18453                         then  when those  file entr ies are ex tracted, t he last mo dified and  last
  18454                         acces sed times  of the dir ectory wil l change,  as a side  effect.  T he
  18455                         resul t is that  after an e xtraction  of a direc tory and a  number of
  18456                         files  within th e director y, the las t modified  and last  accessed
  18457                         times tamps on t he directo ry will re flect the  time that  the last f ile
  18458                         was e xtracted i nto the di rectory, r ather than  the time  stored in  the
  18459                         zip a rchive for  the direc tory.
  18460                       
  18461        </para>
  18462                     
  18463                      
  18464        <para>
  18465                         To co mpensate,  when extra cting an a rchive wit
  18466         <c>
  18467          ExtractAll
  18468         </c>
  18469         ,
  18470                         DotNe tZip will  extract al l the file  and direc tory entri es as desc ribed
  18471                         above , but it w ill then m ake a seco nd pass on  the direc tories, an d
  18472                         reset  the times  on the di rectories  to reflect  what is s tored in t he
  18473                         zip a rchive.
  18474                       
  18475        </para>
  18476                     
  18477                      
  18478        <para>
  18479                         This  compensati on is perf ormed only  within th e context  of an
  18480                         
  18481         <c>
  18482          ExtractAll
  18483         </c>
  18484         . If you c all 
  18485         <c>
  18486          ZipEntry.E xtract
  18487         </c>
  18488          on a dire ctory
  18489                         entry , the time stamps on  directory  in the fil esystem wi ll reflect  the
  18490                         times  stored in  the zip.   If you th en call 
  18491         <c>
  18492          ZipEntry.E xtract
  18493         </c>
  18494          on
  18495                         a fil e entry, w hich is ex tracted in to the dir ectory, th e timestam ps on
  18496                         the d irectory w ill be upd ated to th e current  time.
  18497                       
  18498        </para>
  18499                      
  18500       </remarks>
  18501                    
  18502                     
  18503       <example>
  18504                        This  example ex tracts all  the entri es in a zi p archive  file, to t he
  18505                        speci fied targe t director y.  The ex traction w ill overwr ite any
  18506                        exist ing files  silently.
  18507                     
  18508                      
  18509        <code>
  18510                       String  TargetDire ctory= "un pack";
  18511                       using(Z ipFile zip = ZipFile. Read(ZipFi leToExtrac t))
  18512                       {
  18513                           zip .ExtractEx istingFile = ExtractE xistingFil eAction.Ov erwriteSil ently;
  18514                           zip .ExtractAl l(TargetDi rectory);
  18515                       }
  18516                       
  18517        </code>
  18518                     
  18519                      
  18520        <code 
  18521         lang="VB"
  18522        >
  18523                       Dim Tar getDirecto ry As Stri ng = "unpa ck"
  18524                       Using z ip As ZipF ile = ZipF ile.Read(Z ipFileToEx tract)
  18525                           zip .ExtractEx istingFile = ExtractE xistingFil eAction.Ov erwriteSil ently
  18526                           zip .ExtractAl l(TargetDi rectory)
  18527                       End Usi ng
  18528                       
  18529        </code>
  18530                      
  18531       </example>
  18532                    
  18533                     
  18534       <seealso 
  18535        cref="E:Io nic.Zip.Zi pFile.Extr actProgres s"
  18536       />
  18537                     
  18538       <seealso 
  18539        cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  18540       />
  18541                    
  18542                     
  18543       <param 
  18544        name="path "
  18545       >
  18546                        The p ath to whi ch the con tents of t he zipfile  will be e xtracted.
  18547                        The p ath can be  relative  or fully-q ualified.
  18548                      
  18549       </param>
  18550                    
  18551               
  18552      </member>
  18553              
  18554      <member 
  18555       name="M:Io nic.Zip.Zi pFile.Extr actAll(Sys tem.String ,Ionic.Zip .ExtractEx istingFile Action)"
  18556      >
  18557                     
  18558       <summary>
  18559                      Extract s all of t he items i n the zip  archive, t o the spec ified path  in the
  18560                      filesys tem, using  the speci fied behav ior when e xtraction  would over write an
  18561                      existin g file.
  18562                      
  18563       </summary>
  18564                    
  18565                     
  18566       <remarks>
  18567                     
  18568                      
  18569        <para>
  18570                       This me thod will  extract al l entries  in the 
  18571         <c>
  18572          ZipFile
  18573         </c>
  18574          to the sp ecified
  18575                       path.   For an ext raction th at would o verwrite a n existing  file, the  behavior
  18576                       is dict ated by 
  18577         <paramref 
  18578          name="extr actExistin gFile"
  18579         />
  18580         , which ov errides an y
  18581                       setting  you may h ave made o n individu al ZipEntr y instance s.
  18582                       
  18583        </para>
  18584                     
  18585                      
  18586        <para>
  18587                       The act ion to tak e when an  extract wo uld overwr ite an exi sting file
  18588                       applies  to all en tries.  If  you want  to set thi s on a per -entry bas is,
  18589                       then yo u must use  
  18590         <see 
  18591          cref="M:Io nic.Zip.Zi pEntry.Ext ract(Syste m.String,I onic.Zip.E xtractExis tingFileAc tion)"
  18592         />
  18593          or one of  the simil ar methods .
  18594                       
  18595        </para>
  18596                     
  18597                      
  18598        <para>
  18599                       Calling  this meth od is equi valent to  setting th
  18600         <see 
  18601          cref="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  18602         />
  18603          property  and then c alling 
  18604         <see 
  18605          cref="M:Io nic.Zip.Zi pFile.Extr actAll(Sys tem.String )"
  18606         />
  18607         .
  18608                       
  18609        </para>
  18610                     
  18611                      
  18612        <para>
  18613                       This me thod will  send verbo se output  messages t o the
  18614                       
  18615         <see 
  18616          cref="P:Io nic.Zip.Zi pFile.Stat usMessageT extWriter"
  18617         />
  18618         , if it is  set on th
  18619         <c>
  18620          ZipFile
  18621         </c>
  18622          instance.
  18623                       
  18624        </para>
  18625                      
  18626       </remarks>
  18627                    
  18628                     
  18629       <example>
  18630                      This ex ample extr acts all t he entries  in a zip  archive fi le, to the
  18631                      specifi ed target  directory.   It does  not overwr ite any ex isting fil es.
  18632                      
  18633        <code>
  18634                       String  TargetDire ctory= "c: \\unpack";
  18635                       using(Z ipFile zip = ZipFile. Read(ZipFi leToExtrac t))
  18636                       {
  18637                         zip.E xtractAll( TargetDire ctory, Ext ractExisti ngFileActi on.DontOve rwrite);
  18638                       }
  18639                       
  18640        </code>
  18641                     
  18642                      
  18643        <code 
  18644         lang="VB"
  18645        >
  18646                       Dim Tar getDirecto ry As Stri ng = "c:\u npack"
  18647                       Using z ip As ZipF ile = ZipF ile.Read(Z ipFileToEx tract)
  18648                           zip .ExtractAl l(TargetDi rectory, E xtractExis tingFileAc tion.DontO verwrite)
  18649                       End Usi ng
  18650                       
  18651        </code>
  18652                      
  18653       </example>
  18654                    
  18655                     
  18656       <param 
  18657        name="path "
  18658       >
  18659                      The pat h to which  the conte nts of the  zipfile w ill be ext racted.
  18660                      The pat h can be r elative or  fully-qua lified.
  18661                      
  18662       </param>
  18663                    
  18664                     
  18665       <param 
  18666        name="extr actExistin gFile"
  18667       >
  18668                      The act ion to tak e if extra ction woul d overwrit e an exist ing file.
  18669                      
  18670       </param>
  18671                     
  18672       <seealso 
  18673        cref="M:Io nic.Zip.Zi pFile.Extr actSelecte dEntries(S ystem.Stri ng,Ionic.Z ip.Extract ExistingFi leAction)"
  18674       />
  18675               
  18676      </member>
  18677              
  18678      <member 
  18679       name="M:Io nic.Zip.Zi pFile.Read (System.St ring)"
  18680      >
  18681                     
  18682       <summary>
  18683                      Reads a  zip file  archive an d returns  the instan ce.
  18684                      
  18685       </summary>
  18686                    
  18687                     
  18688       <remarks>
  18689                      
  18690        <para>
  18691                       The str eam is rea d using th e default 
  18692         <c>
  18693          System.Tex t.Encoding
  18694         </c>
  18695         , which is  the
  18696                       
  18697         <c>
  18698          IBM437
  18699         </c>
  18700          codepage.
  18701                       
  18702        </para>
  18703                      
  18704       </remarks>
  18705                    
  18706                     
  18707       <exception  
  18708        cref="T:Sy stem.Excep tion"
  18709       >
  18710                      Thrown  if the 
  18711        <c>
  18712         ZipFile
  18713        </c>
  18714         cannot be  read. The  implement ation of t his method
  18715                      relies  on 
  18716        <c>
  18717         System.IO. File.OpenR ead
  18718        </c>
  18719        , which ca n throw a  variety of  exception s,
  18720                      includi ng specifi c exceptio ns if a fi le is not  found, an  unauthoriz ed access
  18721                      excepti on, except ions for p oorly form atted file names, and  so on.
  18722                      
  18723       </exceptio n>
  18724                    
  18725                     
  18726       <param 
  18727        name="file Name"
  18728       >
  18729                      The nam e of the z ip archive  to open.   This can  be a fully -qualified  or relati ve
  18730                      pathnam e.
  18731                      
  18732       </param>
  18733                    
  18734                     
  18735       <seealso 
  18736        cref="M:Io nic.Zip.Zi pFile.Read (System.St ring,Ionic .Zip.ReadO ptions)"
  18737       />
  18738       .
  18739                    
  18740                     
  18741       <returns>
  18742        The instan ce read fr om the zip  archive.
  18743       </returns>
  18744                    
  18745               
  18746      </member>
  18747              
  18748      <member 
  18749       name="M:Io nic.Zip.Zi pFile.Read (System.St ring,Ionic .Zip.ReadO ptions)"
  18750      >
  18751                     
  18752       <summary>
  18753                        Reads  a zip fil e archive  from the n amed files ystem file  using the
  18754                        speci fied optio ns.
  18755                      
  18756       </summary>
  18757                    
  18758                     
  18759       <remarks>
  18760                      
  18761        <para>
  18762                         This  version of  the 
  18763         <c>
  18764          Read()
  18765         </c>
  18766          method al lows the c aller to p ass
  18767                         in a 
  18768         <c>
  18769          TextWriter
  18770         </c>
  18771          an 
  18772         <c>
  18773          Encoding
  18774         </c>
  18775         , via an i nstance of  the
  18776                         
  18777         <c>
  18778          ReadOption s
  18779         </c>
  18780          class.  T he 
  18781         <c>
  18782          ZipFile
  18783         </c>
  18784          is read i n using th e
  18785                         speci fied encod ing for en tries wher e UTF-8 en coding is  not
  18786                         expli citly spec ified.
  18787                       
  18788        </para>
  18789                      
  18790       </remarks>
  18791                    
  18792                     
  18793       <example>
  18794                     
  18795                      
  18796        <para>
  18797                         This  example sh ows how to  read a zi p file usi ng the Big -5 Chinese
  18798                         code  page (950) , and extr act each e ntry in th e zip file , while
  18799                         sendi ng status  messages o ut to the  Console.
  18800                       
  18801        </para>
  18802                     
  18803                      
  18804        <para>
  18805                         For t his code t o work as  intended,  the zipfil e must hav e been
  18806                         creat ed using t he big5 co de page (C P950). Thi s is typic al, for
  18807                         examp le, when u sing WinRa r on a mac hine with  CP950 set  as the
  18808                         defau lt code pa ge.  In th at case, t he names o f entries  within the
  18809                         Zip a rchive wil l be store d in that  code page,  and readi ng the zip
  18810                         archi ve must be  done usin g that cod e page.  I f the appl ication di d
  18811                         not u se the cor rect code  page in Zi pFile.Read (), then n ames of
  18812                         entri es within  the zip ar chive woul d not be c orrectly r etrieved.
  18813                       
  18814        </para>
  18815                     
  18816                      
  18817        <code 
  18818         lang="C#"
  18819        >
  18820                       string  zipToExtra ct = "MyAr chive.zip" ;
  18821                       string  extractDir ectory = " extract";
  18822                       var opt ions = new  ReadOptio ns
  18823                       {
  18824                         Statu sMessageWr iter = Sys tem.Consol e.Out,
  18825                         Encod ing = Syst em.Text.En coding.Get Encoding(9 50)
  18826                       };
  18827                       using ( ZipFile zi p = ZipFil e.Read(zip ToExtract,  options))
  18828                       {
  18829                         forea ch (ZipEnt ry e in zi p)
  18830                         {
  18831                            e. Extract(ex tractDirec tory);
  18832                         }
  18833                       }
  18834                       
  18835        </code>
  18836                     
  18837                     
  18838                      
  18839        <code 
  18840         lang="VB"
  18841        >
  18842                       Dim zip ToExtract  as String  = "MyArchi ve.zip"
  18843                       Dim ext ractDirect ory as Str ing = "ext ract"
  18844                       Dim opt ions as Ne w ReadOpti ons
  18845                       options .Encoding  = System.T ext.Encodi ng.GetEnco ding(950)
  18846                       options .StatusMes sageWriter  = System. Console.Ou t
  18847                       Using z ip As ZipF ile = ZipF ile.Read(z ipToExtrac t, options )
  18848                           Dim  e As ZipE ntry
  18849                           For  Each e In  zip
  18850                            e. Extract(ex tractDirec tory)
  18851                           Nex t
  18852                       End Usi ng
  18853                       
  18854        </code>
  18855                      
  18856       </example>
  18857                    
  18858                    
  18859                     
  18860       <example>
  18861                     
  18862                      
  18863        <para>
  18864                         This  example sh ows how to  read a zi p file usi ng the def ault
  18865                         code  page, to r emove entr ies that h ave a modi fied date  before a g iven thres hold,
  18866                         sendi ng status  messages o ut to a 
  18867         <c>
  18868          StringWrit er
  18869         </c>
  18870         .
  18871                       
  18872        </para>
  18873                     
  18874                      
  18875        <code 
  18876         lang="C#"
  18877        >
  18878                       var opt ions = new  ReadOptio ns
  18879                       {
  18880                         Statu sMessageWr iter = new  System.IO .StringWri ter()
  18881                       };
  18882                       using ( ZipFile zi p =  ZipFi le.Read("P ackedDocum ents.zip",  options))
  18883                       {
  18884                         var T hreshold =  new DateT ime(2007,7 ,4);
  18885                         // We  cannot re move the e ntry from  the list,  within the  context o f
  18886                         // an  enumerati on of said  list.
  18887                         // So  we add th e doomed e ntry to a  list to be  removed l ater.
  18888                         // pa ss 1: mark  the entri es for rem oval
  18889                         var M arkedEntri es = new S ystem.Coll ections.Ge neric.List &lt;ZipEnt ry&gt;();
  18890                         forea ch (ZipEnt ry e in zi p)
  18891                         {
  18892                           if  (e.LastMod ified &lt;  Threshold )
  18893                             M arkedEntri es.Add(e);
  18894                         }
  18895                         // pa ss 2: actu ally remov e the entr y.
  18896                         forea ch (ZipEnt ry zombie  in MarkedE ntries)
  18897                            zi p.RemoveEn try(zombie );
  18898                         zip.C omment = " This archi ve has bee n updated. ";
  18899                         zip.S ave();
  18900                       }
  18901                       // can  now use co ntents of  sw, eg sto re in an a udit log
  18902                       
  18903        </code>
  18904                     
  18905                      
  18906        <code 
  18907         lang="VB"
  18908        >
  18909                       Dim opt ions as Ne w ReadOpti ons
  18910                       options .StatusMes sageWriter  = New Sys tem.IO.Str ingWriter
  18911                       Using z ip As ZipF ile = ZipF ile.Read(" PackedDocu ments.zip" , options)
  18912                           Dim  Threshold  As New Da teTime(200 7, 7, 4)
  18913                           ' W e cannot r emove the  entry from  the list,  within th e context  of
  18914                           ' a n enumerat ion of sai d list.
  18915                           ' S o we add t he doomed  entry to a  list to b e removed  later.
  18916                           ' p ass 1: mar k the entr ies for re moval
  18917                           Dim  MarkedEnt ries As Ne w System.C ollections .Generic.L ist(Of Zip Entry)
  18918                           Dim  e As ZipE ntry
  18919                           For  Each e In  zip
  18920                                If (e.Las tModified  &lt; Thres hold) Then
  18921                                    Marke dEntries.A dd(e)
  18922                                End If
  18923                           Nex t
  18924                           ' p ass 2: act ually remo ve the ent ry.
  18925                           Dim  zombie As  ZipEntry
  18926                           For  Each zomb ie In Mark edEntries
  18927                                zip.Remov eEntry(zom bie)
  18928                           Nex t
  18929                           zip .Comment =  "This arc hive has b een update d."
  18930                           zip .Save
  18931                       End Usi ng
  18932                       ' can n ow use con tents of s w, eg stor e in an au dit log
  18933                       
  18934        </code>
  18935                      
  18936       </example>
  18937                    
  18938                     
  18939       <exception  
  18940        cref="T:Sy stem.Excep tion"
  18941       >
  18942                        Throw n if the z ipfile can not be rea d. The imp lementatio n of
  18943                        this  method rel ies on 
  18944        <c>
  18945         System.IO. File.OpenR ead
  18946        </c>
  18947        , which
  18948                        can t hrow a var iety of ex ceptions,  including  specific
  18949                        excep tions if a  file is n ot found,  an unautho rized acce ss
  18950                        excep tion, exce ptions for  poorly fo rmatted fi lenames, a nd so
  18951                        on.
  18952                      
  18953       </exceptio n>
  18954                    
  18955                     
  18956       <param 
  18957        name="file Name"
  18958       >
  18959                      The nam e of the z ip archive  to open.
  18960                      This ca n be a ful ly-qualifi ed or rela tive pathn ame.
  18961                      
  18962       </param>
  18963                    
  18964                     
  18965       <param 
  18966        name="opti ons"
  18967       >
  18968                      The set  of option s to use w hen readin g the zip  file.
  18969                      
  18970       </param>
  18971                    
  18972                     
  18973       <returns>
  18974        The ZipFil e instance  read from  the zip a rchive.
  18975       </returns>
  18976                    
  18977                     
  18978       <seealso 
  18979        cref="M:Io nic.Zip.Zi pFile.Read (System.IO .Stream,Io nic.Zip.Re adOptions) "
  18980       />
  18981                    
  18982               
  18983      </member>
  18984              
  18985      <member 
  18986       name="M:Io nic.Zip.Zi pFile.Read (System.St ring,Syste m.IO.TextW riter,Syst em.Text.En coding,Sys tem.EventH andler{Ion ic.Zip.Rea dProgressE ventArgs}) "
  18987      >
  18988                     
  18989       <summary>
  18990                      Reads a  zip file  archive us ing the sp ecified te xt encodin g,  the sp ecified
  18991                      TextWri ter for st atus messa ges, and t he specifi ed ReadPro gress even t handler,
  18992                      and ret urns the i nstance.
  18993                      
  18994       </summary>
  18995                    
  18996                     
  18997       <param 
  18998        name="file Name"
  18999       >
  19000                      The nam e of the z ip archive  to open.
  19001                      This ca n be a ful ly-qualifi ed or rela tive pathn ame.
  19002                      
  19003       </param>
  19004                    
  19005                     
  19006       <param 
  19007        name="read Progress"
  19008       >
  19009                      An even t handler  for Read o perations.
  19010                      
  19011       </param>
  19012                    
  19013                     
  19014       <param 
  19015        name="stat usMessageW riter"
  19016       >
  19017                      The 
  19018        <c>
  19019         System.IO. TextWriter
  19020        </c>
  19021         to use fo r writing  verbose st atus messa ges
  19022                      during  operations  on the zi p archive.   A consol e applicat ion may wi sh to
  19023                      pass 
  19024        <c>
  19025         System.Con sole.Out
  19026        </c>
  19027         to get me ssages on  the Consol e. A graph ical
  19028                      or head less appli cation may  wish to c apture the  messages  in a diffe rent
  19029                      
  19030        <c>
  19031         TextWriter
  19032        </c>
  19033        , such as 
  19034        <c>
  19035         System.IO. StringWrit er
  19036        </c>
  19037        .
  19038                      
  19039       </param>
  19040                    
  19041                     
  19042       <param 
  19043        name="enco ding"
  19044       >
  19045                      The 
  19046        <c>
  19047         System.Tex t.Encoding
  19048        </c>
  19049         to use wh en reading  in the zi p archive.  Be
  19050                      careful  specifyin g the enco ding.  If  the value  you use he re is not  the same
  19051                      as the  Encoding u sed when t he zip arc hive was c reated (po ssibly by  a
  19052                      differe nt archive r) you wil l get unex pected res ults and p ossibly ex ceptions.
  19053                      
  19054       </param>
  19055                    
  19056                     
  19057       <returns>
  19058        The instan ce read fr om the zip  archive.
  19059       </returns>
  19060                    
  19061               
  19062      </member>
  19063              
  19064      <member 
  19065       name="M:Io nic.Zip.Zi pFile.Read (System.IO .Stream)"
  19066      >
  19067                     
  19068       <summary>
  19069                        Reads  a zip arc hive from  a stream.
  19070                      
  19071       </summary>
  19072                    
  19073                     
  19074       <remarks>
  19075                     
  19076                      
  19077        <para>
  19078                         When  reading fr om a file,  it's prob ably easie r to just  use
  19079                         
  19080         <see 
  19081          cref="M:Io nic.Zip.Zi pFile.Read (System.St ring,Ionic .Zip.ReadO ptions)"
  19082         >
  19083          ZipFile.Re ad(String,  ReadOptio ns)
  19084         </see>
  19085         .  This
  19086                         overl oad is use ful when w hen the zi p archive  content is
  19087                         avail able from  an already -open stre am. The st ream must  be
  19088                         open  and readab le and see kable when  calling t his method .  The
  19089                         strea m is left  open when  the readin g is compl eted.
  19090                       
  19091        </para>
  19092                     
  19093                      
  19094        <para>
  19095                         Using  this over load, the  stream is  read using  the defau lt
  19096                         
  19097         <c>
  19098          System.Tex t.Encoding
  19099         </c>
  19100         , which is  the 
  19101         <c>
  19102          IBM437
  19103         </c>
  19104                         codep age. If yo u want to  specify th e encoding  to use wh en
  19105                         readi ng the zip file conte nt, see
  19106                         
  19107         <see 
  19108          cref="M:Io nic.Zip.Zi pFile.Read (System.IO .Stream,Io nic.Zip.Re adOptions) "
  19109         >
  19110          ZipFile.Re ad(Stream,  ReadOptio ns)
  19111         </see>
  19112         .  This
  19113                       
  19114        </para>
  19115                     
  19116                      
  19117        <para>
  19118                         Readi ng of zip  content be gins at th e current  position i n the
  19119                         strea m.  This m eans if yo u have a s tream that  concatena tes
  19120                         regul ar data an d zip data , if you p osition th e open, re adable
  19121                         strea m at the s tart of th e zip data , you will  be able t o read
  19122                         the z ip archive  using thi s construc tor, or an y of the Z ipFile
  19123                         const ructors th at accept 
  19124         <see 
  19125          cref="T:Sy stem.IO.St ream"
  19126         />
  19127          as
  19128                         input . Some exa mples of w here this  might be u seful: the  zip
  19129                         conte nt is conc atenated a t the end  of a regul ar EXE fil e, as
  19130                         some  self-extra cting arch ives do.   (Note: SFX  files pro duced
  19131                         by Do tNetZip do  not work  this way;  they can b e read as  normal
  19132                         ZIP f iles). Ano ther examp le might b e a stream  being rea d from
  19133                         a dat abase, whe re the zip  content i s embedded  within an
  19134                         aggre gate strea m of data.
  19135                       
  19136        </para>
  19137                     
  19138                      
  19139       </remarks>
  19140                    
  19141                     
  19142       <example>
  19143                      
  19144        <para>
  19145                         This  example sh ows how to  Read zip  content fr om a strea m, and
  19146                         extra ct one ent ry into a  different  stream. In  this exam ple,
  19147                         the f ilename "N ameOfEntry InArchive. doc", refe rs only to  the
  19148                         name  of the ent ry within  the zip ar chive.  A  file by th at
  19149                         name  is not cre ated in th e filesyst em.  The I /O is done
  19150                         stric tly with t he given s treams.
  19151                       
  19152        </para>
  19153                     
  19154                      
  19155        <code>
  19156                       using ( ZipFile zi p = ZipFil e.Read(Inp utStream))
  19157                       {
  19158                          zip. Extract("N ameOfEntry InArchive. doc", Outp utStream);
  19159                       }
  19160                       
  19161        </code>
  19162                     
  19163                      
  19164        <code 
  19165         lang="VB"
  19166        >
  19167                       Using z ip as ZipF ile = ZipF ile.Read(I nputStream )
  19168                          zip. Extract("N ameOfEntry InArchive. doc", Outp utStream)
  19169                       End Usi ng
  19170                       
  19171        </code>
  19172                      
  19173       </example>
  19174                    
  19175                     
  19176       <param 
  19177        name="zipS tream"
  19178       >
  19179        the stream  containin g the zip  data.
  19180       </param>
  19181                    
  19182                     
  19183       <returns>
  19184        The ZipFil e instance  read from  the strea m
  19185       </returns>
  19186                    
  19187               
  19188      </member>
  19189              
  19190      <member 
  19191       name="M:Io nic.Zip.Zi pFile.Read (System.IO .Stream,Io nic.Zip.Re adOptions) "
  19192      >
  19193                     
  19194       <summary>
  19195                        Reads  a zip fil e archive  from the g iven strea m using th e
  19196                        speci fied optio ns.
  19197                      
  19198       </summary>
  19199                    
  19200                     
  19201       <remarks>
  19202                     
  19203                      
  19204        <para>
  19205                         When  reading fr om a file,  it's prob ably easie r to just  use
  19206                         
  19207         <see 
  19208          cref="M:Io nic.Zip.Zi pFile.Read (System.St ring,Ionic .Zip.ReadO ptions)"
  19209         >
  19210          ZipFile.Re ad(String,  ReadOptio ns)
  19211         </see>
  19212         .  This
  19213                         overl oad is use ful when w hen the zi p archive  content is
  19214                         avail able from  an already -open stre am. The st ream must  be
  19215                         open  and readab le and see kable when  calling t his method .  The
  19216                         strea m is left  open when  the readin g is compl eted.
  19217                       
  19218        </para>
  19219                     
  19220                      
  19221        <para>
  19222                         Readi ng of zip  content be gins at th e current  position i n the
  19223                         strea m.  This m eans if yo u have a s tream that  concatena tes
  19224                         regul ar data an d zip data , if you p osition th e open, re adable
  19225                         strea m at the s tart of th e zip data , you will  be able t o read
  19226                         the z ip archive  using thi s construc tor, or an y of the Z ipFile
  19227                         const ructors th at accept 
  19228         <see 
  19229          cref="T:Sy stem.IO.St ream"
  19230         />
  19231          as
  19232                         input . Some exa mples of w here this  might be u seful: the  zip
  19233                         conte nt is conc atenated a t the end  of a regul ar EXE fil e, as
  19234                         some  self-extra cting arch ives do.   (Note: SFX  files pro duced
  19235                         by Do tNetZip do  not work  this way;  they can b e read as  normal
  19236                         ZIP f iles). Ano ther examp le might b e a stream  being rea d from
  19237                         a dat abase, whe re the zip  content i s embedded  within an
  19238                         aggre gate strea m of data.
  19239                       
  19240        </para>
  19241                      
  19242       </remarks>
  19243                    
  19244                     
  19245       <param 
  19246        name="zipS tream"
  19247       >
  19248        the stream  containin g the zip  data.
  19249       </param>
  19250                    
  19251                     
  19252       <param 
  19253        name="opti ons"
  19254       >
  19255                        The s et of opti ons to use  when read ing the zi p file.
  19256                      
  19257       </param>
  19258                    
  19259                     
  19260       <exception  
  19261        cref="T:Sy stem.Excep tion"
  19262       >
  19263                        Throw n if the z ip archive  cannot be  read.
  19264                      
  19265       </exceptio n>
  19266                    
  19267                     
  19268       <returns>
  19269        The ZipFil e instance  read from  the strea m.
  19270       </returns>
  19271                    
  19272                     
  19273       <seealso 
  19274        cref="M:Io nic.Zip.Zi pFile.Read (System.St ring,Ionic .Zip.ReadO ptions)"
  19275       />
  19276                    
  19277               
  19278      </member>
  19279              
  19280      <member 
  19281       name="M:Io nic.Zip.Zi pFile.Read (System.IO .Stream,Sy stem.IO.Te xtWriter,S ystem.Text .Encoding, System.Eve ntHandler{ Ionic.Zip. ReadProgre ssEventArg s})"
  19282      >
  19283                     
  19284       <summary>
  19285                      Reads a  zip archi ve from a  stream, us ing the sp ecified te xt Encodin g, the
  19286                      specifi ed TextWri ter for st atus messa ges,
  19287                      and the  specified  ReadProgr ess event  handler.
  19288                      
  19289       </summary>
  19290                    
  19291                     
  19292       <remarks>
  19293                      
  19294        <para>
  19295                       Reading  of zip co ntent begi ns at the  current po sition in  the stream .  This
  19296                       means i f you have  a stream  that conca tenates re gular data  and zip d ata, if
  19297                       you pos ition the  open, read able strea m at the s tart of th e zip data , you
  19298                       will be  able to r ead the zi p archive  using this  construct or, or any  of the
  19299                       ZipFile  construct ors that a ccept a 
  19300         <see 
  19301          cref="T:Sy stem.IO.St ream"
  19302         />
  19303          as
  19304                       input.  Some examp les of whe re this mi ght be use ful: the z ip content  is
  19305                       concate nated at t he end of  a regular  EXE file,  as some se lf-extract ing
  19306                       archive s do.  (No te: SFX fi les produc ed by DotN etZip do n ot work th is
  19307                       way). A nother exa mple might  be a stre am being r ead from a  database,  where
  19308                       the zip  content i s embedded  within an  aggregate  stream of  data.
  19309                       
  19310        </para>
  19311                      
  19312       </remarks>
  19313                    
  19314                     
  19315       <param 
  19316        name="zipS tream"
  19317       >
  19318        the stream  containin g the zip  data.
  19319       </param>
  19320                    
  19321                     
  19322       <param 
  19323        name="stat usMessageW riter"
  19324       >
  19325                      The 
  19326        <c>
  19327         System.IO. TextWriter
  19328        </c>
  19329         to which  verbose st atus messa ges are wr itten
  19330                      during  operations  on the 
  19331        <c>
  19332         ZipFile
  19333        </c>
  19334        .  For exa mple, in a  console
  19335                      applica tion, Syst em.Console .Out works , and will  get a mes sage for e ach entry
  19336                      added t o the ZipF ile.  If t he TextWri ter is 
  19337        <c>
  19338         null
  19339        </c>
  19340        , no verbo se message s
  19341                      are wri tten.
  19342                      
  19343       </param>
  19344                    
  19345                     
  19346       <param 
  19347        name="enco ding"
  19348       >
  19349                      The tex t encoding  to use wh en reading  entries t hat do not  have the  UTF-8
  19350                      encodin g bit set.   Be caref ul specify ing the en coding.  I f the valu e you use
  19351                      here is  not the s ame as the  Encoding  used when  the zip ar chive was  created
  19352                      (possib ly by a di fferent ar chiver) yo u will get  unexpecte d results  and
  19353                      possibl y exceptio ns.  See t he 
  19354        <see 
  19355         cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  19356        />
  19357                      propert y for more  informati on.
  19358                      
  19359       </param>
  19360                    
  19361                     
  19362       <param 
  19363        name="read Progress"
  19364       >
  19365                      An even t handler  for Read o perations.
  19366                      
  19367       </param>
  19368                    
  19369                     
  19370       <returns>
  19371        an instanc e of ZipFi le
  19372       </returns>
  19373               
  19374      </member>
  19375              
  19376      <member 
  19377       name="M:Io nic.Zip.Zi pFile.IsZi pFile(Syst em.String) "
  19378      >
  19379                     
  19380       <summary>
  19381                      Checks  the given  file to se e if it ap pears to b e a valid  zip file.
  19382                      
  19383       </summary>
  19384                     
  19385       <remarks>
  19386                     
  19387                      
  19388        <para>
  19389                         Calli ng this me thod is eq uivalent t o calling 
  19390         <see 
  19391          cref="M:Io nic.Zip.Zi pFile.IsZi pFile(Syst em.String, System.Boo lean)"
  19392         />
  19393          with the  testExtrac t paramete r set to f alse.
  19394                       
  19395        </para>
  19396                      
  19397       </remarks>
  19398                    
  19399                     
  19400       <param 
  19401        name="file Name"
  19402       >
  19403        The file t o check.
  19404       </param>
  19405                     
  19406       <returns>
  19407        true if th e file app ears to be  a zip fil e.
  19408       </returns>
  19409               
  19410      </member>
  19411              
  19412      <member 
  19413       name="M:Io nic.Zip.Zi pFile.IsZi pFile(Syst em.String, System.Boo lean)"
  19414      >
  19415                     
  19416       <summary>
  19417                      Checks  a file to  see if it  is a valid  zip file.
  19418                      
  19419       </summary>
  19420                    
  19421                     
  19422       <remarks>
  19423                      
  19424        <para>
  19425                         This  method ope ns the spe cified zip  file, rea ds in the  zip archiv e,
  19426                         verif ying the Z IP metadat a as it re ads.
  19427                       
  19428        </para>
  19429                     
  19430                      
  19431        <para>
  19432                         If ev erything s ucceeds, t hen the me thod retur ns true.   If anythin g fails -
  19433                         for e xample if  an incorre ct signatu re or CRC  is found,  indicating  a
  19434                         corru pt file, t he the met hod return s false.   This metho d also ret urns
  19435                         false  for a fil e that doe s not exis t.
  19436                       
  19437        </para>
  19438                     
  19439                      
  19440        <para>
  19441                         If 
  19442         <paramref 
  19443          name="test Extract"
  19444         />
  19445          is true,  as part of  its check , this
  19446                         metho d reads in  the conte nt for eac h entry, e xpands it,  and check s CRCs.
  19447                         This  provides a n addition al check b eyond veri fying the  zip header  and
  19448                         direc tory data.
  19449                       
  19450        </para>
  19451                     
  19452                      
  19453        <para>
  19454                         If 
  19455         <paramref 
  19456          name="test Extract"
  19457         />
  19458          is true,  and if any  of the zi p entries
  19459                         are p rotected w ith a pass word, this  method wi ll return  false.  If  you want
  19460                         to ve rify a 
  19461         <c>
  19462          ZipFile
  19463         </c>
  19464          that has  entries wh ich are pr otected wi th a
  19465                         passw ord, you w ill need t o do that  manually.
  19466                       
  19467        </para>
  19468                     
  19469                      
  19470       </remarks>
  19471                    
  19472                     
  19473       <param 
  19474        name="file Name"
  19475       >
  19476        The zip fi le to chec k.
  19477       </param>
  19478                     
  19479       <param 
  19480        name="test Extract"
  19481       >
  19482        true if th e caller w ants to ex tract each  entry.
  19483       </param>
  19484                     
  19485       <returns>
  19486        true if th e file con tains a va lid zip fi le.
  19487       </returns>
  19488               
  19489      </member>
  19490              
  19491      <member 
  19492       name="M:Io nic.Zip.Zi pFile.IsZi pFile(Syst em.IO.Stre am,System. Boolean)"
  19493      >
  19494                     
  19495       <summary>
  19496                      Checks  a stream t o see if i t contains  a valid z ip archive .
  19497                      
  19498       </summary>
  19499                    
  19500                     
  19501       <remarks>
  19502                      
  19503        <para>
  19504                       This me thod reads  the zip a rchive con tained in  the specif ied stream , verifyin g
  19505                       the ZIP  metadata  as it read s.  If tes tExtract i s true, th is method  also extra cts
  19506                       each en try in the  archive,  dumping al l the bits  into 
  19507         <see 
  19508          cref="F:Sy stem.IO.St ream.Null"
  19509         />
  19510         .
  19511                       
  19512        </para>
  19513                     
  19514                      
  19515        <para>
  19516                       If ever ything suc ceeds, the n the meth od returns  true.  If  anything  fails -
  19517                       for exa mple if an  incorrect  signature  or CRC is  found, in dicating a  corrupt
  19518                       file, t he the met hod return s false.   This metho d also ret urns false  for a
  19519                       file th at does no t exist.
  19520                       
  19521        </para>
  19522                     
  19523                      
  19524        <para>
  19525                       If 
  19526         <c>
  19527          testExtrac t
  19528         </c>
  19529          is true,  this metho d reads in  the conte nt for eac h
  19530                       entry,  expands it , and chec ks CRCs.   This provi des an add itional ch eck
  19531                       beyond  verifying  the zip he ader data.
  19532                       
  19533        </para>
  19534                     
  19535                      
  19536        <para>
  19537                       If 
  19538         <c>
  19539          testExtrac t
  19540         </c>
  19541          is true,  and if any  of the zi p entries  are protec ted
  19542                       with a  password,  this metho d will ret urn false.   If you w ant to ver ify a
  19543                       ZipFile  that has  entries wh ich are pr otected wi th a passw ord, you w ill need
  19544                       to do t hat manual ly.
  19545                       
  19546        </para>
  19547                      
  19548       </remarks>
  19549                    
  19550                     
  19551       <seealso 
  19552        cref="M:Io nic.Zip.Zi pFile.IsZi pFile(Syst em.String, System.Boo lean)"
  19553       />
  19554                    
  19555                     
  19556       <param 
  19557        name="stre am"
  19558       >
  19559        The stream  to check.
  19560       </param>
  19561                     
  19562       <param 
  19563        name="test Extract"
  19564       >
  19565        true if th e caller w ants to ex tract each  entry.
  19566       </param>
  19567                     
  19568       <returns>
  19569        true if th e stream c ontains a  valid zip  archive.
  19570       </returns>
  19571               
  19572      </member>
  19573              
  19574      <member 
  19575       name="M:Io nic.Zip.Zi pFile.Dele teFileWith Retry(Syst em.String) "
  19576      >
  19577                     
  19578       <summary>
  19579                        Delet e file wit h retry on  Unauthori zedAccessE xception.
  19580                      
  19581       </summary>
  19582                    
  19583                     
  19584       <remarks>
  19585                        
  19586        <para>
  19587                           Whe n calling  File.Delet e() on a f ile that h as been "r ecently"
  19588                           cre ated, the  call somet imes fails  with
  19589                           Una uthorizedA ccessExcep tion. This  method si mply retri es the Del ete 3
  19590                           tim es with a  sleep betw een tries.
  19591                         
  19592        </para>
  19593                      
  19594       </remarks>
  19595                    
  19596                     
  19597       <param 
  19598        name='file name'
  19599       >
  19600        the name o f the file  to be del eted
  19601       </param>
  19602               
  19603      </member>
  19604              
  19605      <member 
  19606       name="M:Io nic.Zip.Zi pFile.Save "
  19607      >
  19608                     
  19609       <summary>
  19610                        Saves  the Zip a rchive to  a file, sp ecified by  the Name  property o f the
  19611                        
  19612        <c>
  19613         ZipFile
  19614        </c>
  19615        .
  19616                      
  19617       </summary>
  19618                    
  19619                     
  19620       <remarks>
  19621                      
  19622        <para>
  19623                         The 
  19624         <c>
  19625          ZipFile
  19626         </c>
  19627          instance  is written  to storag e, typical ly a zip f ile
  19628                         in a  filesystem , only whe n the call er calls 
  19629         <c>
  19630          Save
  19631         </c>
  19632         .  In the  typical
  19633                         case,  the Save  operation  writes the  zip conte nt to a te mporary fi le, and
  19634                         then  renames th e temporar y file to  the desire d name. If  necessary , this
  19635                         metho d will del ete a pre- existing f ile before  the renam e.
  19636                       
  19637        </para>
  19638                     
  19639                      
  19640        <para>
  19641                         The 
  19642         <see 
  19643          cref="P:Io nic.Zip.Zi pFile.Name "
  19644         />
  19645          property  is specifi ed either  explicitly ,
  19646                         or im plicitly u sing one o f the para meterized  ZipFile co nstructors .  For
  19647                         COM A utomation  clients, t he 
  19648         <c>
  19649          Name
  19650         </c>
  19651          property  must be se t explicit ly,
  19652                         becau se COM Aut omation cl ients cann ot call pa rameterize d construc tors.
  19653                       
  19654        </para>
  19655                     
  19656                      
  19657        <para>
  19658                         When  using a fi lesystem f ile for th e Zip outp ut, it is  possible t o call
  19659                         
  19660         <c>
  19661          Save
  19662         </c>
  19663          multiple  times on t he 
  19664         <c>
  19665          ZipFile
  19666         </c>
  19667          instance.  With each
  19668                         call  the zip co ntent is r e-written  to the sam e output f ile.
  19669                       
  19670        </para>
  19671                     
  19672                      
  19673        <para>
  19674                         Data  for entrie s that hav e been add ed to the 
  19675         <c>
  19676          ZipFile
  19677         </c>
  19678          instance  is
  19679                         writt en to the  output whe n the 
  19680         <c>
  19681          Save
  19682         </c>
  19683          method is  called. T his means
  19684                         that  the input  streams fo r those en tries must  be availa ble at the  time
  19685                         the a pplication  calls 
  19686         <c>
  19687          Save
  19688         </c>
  19689         .  If, for  example,  the applic ation
  19690                         adds  entries wi th 
  19691         <c>
  19692          AddEntry
  19693         </c>
  19694          using a d ynamically -allocated
  19695                         
  19696         <c>
  19697          MemoryStre am
  19698         </c>
  19699         , the memo ry stream  must not h ave been d isposed
  19700                         befor e the call  to 
  19701         <c>
  19702          Save
  19703         </c>
  19704         . See the 
  19705         <see 
  19706          cref="P:Io nic.Zip.Zi pEntry.Inp utStream"
  19707         />
  19708          property  for more d iscussion  of the
  19709                         avail ability re quirements  of the in put stream  for an en try, and a n
  19710                         appro ach for pr oviding ju st-in-time  stream li fecycle ma nagement.
  19711                       
  19712        </para>
  19713                     
  19714                      
  19715       </remarks>
  19716                    
  19717                     
  19718       <seealso 
  19719        cref="M:Io nic.Zip.Zi pFile.AddE ntry(Syste m.String,S ystem.IO.S tream)"
  19720       />
  19721                    
  19722                     
  19723       <exception  
  19724        cref="T:Io nic.Zip.Ba dStateExce ption"
  19725       >
  19726                        Throw n if you h aven't spe cified a l ocation or  stream fo r saving t he zip,
  19727                        eithe r in the c onstructor  or by set ting the N ame proper ty, or if  you try
  19728                        to sa ve a regul ar zip arc hive to a  filename w ith a .exe  extension .
  19729                      
  19730       </exceptio n>
  19731                    
  19732                     
  19733       <exception  
  19734        cref="T:Sy stem.Overf lowExcepti on"
  19735       >
  19736                        Throw n if 
  19737        <see 
  19738         cref="P:Io nic.Zip.Zi pFile.MaxO utputSegme ntSize"
  19739        />
  19740         is non-ze ro, and th e number
  19741                        of se gments tha t would be  generated  for the s panned zip  file duri ng the
  19742                        save  operation  exceeds 99 .  If this  happens,  you need t o increase  the
  19743                        segme nt size.
  19744                      
  19745       </exceptio n>
  19746                    
  19747               
  19748      </member>
  19749              
  19750      <member 
  19751       name="M:Io nic.Zip.Zi pFile.Save (System.St ring)"
  19752      >
  19753                     
  19754       <summary>
  19755                      Save th e file to  a new zipf ile, with  the given  name.
  19756                      
  19757       </summary>
  19758                    
  19759                     
  19760       <remarks>
  19761                      
  19762        <para>
  19763                       This me thod allow s the appl ication to  explicitl y specify  the name o f the zip
  19764                       file wh en saving.  Use this  when creat ing a new  zip file,  or when
  19765                       updatin g a zip ar chive.
  19766                       
  19767        </para>
  19768                     
  19769                      
  19770        <para>
  19771                       An appl ication ca n also sav e a zip ar chive in s everal pla ces by cal ling this
  19772                       method  multiple t imes in su ccession,  with diffe rent filen ames.
  19773                       
  19774        </para>
  19775                     
  19776                      
  19777        <para>
  19778                       The 
  19779         <c>
  19780          ZipFile
  19781         </c>
  19782          instance  is written  to storag e, typical ly a zip f ile in a
  19783                       filesys tem, only  when the c aller call
  19784         <c>
  19785          Save
  19786         </c>
  19787         .  The Sav e operatio n writes
  19788                       the zip  content t o a tempor ary file,  and then r enames the  temporary  file
  19789                       to the  desired na me. If nec essary, th is method  will delet e a pre-ex isting fil e
  19790                       before  the rename .
  19791                       
  19792        </para>
  19793                     
  19794                      
  19795       </remarks>
  19796                    
  19797                     
  19798       <exception  
  19799        cref="T:Sy stem.Argum entExcepti on"
  19800       >
  19801                      Thrown  if you spe cify a dir ectory for  the filen ame.
  19802                      
  19803       </exceptio n>
  19804                    
  19805                     
  19806       <param 
  19807        name="file Name"
  19808       >
  19809                      The nam e of the z ip archive  to save t o. Existin g files wi ll
  19810                      be over written wi th great p rejudice.
  19811                      
  19812       </param>
  19813                    
  19814                     
  19815       <example>
  19816                      This ex ample show s how to c reate and  Save a zip  file.
  19817                      
  19818        <code>
  19819                       using ( ZipFile zi p = new Zi pFile())
  19820                       {
  19821                         zip.A ddDirector y(@"c:\rep orts\Janua ry");
  19822                         zip.S ave("Janua ry.zip");
  19823                       }
  19824                       
  19825        </code>
  19826                     
  19827                      
  19828        <code 
  19829         lang="VB"
  19830        >
  19831                       Using z ip As New  ZipFile()
  19832                         zip.A ddDirector y("c:\repo rts\Januar y")
  19833                         zip.S ave("Janua ry.zip")
  19834                       End Usi ng
  19835                       
  19836        </code>
  19837                     
  19838                      
  19839       </example>
  19840                    
  19841                     
  19842       <example>
  19843                      This ex ample show s how to u pdate a zi p file.
  19844                      
  19845        <code>
  19846                       using ( ZipFile zi p = ZipFil e.Read("Ex istingArch ive.zip"))
  19847                       {
  19848                         zip.A ddFile("Ne wData.csv" );
  19849                         zip.S ave("Updat edArchive. zip");
  19850                       }
  19851                       
  19852        </code>
  19853                     
  19854                      
  19855        <code 
  19856         lang="VB"
  19857        >
  19858                       Using z ip As ZipF ile = ZipF ile.Read(" ExistingAr chive.zip" )
  19859                         zip.A ddFile("Ne wData.csv" )
  19860                         zip.S ave("Updat edArchive. zip")
  19861                       End Usi ng
  19862                       
  19863        </code>
  19864                     
  19865                      
  19866       </example>
  19867               
  19868      </member>
  19869              
  19870      <member 
  19871       name="M:Io nic.Zip.Zi pFile.Save (System.IO .Stream)"
  19872      >
  19873                     
  19874       <summary>
  19875                        Save  the zip ar chive to t he specifi ed stream.
  19876                      
  19877       </summary>
  19878                    
  19879                     
  19880       <remarks>
  19881                      
  19882        <para>
  19883                         The 
  19884         <c>
  19885          ZipFile
  19886         </c>
  19887          instance  is written  to storag e - typica lly a zip  file
  19888                         in a  filesystem , but usin g this ove rload, the  storage c an be anyt hing
  19889                         acces sible via  a writable  stream -  only when  the caller  calls 
  19890         <c>
  19891          Save
  19892         </c>
  19893         .
  19894                       
  19895        </para>
  19896                     
  19897                      
  19898        <para>
  19899                         Use t his method  to save t he zip con tent to a  stream dir ectly.  A  common
  19900                         scena rio is an  ASP.NET ap plication  that dynam ically gen erates a z ip file
  19901                         and a llows the  browser to  download  it. The ap plication  can call
  19902                         
  19903         <c>
  19904          Save(Respo nse.Output Stream)
  19905         </c>
  19906          to write  a zipfile  directly t o the
  19907                         outpu t stream,  without cr eating a z ip file on  the disk  on the ASP .NET
  19908                         serve r.
  19909                       
  19910        </para>
  19911                     
  19912                      
  19913        <para>
  19914                         Be ca reful when  saving a  file to a  non-seekab le stream,  including
  19915                         
  19916         <c>
  19917          Response.O utputStrea m
  19918         </c>
  19919         . When Dot NetZip wri tes to a n on-seekabl e
  19920                         strea m, the zip  archive i s formatte d in such  a way that  may not b e
  19921                         compa tible with  all zip t ools on al l platform s.  It's a  perfectly  legal
  19922                         and c ompliant z ip file, b ut some pe ople have  reported p roblems op ening
  19923                         files  produced  this way u sing the M ac OS arch ive utilit y.
  19924                       
  19925        </para>
  19926                     
  19927                      
  19928       </remarks>
  19929                    
  19930                     
  19931       <example>
  19932                     
  19933                        This  example sa ves the zi pfile cont ent into a  MemoryStr eam, and
  19934                        then  gets the a rray of by tes from t hat Memory Stream.
  19935                     
  19936                      
  19937        <code 
  19938         lang="C#"
  19939        >
  19940                       using ( var zip =  new Ionic. Zip.ZipFil e())
  19941                       {
  19942                           zip .Compressi onLevel= I onic.Zlib. Compressio nLevel.Bes tCompressi on;
  19943                           zip .Password  = "VerySec ret.";
  19944                           zip .Encryptio n = Encryp tionAlgori thm.WinZip Aes128;
  19945                           zip .AddFile(s ourceFileN ame);
  19946                           Mem oryStream  output = n ew MemoryS tream();
  19947                           zip .Save(outp ut);
  19948                      
  19949                           byt e[] zipbyt es = outpu t.ToArray( );
  19950                       }
  19951                       
  19952        </code>
  19953                      
  19954       </example>
  19955                    
  19956                     
  19957       <example>
  19958                      
  19959        <para>
  19960                         This  example sh ows a pitf all you sh ould avoid . DO NOT r ead
  19961                         from  a stream,  then try t o save to  the same s tream.  DO
  19962                         NOT D O THIS:
  19963                       
  19964        </para>
  19965                     
  19966                      
  19967        <code 
  19968         lang="C#"
  19969        >
  19970                       using ( var fs = n ew FileSte eam(filena me, FileMo de.Open))
  19971                       {
  19972                         using  (var zip  = Ionic.Zi p.ZipFile. Read(input Stream))
  19973                         {
  19974                           zip .AddEntry( "Name1.txt ", "this i s the cont ent");
  19975                           zip .Save(inpu tStream);   // NO NO  NO!!
  19976                         }
  19977                       }
  19978                       
  19979        </code>
  19980                     
  19981                      
  19982        <para>
  19983                         Bette r like thi s:
  19984                       
  19985        </para>
  19986                     
  19987                      
  19988        <code 
  19989         lang="C#"
  19990        >
  19991                       using ( var zip =  Ionic.Zip. ZipFile.Re ad(filenam e))
  19992                       {
  19993                           zip .AddEntry( "Name1.txt ", "this i s the cont ent");
  19994                           zip .Save();   // YES!
  19995                       }
  19996                       
  19997        </code>
  19998                     
  19999                      
  20000       </example>
  20001                    
  20002                     
  20003       <param 
  20004        name="outp utStream"
  20005       >
  20006                        The 
  20007        <c>
  20008         System.IO. Stream
  20009        </c>
  20010         to write  to. It mus t be
  20011                        writa ble. If yo u created  the ZipFil e instanct  by callin g
  20012                        ZipFi le.Read(),  this stre am must no t be the s ame stream
  20013                        you p assed to Z ipFile.Rea d().
  20014                      
  20015       </param>
  20016               
  20017      </member>
  20018              
  20019      <member 
  20020       name="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String)"
  20021      >
  20022                     
  20023       <summary>
  20024                        Adds  to the Zip File a set  of files  from the c urrent wor king direc tory on
  20025                        disk,  that conf orm to the  specified  criteria.
  20026                      
  20027       </summary>
  20028                    
  20029                     
  20030       <remarks>
  20031                      
  20032        <para>
  20033                         This  method sel ects files  from the  the curren t working  directory  matching
  20034                         the s pecified c riteria, a nd adds th em to the  ZipFile.
  20035                       
  20036        </para>
  20037                     
  20038                      
  20039        <para>
  20040                         Speci fy the cri teria in s tatements  of 3 eleme nts: a nou n, an oper ator, and
  20041                         a val ue.  Consi der the st ring "name  != *.doc"  .  The no un is "nam e".  The
  20042                         opera tor is "!= ", implyin g "Not Equ al".  The  value is " *.doc".  T hat
  20043                         crite rion, in E nglish, sa ys "all fi les with a  name that  does not  end in
  20044                         the . doc extens ion."
  20045                       
  20046        </para>
  20047                     
  20048                      
  20049        <para>
  20050                         Suppo rted nouns  include " name" (or  "filename" ) for the  filename;  "atime",
  20051                         "mtim e", and "c time" for  last acces s time, la st modfied  time, and  created
  20052                         time  of the fil e, respect ively; "at tributes"  (or "attrs ") for the  file
  20053                         attri butes; "si ze" (or "l ength") fo r the file  length (u ncompresse d), and
  20054                         "type " for the  type of ob ject, eith er a file  or a direc tory.  The
  20055                         "attr ibutes", " name" and  "type" nou ns both su pport = an d != as op erators.
  20056                         The " size", "at ime", "mti me", and " ctime" nou ns support  = and !=,  and
  20057                         &gt;,  &gt;=, &l t;, &lt;=  as well. T he times a re taken t o be expre ssed in
  20058                         local  time.
  20059                       
  20060        </para>
  20061                     
  20062                      
  20063        <para>
  20064                       Specify  values fo r the file  attribute s as a str ing with o ne or more  of the
  20065                       charact ers H,R,S, A,I,L in a ny order,  implying f ile attrib utes of Hi dden,
  20066                       ReadOnl y, System,  Archive,  NotContext Indexed, a nd Reparse Point (sym bolic
  20067                       link) r espectivel y.
  20068                       
  20069        </para>
  20070                     
  20071                      
  20072        <para>
  20073                       To spec ify a time , use YYYY -MM-DD-HH: mm:ss or Y YYY/MM/DD- HH:mm:ss a s the
  20074                       format.   If you o mit the HH :mm:ss por tion, it i s assumed  to be 00:0 0:00
  20075                       (midnig ht).
  20076                       
  20077        </para>
  20078                     
  20079                      
  20080        <para>
  20081                       The val ue for a s ize criter ion is exp ressed in  integer qu antities o f bytes,
  20082                       kilobyt es (use k  or kb afte r the numb er), megab ytes (m or  mb), or g igabytes
  20083                       (g or g b).
  20084                       
  20085        </para>
  20086                     
  20087                      
  20088        <para>
  20089                       The val ue for a n ame is a p attern to  match agai nst the fi lename, po tentially
  20090                       includi ng wildcar ds.  The p attern fol lows CMD.e xe glob ru les: * imp lies one
  20091                       or more  of any ch aracter, w hile ?  im plies one  character.   If the n ame
  20092                       pattern  contains  any slashe s, it is m atched to  the entire  filename,
  20093                       includi ng the pat h; otherwi se, it is  matched ag ainst only  the filen ame
  20094                       without  the path.   This mea ns a patte rn of "*\* .*" matche s all file s one
  20095                       directo ry level d eep, while  a pattern  of "*.*"  matches al l files in  all
  20096                       directo ries.
  20097                       
  20098        </para>
  20099                     
  20100                      
  20101        <para>
  20102                       To spec ify a name  pattern t hat includ es spaces,  use singl e quotes a round the
  20103                       pattern .  A patte rn of "'*  *.*'" will  match all  files tha t have spa ces in
  20104                       the fil ename.  Th e full cri teria stri ng for tha t would be  "name = ' * *.*'" .
  20105                       
  20106        </para>
  20107                     
  20108                      
  20109        <para>
  20110                       The val ue for a t ype criter ion is eit her F (imp lying a fi le) or D ( implying
  20111                       a direc tory).
  20112                       
  20113        </para>
  20114                     
  20115                      
  20116        <para>
  20117                       Some ex amples:
  20118                       
  20119        </para>
  20120                     
  20121                      
  20122        <list 
  20123         type="tabl e"
  20124        >
  20125                         
  20126         <listheade r>
  20127                            
  20128          <term>
  20129           criteria
  20130          </term>
  20131                            
  20132          <descripti on>
  20133           Files retr ieved
  20134          </descript ion>
  20135                          
  20136         </listhead er>
  20137                      
  20138                         
  20139         <item>
  20140                            
  20141          <term>
  20142           name != *. xls 
  20143          </term>
  20144                            
  20145          <descripti on>
  20146           any file w ith an ext ension tha t is not . xls
  20147                             
  20148          </descript ion>
  20149                          
  20150         </item>
  20151                      
  20152                         
  20153         <item>
  20154                            
  20155          <term>
  20156           name = *.m p3 
  20157          </term>
  20158                            
  20159          <descripti on>
  20160           any file w ith a .mp3  extension .
  20161                             
  20162          </descript ion>
  20163                          
  20164         </item>
  20165                      
  20166                         
  20167         <item>
  20168                            
  20169          <term>
  20170           *.mp3
  20171          </term>
  20172                            
  20173          <descripti on>
  20174           (same as a bove) any  file with  a .mp3 ext ension.
  20175                             
  20176          </descript ion>
  20177                          
  20178         </item>
  20179                      
  20180                         
  20181         <item>
  20182                            
  20183          <term>
  20184           attributes  = A 
  20185          </term>
  20186                            
  20187          <descripti on>
  20188           all files  whose attr ibutes inc lude the A rchive bit .
  20189                             
  20190          </descript ion>
  20191                          
  20192         </item>
  20193                      
  20194                         
  20195         <item>
  20196                            
  20197          <term>
  20198           attributes  != H 
  20199          </term>
  20200                            
  20201          <descripti on>
  20202           all files  whose attr ibutes do  not includ e the Hidd en bit.
  20203                             
  20204          </descript ion>
  20205                          
  20206         </item>
  20207                      
  20208                         
  20209         <item>
  20210                            
  20211          <term>
  20212           mtime > 20 09-01-01
  20213          </term>
  20214                            
  20215          <descripti on>
  20216           all files  with a las t modified  time afte r January  1st, 2009.
  20217                             
  20218          </descript ion>
  20219                          
  20220         </item>
  20221                      
  20222                         
  20223         <item>
  20224                            
  20225          <term>
  20226           size > 2gb
  20227          </term>
  20228                            
  20229          <descripti on>
  20230           all files  whose unco mpressed s ize is gre ater than  2gb.
  20231                             
  20232          </descript ion>
  20233                          
  20234         </item>
  20235                      
  20236                         
  20237         <item>
  20238                            
  20239          <term>
  20240           type = D
  20241          </term>
  20242                            
  20243          <descripti on>
  20244           all direct ories in t he filesys tem. 
  20245          </descript ion>
  20246                          
  20247         </item>
  20248                      
  20249                       
  20250        </list>
  20251                     
  20252                      
  20253        <para>
  20254                       You can  combine c riteria wi th the con junctions  AND or OR.  Using a s tring
  20255                       like "n ame = *.tx t AND size  &gt;= 100 k" for the  selection Criteria r etrieves
  20256                       entries  whose nam es end in  .txt, and  whose unco mpressed s ize is gre ater than
  20257                       or equa l to 100 k ilobytes.
  20258                       
  20259        </para>
  20260                     
  20261                      
  20262        <para>
  20263                       For mor e complex  combinatio ns of crit eria, you  can use pa renthesis  to group
  20264                       clauses  in the bo olean logi c.  Withou t parenthe sis, the p recedence  of the
  20265                       criteri on atoms i s determin ed by orde r of appea rance.  Un like the C #
  20266                       languag e, the AND  conjuncti on does no t take pre cendence o ver the lo gical OR.
  20267                       This is  important  only in s trings tha t contain  3 or more  criterion  atoms.
  20268                       In othe r words, " name = *.t xt and siz e &gt; 100 0 or attri butes = H"  implies
  20269                       "((name  = *.txt A ND size &g t; 1000) O R attribut es = H)" w hile "attr ibutes =
  20270                       H OR na me = *.txt  and size  &gt; 1000"  evaluates  to "((att ributes =  H OR name
  20271                       = *.txt ) AND size  &gt; 1000 )".  When  in doubt,  use parent hesis.
  20272                       
  20273        </para>
  20274                     
  20275                      
  20276        <para>
  20277                       Using t ime proper ties requi res some e xtra care.  If you wa nt to retr ieve all
  20278                       entries  that were  last upda ted on 200 9 February  14, speci fy a time  range
  20279                       like so :"mtime &g t;= 2009-0 2-14 AND m time &lt;  2009-02-15 ".  Read t his to
  20280                       say: al l files up dated afte r 12:00am  on Februar y 14th, un til 12:00a m on
  20281                       Februar y 15th.  Y ou can use  the same  bracketing  approach  to specify  any time
  20282                       period  - a year,  a month, a  week, and  so on.
  20283                       
  20284        </para>
  20285                     
  20286                      
  20287        <para>
  20288                       The syn tax allows  one speci al case: i f you prov ide a stri ng with no  spaces, i t is
  20289                       treated  as a patt ern to mat ch for the  filename.   Therefor e a string  like "*.x ls"
  20290                       will be  equivalen t to speci fying "nam e = *.xls" .
  20291                       
  20292        </para>
  20293                     
  20294                      
  20295        <para>
  20296                       There i s no logic  in this m ethod that  insures t hat the fi le inclusi on
  20297                       criteri a are inte rnally con sistent.   For exampl e, it's po ssible to  specify
  20298                       criteri a that say s the file  must have  a size of  less than  100 bytes , as well
  20299                       as a si ze that is  greater t han 1000 b ytes. Obvi ously no f ile will e ver
  20300                       satisfy  such crit eria, but  this metho d does not  detect su ch logical
  20301                       inconsi stencies.  The caller  is respon sible for  insuring t he criteri a are
  20302                       sensibl e.
  20303                       
  20304        </para>
  20305                     
  20306                      
  20307        <para>
  20308                         Using  this meth od, the fi le selecti on does no t recurse  into
  20309                         subdi rectories,  and the f ull path o f the sele cted files  is includ ed in the
  20310                         entri es added i nto the zi p archive.   If you d on't like  these beha viors,
  20311                         see t he other o verloads o f this met hod.
  20312                       
  20313        </para>
  20314                      
  20315       </remarks>
  20316                    
  20317                     
  20318       <example>
  20319                      This ex ample zips  up all *. csv files  in the cur rent worki ng directo ry.
  20320                      
  20321        <code>
  20322                       using ( ZipFile zi p = new Zi pFile())
  20323                       {
  20324                           //  To just ma tch on fil ename wild cards,
  20325                           //  use the sh orthand fo rm of the  selectionC riteria st ring.
  20326                           zip .AddSelect edFiles("* .csv");
  20327                           zip .Save(Path ToZipArchi ve);
  20328                       }
  20329                       
  20330        </code>
  20331                      
  20332        <code 
  20333         lang="VB"
  20334        >
  20335                       Using z ip As ZipF ile = New  ZipFile()
  20336                           zip .AddSelect edFiles("* .csv")
  20337                           zip .Save(Path ToZipArchi ve)
  20338                       End Usi ng
  20339                       
  20340        </code>
  20341                      
  20342       </example>
  20343                    
  20344                     
  20345       <param 
  20346        name="sele ctionCrite ria"
  20347       >
  20348        The criter ia for fil e selectio n
  20349       </param>
  20350               
  20351      </member>
  20352              
  20353      <member 
  20354       name="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String,Sys tem.Boolea n)"
  20355      >
  20356                     
  20357       <summary>
  20358                        Adds  to the Zip File a set  of files  from the d isk that c onform to  the
  20359                        speci fied crite ria, optio nally recu rsing into  subdirect ories.
  20360                      
  20361       </summary>
  20362                    
  20363                     
  20364       <remarks>
  20365                      
  20366        <para>
  20367                         This  method sel ects files  from the  the curren t working  directory  matching
  20368                         the s pecified c riteria, a nd adds th em to the  ZipFile.   If
  20369                         
  20370         <c>
  20371          recurseDir ectories
  20372         </c>
  20373          is true,  files are  also selec ted from
  20374                         subdi rectories,  and the d irectory s tructure i n the file system is
  20375                         repro duced in t he zip arc hive, root ed at the  current wo rking dire ctory.
  20376                       
  20377        </para>
  20378                     
  20379                      
  20380        <para>
  20381                         Using  this meth od, the fu ll path of  the selec ted files  is include d in the
  20382                         entri es added i nto the zi p archive.   If you d on't want  this behav ior, use
  20383                         one o f the over loads of t his method  that allo ws the spe cification  of a
  20384                         
  20385         <c>
  20386          directoryI nArchive
  20387         </c>
  20388         .
  20389                       
  20390        </para>
  20391                     
  20392                      
  20393        <para>
  20394                         For d etails on  the syntax  for the s electionCr iteria par ameter, se
  20395         <see 
  20396          cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String)"
  20397         />
  20398         .
  20399                       
  20400        </para>
  20401                     
  20402                      
  20403       </remarks>
  20404                    
  20405                     
  20406       <example>
  20407                     
  20408                        This  example zi ps up all  *.xml file s in the c urrent wor king direc tory, or a ny
  20409                        subdi rectory, t hat are la rger than  1mb.
  20410                     
  20411                      
  20412        <code>
  20413                       using ( ZipFile zi p = new Zi pFile())
  20414                       {
  20415                           //  Use a comp ound expre ssion in t he selecti onCriteria  string.
  20416                           zip .AddSelect edFiles("n ame = *.xm l  and  si ze &gt; 10 24kb", tru e);
  20417                           zip .Save(Path ToZipArchi ve);
  20418                       }
  20419                       
  20420        </code>
  20421                      
  20422        <code 
  20423         lang="VB"
  20424        >
  20425                       Using z ip As ZipF ile = New  ZipFile()
  20426                           ' U se a compo und expres sion in th e selectio nCriteria  string.
  20427                           zip .AddSelect edFiles("n ame = *.xm l  and  si ze &gt; 10 24kb", tru e)
  20428                           zip .Save(Path ToZipArchi ve)
  20429                       End Usi ng
  20430                       
  20431        </code>
  20432                      
  20433       </example>
  20434                    
  20435                     
  20436       <param 
  20437        name="sele ctionCrite ria"
  20438       >
  20439        The criter ia for fil e selectio n
  20440       </param>
  20441                    
  20442                     
  20443       <param 
  20444        name="recu rseDirecto ries"
  20445       >
  20446                        If tr ue, the fi le selecti on will re curse into  subdirect ories.
  20447                      
  20448       </param>
  20449               
  20450      </member>
  20451              
  20452      <member 
  20453       name="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String,Sys tem.String )"
  20454      >
  20455                     
  20456       <summary>
  20457                        Adds  to the Zip File a set  of files  from a spe cified dir ectory in  the
  20458                        files ystem, tha t conform  to the spe cified cri teria.
  20459                      
  20460       </summary>
  20461                    
  20462                     
  20463       <remarks>
  20464                      
  20465        <para>
  20466                         This  method sel ects files  that conf orm to the  specified  criteria,  from the
  20467                         the s pecified d irectory o n disk, an d adds the m to the Z ipFile.  T he search
  20468                         does  not recurs e into sub directores .
  20469                       
  20470        </para>
  20471                     
  20472                      
  20473        <para>
  20474                         Using  this meth od, the fu ll filesys tem path o f the file s on disk  is
  20475                         repro duced on t he entries  added to  the zip fi le.  If yo u don't wa nt this
  20476                         behav ior, use o ne of the  other over loads of t his method .
  20477                       
  20478        </para>
  20479                     
  20480                      
  20481        <para>
  20482                         For d etails on  the syntax  for the s electionCr iteria par ameter, se
  20483         <see 
  20484          cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String)"
  20485         />
  20486         .
  20487                       
  20488        </para>
  20489                     
  20490                      
  20491       </remarks>
  20492                    
  20493                     
  20494       <example>
  20495                     
  20496                        This  example zi ps up all  *.xml file s larger t han 1mb in  the direc tory
  20497                        given  by "d:\ra wdata".
  20498                     
  20499                      
  20500        <code>
  20501                       using ( ZipFile zi p = new Zi pFile())
  20502                       {
  20503                           //  Use a comp ound expre ssion in t he selecti onCriteria  string.
  20504                           zip .AddSelect edFiles("n ame = *.xm l  and  si ze &gt; 10 24kb", "d: \\rawdata" );
  20505                           zip .Save(Path ToZipArchi ve);
  20506                       }
  20507                       
  20508        </code>
  20509                     
  20510                      
  20511        <code 
  20512         lang="VB"
  20513        >
  20514                       Using z ip As ZipF ile = New  ZipFile()
  20515                           ' U se a compo und expres sion in th e selectio nCriteria  string.
  20516                           zip .AddSelect edFiles("n ame = *.xm l  and  si ze &gt; 10 24kb", "d: \rawdata)
  20517                           zip .Save(Path ToZipArchi ve)
  20518                       End Usi ng
  20519                       
  20520        </code>
  20521                      
  20522       </example>
  20523                    
  20524                     
  20525       <param 
  20526        name="sele ctionCrite ria"
  20527       >
  20528        The criter ia for fil e selectio n
  20529       </param>
  20530                    
  20531                     
  20532       <param 
  20533        name="dire ctoryOnDis k"
  20534       >
  20535                      The nam e of the d irectory o n the disk  from whic h to selec t files.
  20536                      
  20537       </param>
  20538               
  20539      </member>
  20540              
  20541      <member 
  20542       name="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String,Sys tem.String ,System.Bo olean)"
  20543      >
  20544                     
  20545       <summary>
  20546                        Adds  to the Zip File a set  of files  from the s pecified d irectory o n disk,
  20547                        that  conform to  the speci fied crite ria.
  20548                      
  20549       </summary>
  20550                    
  20551                     
  20552       <remarks>
  20553                     
  20554                      
  20555        <para>
  20556                         This  method sel ects files  from the  the specif ied disk d irectory m atching
  20557                         the s pecified s election c riteria, a nd adds th em to the  ZipFile.   If
  20558                         
  20559         <c>
  20560          recurseDir ectories
  20561         </c>
  20562          is true,  files are  also selec ted from
  20563                         subdi rectories.
  20564                       
  20565        </para>
  20566                     
  20567                      
  20568        <para>
  20569                         The f ull direct ory struct ure in the  filesyste m is repro duced on t he
  20570                         entri es added t o the zip  archive.   If you don 't want th is behavio r, use
  20571                         one o f the over loads of t his method  that allo ws the spe cification  of a
  20572                         
  20573         <c>
  20574          directoryI nArchive
  20575         </c>
  20576         .
  20577                       
  20578        </para>
  20579                     
  20580                      
  20581        <para>
  20582                         For d etails on  the syntax  for the s electionCr iteria par ameter, se
  20583         <see 
  20584          cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String)"
  20585         />
  20586         .
  20587                       
  20588        </para>
  20589                      
  20590       </remarks>
  20591                    
  20592                     
  20593       <example>
  20594                     
  20595                        This  example zi ps up all  *.csv file s in the " files" dir ectory, or  any
  20596                        subdi rectory, t hat have b een saved  since 2009  February  14th.
  20597                     
  20598                      
  20599        <code>
  20600                       using ( ZipFile zi p = new Zi pFile())
  20601                       {
  20602                           //  Use a comp ound expre ssion in t he selecti onCriteria  string.
  20603                           zip .AddSelect edFiles("n ame = *.cs v  and  mt ime &gt; 2 009-02-14" , "files",  true);
  20604                           zip .Save(Path ToZipArchi ve);
  20605                       }
  20606                       
  20607        </code>
  20608                      
  20609        <code 
  20610         lang="VB"
  20611        >
  20612                       Using z ip As ZipF ile = New  ZipFile()
  20613                           ' U se a compo und expres sion in th e selectio nCriteria  string.
  20614                           zip .AddSelect edFiles("n ame = *.cs v  and  mt ime &gt; 2 009-02-14" , "files",  true)
  20615                           zip .Save(Path ToZipArchi ve)
  20616                       End Usi ng
  20617                       
  20618        </code>
  20619                      
  20620       </example>
  20621                    
  20622                     
  20623       <example>
  20624                        This  example zi ps up all  files in t he current  working
  20625                        direc tory, and  all its ch ild direct ories, exc ept those  in
  20626                        the 
  20627        <c>
  20628         excludethi s
  20629        </c>
  20630         subdirect ory.
  20631                      
  20632        <code 
  20633         lang="VB"
  20634        >
  20635                       Using Z ip As ZipF ile = New  ZipFile(zi pfile)
  20636                         Zip.A ddSelected Ffiles("na me != 'exc ludethis\* .*'", data path, True )
  20637                         Zip.S ave()
  20638                       End Usi ng
  20639                       
  20640        </code>
  20641                      
  20642       </example>
  20643                    
  20644                     
  20645       <param 
  20646        name="sele ctionCrite ria"
  20647       >
  20648        The criter ia for fil e selectio n
  20649       </param>
  20650                    
  20651                     
  20652       <param 
  20653        name="dire ctoryOnDis k"
  20654       >
  20655                        The f ilesystem  path from  which to s elect file s.
  20656                      
  20657       </param>
  20658                    
  20659                     
  20660       <param 
  20661        name="recu rseDirecto ries"
  20662       >
  20663                        If tr ue, the fi le selecti on will re curse into  subdirect ories.
  20664                      
  20665       </param>
  20666               
  20667      </member>
  20668              
  20669      <member 
  20670       name="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String,Sys tem.String ,System.St ring)"
  20671      >
  20672                     
  20673       <summary>
  20674                        Adds  to the Zip File a sel ection of  files from  the speci fied direc tory on
  20675                        disk,  that conf orm to the  specified  criteria,  and using  a specifi ed root
  20676                        path  for entrie s added to  the zip a rchive.
  20677                      
  20678       </summary>
  20679                    
  20680                     
  20681       <remarks>
  20682                      
  20683        <para>
  20684                         This  method sel ects files  from the  specified  disk direc tory match ing the
  20685                         speci fied selec tion crite ria, and a dds those  files to t he ZipFile , using
  20686                         the s pecified d irectory p ath in the  archive.   The searc h does not  recurse
  20687                         into  subdirecto ries.  For  details o n the synt ax for the  selection Criteria
  20688                         param eter, see 
  20689         <see 
  20690          cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String)"
  20691         />
  20692         .
  20693                       
  20694        </para>
  20695                     
  20696                      
  20697       </remarks>
  20698                    
  20699                     
  20700       <example>
  20701                     
  20702                        This  example zi ps up all  *.psd file s in the " photos" di rectory th at have
  20703                        been  saved sinc e 2009 Feb ruary 14th , and puts  them all  in a zip f ile,
  20704                        using  the direc tory name  of "conten t" in the  zip archiv e itself.  When the
  20705                        zip a rchive is  unzipped,  the folder  containin g the .psd  files wil l be
  20706                        named  "content" .
  20707                     
  20708                      
  20709        <code>
  20710                       using ( ZipFile zi p = new Zi pFile())
  20711                       {
  20712                           //  Use a comp ound expre ssion in t he selecti onCriteria  string.
  20713                           zip .AddSelect edFiles("n ame = *.ps d  and  mt ime &gt; 2 009-02-14" , "photos" , "content ");
  20714                           zip .Save(Path ToZipArchi ve);
  20715                       }
  20716                       
  20717        </code>
  20718                      
  20719        <code 
  20720         lang="VB"
  20721        >
  20722                       Using z ip As ZipF ile = New  ZipFile
  20723                           zip .AddSelect edFiles("n ame = *.ps d  and  mt ime &gt; 2 009-02-14" , "photos" , "content ")
  20724                           zip .Save(Path ToZipArchi ve)
  20725                       End Usi ng
  20726                       
  20727        </code>
  20728                      
  20729       </example>
  20730                    
  20731                     
  20732       <param 
  20733        name="sele ctionCrite ria"
  20734       >
  20735                        The c riteria fo r selectio n of files  to add to  the 
  20736        <c>
  20737         ZipFile
  20738        </c>
  20739        .
  20740                      
  20741       </param>
  20742                    
  20743                     
  20744       <param 
  20745        name="dire ctoryOnDis k"
  20746       >
  20747                        The p ath to the  directory  in the fi lesystem f rom which  to select  files.
  20748                      
  20749       </param>
  20750                    
  20751                     
  20752       <param 
  20753        name="dire ctoryPathI nArchive"
  20754       >
  20755                        Speci fies a dir ectory pat h to use t o in place  of the
  20756                        
  20757        <c>
  20758         directoryO nDisk
  20759        </c>
  20760        .  This pa th may, or  may not,  correspond  to a real
  20761                        direc tory in th e current  filesystem .  If the  files with in the zip  are
  20762                        later  extracted , this is  the path u sed for th e extracte d file.  P assing
  20763                        null  (nothing i n VB) will  use the p ath on the  file name , if any;  in other
  20764                        words  it would  use 
  20765        <c>
  20766         directoryO nDisk
  20767        </c>
  20768        , plus any  subdirect ory.  Pass ing
  20769                        the e mpty strin g ("") wil l insert t he item at  the root  path withi n the
  20770                        archi ve.
  20771                      
  20772       </param>
  20773               
  20774      </member>
  20775              
  20776      <member 
  20777       name="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String,Sys tem.String ,System.St ring,Syste m.Boolean) "
  20778      >
  20779                     
  20780       <summary>
  20781                        Adds  to the Zip File a sel ection of  files from  the speci fied direc tory on
  20782                        disk,  that conf orm to the  specified  criteria,  optionall y recursin g through
  20783                        subdi rectories,  and using  a specifi ed root pa th for ent ries added  to the
  20784                        zip a rchive.
  20785                      
  20786       </summary>
  20787                    
  20788                     
  20789       <remarks>
  20790                        This  method sel ects files  from the  specified  disk direc tory that  match the
  20791                        speci fied selec tion crite ria, and a dds those  files to t he ZipFile , using
  20792                        the s pecified d irectory p ath in the  archive.  If 
  20793        <c>
  20794         recurseDir ectories
  20795        </c>
  20796                        is tr ue, files  are also s elected fr om subdire ctories, a nd the dir ectory
  20797                        struc ture in th e filesyst em is repr oduced in  the zip ar chive, roo ted at
  20798                        the d irectory s pecified b
  20799        <c>
  20800         directoryO nDisk
  20801        </c>
  20802        .  For det ails on th e
  20803                        synta x for the  selectionC riteria pa rameter, s ee 
  20804        <see 
  20805         cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String)"
  20806        />
  20807        .
  20808                      
  20809       </remarks>
  20810                    
  20811                     
  20812       <example>
  20813                     
  20814                        This  example zi ps up all  files that  are NOT * .pst files , in the c urrent
  20815                        worki ng directo ry and any  subdirect ories.
  20816                     
  20817                      
  20818        <code>
  20819                       using ( ZipFile zi p = new Zi pFile())
  20820                       {
  20821                           zip .AddSelect edFiles("n ame != *.p st", Sourc eDirectory , "backup" , true);
  20822                           zip .Save(Path ToZipArchi ve);
  20823                       }
  20824                       
  20825        </code>
  20826                      
  20827        <code 
  20828         lang="VB"
  20829        >
  20830                       Using z ip As ZipF ile = New  ZipFile
  20831                           zip .AddSelect edFiles("n ame != *.p st", Sourc eDirectory , "backup" , true)
  20832                           zip .Save(Path ToZipArchi ve)
  20833                       End Usi ng
  20834                       
  20835        </code>
  20836                      
  20837       </example>
  20838                    
  20839                     
  20840       <param 
  20841        name="sele ctionCrite ria"
  20842       >
  20843                        The c riteria fo r selectio n of files  to add to  the 
  20844        <c>
  20845         ZipFile
  20846        </c>
  20847        .
  20848                      
  20849       </param>
  20850                    
  20851                     
  20852       <param 
  20853        name="dire ctoryOnDis k"
  20854       >
  20855                        The p ath to the  directory  in the fi lesystem f rom which  to select  files.
  20856                      
  20857       </param>
  20858                    
  20859                     
  20860       <param 
  20861        name="dire ctoryPathI nArchive"
  20862       >
  20863                        Speci fies a dir ectory pat h to use t o in place  of the
  20864                        
  20865        <c>
  20866         directoryO nDisk
  20867        </c>
  20868        .  This pa th may, or  may not,  correspond  to a real
  20869                        direc tory in th e current  filesystem .  If the  files with in the zip  are
  20870                        later  extracted , this is  the path u sed for th e extracte d file.  P assing
  20871                        null  (nothing i n VB) will  use the p ath on the  file name , if any;  in other
  20872                        words  it would  use 
  20873        <c>
  20874         directoryO nDisk
  20875        </c>
  20876        , plus any  subdirect ory.  Pass ing
  20877                        the e mpty strin g ("") wil l insert t he item at  the root  path withi n the
  20878                        archi ve.
  20879                      
  20880       </param>
  20881                    
  20882                     
  20883       <param 
  20884        name="recu rseDirecto ries"
  20885       >
  20886                        If tr ue, the me thod also  scans subd irectories  for files  matching  the
  20887                        crite ria.
  20888                      
  20889       </param>
  20890               
  20891      </member>
  20892              
  20893      <member 
  20894       name="M:Io nic.Zip.Zi pFile.Upda teSelected Files(Syst em.String, System.Str ing,System .String,Sy stem.Boole an)"
  20895      >
  20896                     
  20897       <summary>
  20898                        Updat es the Zip File with  a selectio n of files  from the  disk that  conform
  20899                        to th e specifie d criteria .
  20900                      
  20901       </summary>
  20902                    
  20903                     
  20904       <remarks>
  20905                        This  method sel ects files  from the  specified  disk direc tory that  match the
  20906                        speci fied selec tion crite ria, and U pdates the  
  20907        <c>
  20908         ZipFile
  20909        </c>
  20910         with thos e
  20911                        files , using th e specifie d director y path in  the archiv e. If
  20912                        
  20913        <c>
  20914         recurseDir ectories
  20915        </c>
  20916         is true,  files are  also selec ted from
  20917                        subdi rectories,  and the d irectory s tructure i n the file system is
  20918                        repro duced in t he zip arc hive, root ed at the  directory  specified  by
  20919                        
  20920        <c>
  20921         directoryO nDisk
  20922        </c>
  20923        .  For det ails on th e syntax f or the
  20924                        selec tionCriter ia paramet er, see 
  20925        <see 
  20926         cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String)"
  20927        />
  20928        .
  20929                      
  20930       </remarks>
  20931                    
  20932                     
  20933       <param 
  20934        name="sele ctionCrite ria"
  20935       >
  20936                        The c riteria fo r selectio n of files  to add to  the 
  20937        <c>
  20938         ZipFile
  20939        </c>
  20940        .
  20941                      
  20942       </param>
  20943                    
  20944                     
  20945       <param 
  20946        name="dire ctoryOnDis k"
  20947       >
  20948                        The p ath to the  directory  in the fi lesystem f rom which  to select  files.
  20949                      
  20950       </param>
  20951                    
  20952                     
  20953       <param 
  20954        name="dire ctoryPathI nArchive"
  20955       >
  20956                        Speci fies a dir ectory pat h to use t o in place  of the
  20957                        
  20958        <c>
  20959         directoryO nDisk
  20960        </c>
  20961        . This pat h may, or  may not, c orrespond  to a
  20962                        real  directory  in the cur rent files ystem. If  the files  within the  zip
  20963                        are l ater extra cted, this  is the pa th used fo r the extr acted file .
  20964                        Passi ng null (n othing in  VB) will u se the pat h on the f ile name,  if
  20965                        any;  in other w ords it wo uld use 
  20966        <c>
  20967         directoryO nDisk
  20968        </c>
  20969        , plus any
  20970                        subdi rectory.   Passing th e empty st ring ("")  will inser t the item  at
  20971                        the r oot path w ithin the  archive.
  20972                      
  20973       </param>
  20974                    
  20975                     
  20976       <param 
  20977        name="recu rseDirecto ries"
  20978       >
  20979                        If tr ue, the me thod also  scans subd irectories  for files  matching  the criter ia.
  20980                      
  20981       </param>
  20982                    
  20983                     
  20984       <seealso 
  20985        cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String,Sys tem.String ,System.St ring,Syste m.Boolean) "
  20986       />
  20987               
  20988      </member>
  20989              
  20990      <member 
  20991       name="M:Io nic.Zip.Zi pFile.Sele ctEntries( System.Str ing)"
  20992      >
  20993                     
  20994       <summary>
  20995                      Retriev e entries  from the z ipfile by  specified  criteria.
  20996                      
  20997       </summary>
  20998                    
  20999                     
  21000       <remarks>
  21001                      
  21002        <para>
  21003                       This me thod allow s callers  to retriev e the coll ection of  entries fr om the zip file
  21004                       that fi t the spec ified crit eria.  The  criteria  are descri bed in a s tring form at, and
  21005                       can inc lude patte rns for th e filename ; constrai nts on the  size of t he entry;
  21006                       constra ints on th e last mod ified, cre ated, or l ast access ed time fo r the file
  21007                       describ ed by the  entry; or  the attrib utes of th e entry.
  21008                       
  21009        </para>
  21010                     
  21011                      
  21012        <para>
  21013                       For det ails on th e syntax f or the sel ectionCrit eria param eter, see 
  21014         <see 
  21015          cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String)"
  21016         />
  21017         .
  21018                       
  21019        </para>
  21020                     
  21021                      
  21022        <para>
  21023                       This me thod is in tended for  use with  a ZipFile  that has b een read f rom storag e.
  21024                       When cr eating a n ew ZipFile , this met hod will w ork only a fter the Z ipArchive  has
  21025                       been Sa ved to the  disk (the  ZipFile c lass subse quently an d implicit ly reads t he Zip
  21026                       archive  from stor age.)  Cal ling Selec tEntries o n a ZipFil e that has  not yet b een
  21027                       saved w ill delive r undefine d results.
  21028                       
  21029        </para>
  21030                      
  21031       </remarks>
  21032                    
  21033                     
  21034       <exception  
  21035        cref="T:Sy stem.Excep tion"
  21036       >
  21037                      Thrown  if selecti onCriteria  has an in valid synt ax.
  21038                      
  21039       </exceptio n>
  21040                    
  21041                     
  21042       <example>
  21043                      This ex ample sele cts all th e PhotoSho p files fr om within  an archive , and extr acts them
  21044                      to the  current wo rking dire ctory.
  21045                      
  21046        <code>
  21047                       using ( ZipFile zi p1 = ZipFi le.Read(Zi pFileName) )
  21048                       {
  21049                           var  PhotoShop Files = zi p1.SelectE ntries("*. psd");
  21050                           for each (ZipE ntry psd i n PhotoSho pFiles)
  21051                           {
  21052                                psd.Extra ct();
  21053                           }
  21054                       }
  21055                       
  21056        </code>
  21057                      
  21058        <code 
  21059         lang="VB"
  21060        >
  21061                       Using z ip1 As Zip File = Zip File.Read( ZipFileNam e)
  21062                           Dim  PhotoShop Files as I Collection (Of ZipEnt ry)
  21063                           Pho toShopFile s = zip1.S electEntri es("*.psd" )
  21064                           Dim  psd As Zi pEntry
  21065                           For  Each psd  In PhotoSh opFiles
  21066                                psd.Extra ct
  21067                           Nex t
  21068                       End Usi ng
  21069                       
  21070        </code>
  21071                      
  21072       </example>
  21073                     
  21074       <param 
  21075        name="sele ctionCrite ria"
  21076       >
  21077        the string  that spec ifies whic h entries  to select
  21078       </param>
  21079                     
  21080       <returns>
  21081        a collecti on of ZipE ntry objec ts that co nform to t he inclusi on spec
  21082       </returns>
  21083               
  21084      </member>
  21085              
  21086      <member 
  21087       name="M:Io nic.Zip.Zi pFile.Sele ctEntries( System.Str ing,System .String)"
  21088      >
  21089                     
  21090       <summary>
  21091                      Retriev e entries  from the z ipfile by  specified  criteria.
  21092                      
  21093       </summary>
  21094                    
  21095                     
  21096       <remarks>
  21097                      
  21098        <para>
  21099                       This me thod allow s callers  to retriev e the coll ection of  entries fr om the zip file
  21100                       that fi t the spec ified crit eria.  The  criteria  are descri bed in a s tring form at, and
  21101                       can inc lude patte rns for th e filename ; constrai nts on the  size of t he entry;
  21102                       constra ints on th e last mod ified, cre ated, or l ast access ed time fo r the file
  21103                       describ ed by the  entry; or  the attrib utes of th e entry.
  21104                       
  21105        </para>
  21106                     
  21107                      
  21108        <para>
  21109                       For det ails on th e syntax f or the sel ectionCrit eria param eter, see 
  21110         <see 
  21111          cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String)"
  21112         />
  21113         .
  21114                       
  21115        </para>
  21116                     
  21117                      
  21118        <para>
  21119                       This me thod is in tended for  use with  a ZipFile  that has b een read f rom storag e.
  21120                       When cr eating a n ew ZipFile , this met hod will w ork only a fter the Z ipArchive  has
  21121                       been Sa ved to the  disk (the  ZipFile c lass subse quently an d implicit ly reads t he Zip
  21122                       archive  from stor age.)  Cal ling Selec tEntries o n a ZipFil e that has  not yet b een
  21123                       saved w ill delive r undefine d results.
  21124                       
  21125        </para>
  21126                      
  21127       </remarks>
  21128                    
  21129                     
  21130       <exception  
  21131        cref="T:Sy stem.Excep tion"
  21132       >
  21133                      Thrown  if selecti onCriteria  has an in valid synt ax.
  21134                      
  21135       </exceptio n>
  21136                    
  21137                     
  21138       <example>
  21139                      
  21140        <code>
  21141                       using ( ZipFile zi p1 = ZipFi le.Read(Zi pFileName) )
  21142                       {
  21143                           var  UpdatedPh otoShopFil es = zip1. SelectEntr ies("*.psd ", "Update dFiles");
  21144                           for each (ZipE ntry e in  UpdatedPho toShopFile s)
  21145                           {
  21146                                // prompt  for extra ct here
  21147                                if (WantE xtract(e.F ileName))
  21148                                    e.Ext ract();
  21149                           }
  21150                       }
  21151                       
  21152        </code>
  21153                      
  21154        <code 
  21155         lang="VB"
  21156        >
  21157                       Using z ip1 As Zip File = Zip File.Read( ZipFileNam e)
  21158                           Dim  UpdatedPh otoShopFil es As ICol lection(Of  ZipEntry)  = zip1.Se lectEntrie s("*.psd",  "UpdatedF iles")
  21159                           Dim  e As ZipE ntry
  21160                           For  Each e In  UpdatedPh otoShopFil es
  21161                                ' prompt  for extrac t here
  21162                                If Me.Wan tExtract(e .FileName)  Then
  21163                                    e.Ext ract
  21164                                End If
  21165                           Nex t
  21166                       End Usi ng
  21167                       
  21168        </code>
  21169                      
  21170       </example>
  21171                     
  21172       <param 
  21173        name="sele ctionCrite ria"
  21174       >
  21175        the string  that spec ifies whic h entries  to select
  21176       </param>
  21177                    
  21178                     
  21179       <param 
  21180        name="dire ctoryPathI nArchive"
  21181       >
  21182                      the dir ectory in  the archiv e from whi ch to sele ct entries . If null,  then
  21183                      all dir ectories i n the arch ive are us ed.
  21184                      
  21185       </param>
  21186                    
  21187                     
  21188       <returns>
  21189        a collecti on of ZipE ntry objec ts that co nform to t he inclusi on spec
  21190       </returns>
  21191               
  21192      </member>
  21193              
  21194      <member 
  21195       name="M:Io nic.Zip.Zi pFile.Remo veSelected Entries(Sy stem.Strin g)"
  21196      >
  21197                     
  21198       <summary>
  21199                      Remove  entries fr om the zip file by sp ecified cr iteria.
  21200                      
  21201       </summary>
  21202                    
  21203                     
  21204       <remarks>
  21205                      
  21206        <para>
  21207                       This me thod allow s callers  to remove  the collec tion of en tries from  the zipfi le
  21208                       that fi t the spec ified crit eria.  The  criteria  are descri bed in a s tring form at, and
  21209                       can inc lude patte rns for th e filename ; constrai nts on the  size of t he entry;
  21210                       constra ints on th e last mod ified, cre ated, or l ast access ed time fo r the file
  21211                       describ ed by the  entry; or  the attrib utes of th e entry.
  21212                       
  21213        </para>
  21214                     
  21215                      
  21216        <para>
  21217                       For det ails on th e syntax f or the sel ectionCrit eria param eter, see 
  21218         <see 
  21219          cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String)"
  21220         />
  21221         .
  21222                       
  21223        </para>
  21224                     
  21225                      
  21226        <para>
  21227                       This me thod is in tended for  use with  a ZipFile  that has b een read f rom storag e.
  21228                       When cr eating a n ew ZipFile , this met hod will w ork only a fter the Z ipArchive  has
  21229                       been Sa ved to the  disk (the  ZipFile c lass subse quently an d implicit ly reads t he Zip
  21230                       archive  from stor age.)  Cal ling Selec tEntries o n a ZipFil e that has  not yet b een
  21231                       saved w ill delive r undefine d results.
  21232                       
  21233        </para>
  21234                      
  21235       </remarks>
  21236                    
  21237                     
  21238       <exception  
  21239        cref="T:Sy stem.Excep tion"
  21240       >
  21241                      Thrown  if selecti onCriteria  has an in valid synt ax.
  21242                      
  21243       </exceptio n>
  21244                    
  21245                     
  21246       <example>
  21247                      This ex ample remo ves all en tries in a  zip file  that were  modified p rior to Ja nuary 1st,  2008.
  21248                      
  21249        <code>
  21250                       using ( ZipFile zi p1 = ZipFi le.Read(Zi pFileName) )
  21251                       {
  21252                           //  remove all  entries f rom prior  to Jan 1,  2008
  21253                           zip 1.RemoveEn tries("mti me &lt; 20 08-01-01") ;
  21254                           //  don't forg et to save  the archi ve!
  21255                           zip 1.Save();
  21256                       }
  21257                       
  21258        </code>
  21259                      
  21260        <code 
  21261         lang="VB"
  21262        >
  21263                       Using z ip As ZipF ile = ZipF ile.Read(Z ipFileName )
  21264                           ' r emove all  entries fr om prior t o Jan 1, 2 008
  21265                           zip 1.RemoveEn tries("mti me &lt; 20 08-01-01")
  21266                           ' d o not forg et to save  the archi ve!
  21267                           zip 1.Save
  21268                       End Usi ng
  21269                       
  21270        </code>
  21271                      
  21272       </example>
  21273                     
  21274       <param 
  21275        name="sele ctionCrite ria"
  21276       >
  21277        the string  that spec ifies whic h entries  to select
  21278       </param>
  21279                     
  21280       <returns>
  21281        the number  of entrie s removed
  21282       </returns>
  21283               
  21284      </member>
  21285              
  21286      <member 
  21287       name="M:Io nic.Zip.Zi pFile.Remo veSelected Entries(Sy stem.Strin g,System.S tring)"
  21288      >
  21289                     
  21290       <summary>
  21291                      Remove  entries fr om the zip file by sp ecified cr iteria, an d within t he specifi ed
  21292                      path in  the archi ve.
  21293                      
  21294       </summary>
  21295                    
  21296                     
  21297       <remarks>
  21298                      
  21299        <para>
  21300                       This me thod allow s callers  to remove  the collec tion of en tries from  the zipfi le
  21301                       that fi t the spec ified crit eria.  The  criteria  are descri bed in a s tring form at, and
  21302                       can inc lude patte rns for th e filename ; constrai nts on the  size of t he entry;
  21303                       constra ints on th e last mod ified, cre ated, or l ast access ed time fo r the file
  21304                       describ ed by the  entry; or  the attrib utes of th e entry.
  21305                       
  21306        </para>
  21307                     
  21308                      
  21309        <para>
  21310                       For det ails on th e syntax f or the sel ectionCrit eria param eter, see 
  21311         <see 
  21312          cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String)"
  21313         />
  21314         .
  21315                       
  21316        </para>
  21317                     
  21318                      
  21319        <para>
  21320                       This me thod is in tended for  use with  a ZipFile  that has b een read f rom storag e.
  21321                       When cr eating a n ew ZipFile , this met hod will w ork only a fter the Z ipArchive  has
  21322                       been Sa ved to the  disk (the  ZipFile c lass subse quently an d implicit ly reads t he Zip
  21323                       archive  from stor age.)  Cal ling Selec tEntries o n a ZipFil e that has  not yet b een
  21324                       saved w ill delive r undefine d results.
  21325                       
  21326        </para>
  21327                      
  21328       </remarks>
  21329                    
  21330                     
  21331       <exception  
  21332        cref="T:Sy stem.Excep tion"
  21333       >
  21334                      Thrown  if selecti onCriteria  has an in valid synt ax.
  21335                      
  21336       </exceptio n>
  21337                    
  21338                     
  21339       <example>
  21340                      
  21341        <code>
  21342                       using ( ZipFile zi p1 = ZipFi le.Read(Zi pFileName) )
  21343                       {
  21344                           //  remove all  entries f rom prior  to Jan 1,  2008
  21345                           zip 1.RemoveEn tries("mti me &lt; 20 08-01-01",  "document s");
  21346                           //  a call to  ZipFile.Sa ve will ma ke the mod ifications  permanent
  21347                           zip 1.Save();
  21348                       }
  21349                       
  21350        </code>
  21351                      
  21352        <code 
  21353         lang="VB"
  21354        >
  21355                       Using z ip As ZipF ile = ZipF ile.Read(Z ipFileName )
  21356                           ' r emove all  entries fr om prior t o Jan 1, 2 008
  21357                           zip 1.RemoveEn tries("mti me &lt; 20 08-01-01",  "document s")
  21358                           ' a  call to Z ipFile.Sav e will mak e the modi fications  permanent
  21359                           zip 1.Save
  21360                       End Usi ng
  21361                       
  21362        </code>
  21363                      
  21364       </example>
  21365                    
  21366                     
  21367       <param 
  21368        name="sele ctionCrite ria"
  21369       >
  21370        the string  that spec ifies whic h entries  to select
  21371       </param>
  21372                     
  21373       <param 
  21374        name="dire ctoryPathI nArchive"
  21375       >
  21376                      the dir ectory in  the archiv e from whi ch to sele ct entries . If null,  then
  21377                      all dir ectories i n the arch ive are us ed.
  21378                      
  21379       </param>
  21380                     
  21381       <returns>
  21382        the number  of entrie s removed
  21383       </returns>
  21384               
  21385      </member>
  21386              
  21387      <member 
  21388       name="M:Io nic.Zip.Zi pFile.Extr actSelecte dEntries(S ystem.Stri ng)"
  21389      >
  21390                     
  21391       <summary>
  21392                      Selects  and Extra cts a set  of Entries  from the  ZipFile.
  21393                      
  21394       </summary>
  21395                    
  21396                     
  21397       <remarks>
  21398                      
  21399        <para>
  21400                       The ent ries are e xtracted i nto the cu rrent work ing direct ory.
  21401                       
  21402        </para>
  21403                     
  21404                      
  21405        <para>
  21406                       If any  of the fil es to be e xtracted a lready exi st, then t he action  taken is a s
  21407                       specifi ed in the 
  21408         <see 
  21409          cref="P:Io nic.Zip.Zi pEntry.Ext ractExisti ngFile"
  21410         />
  21411          property  on the
  21412                       corresp onding Zip Entry inst ance.  By  default, t he action  taken in t his case i s to
  21413                       throw a n exceptio n.
  21414                       
  21415        </para>
  21416                     
  21417                      
  21418        <para>
  21419                       For inf ormation o n the synt ax of the  selectionC riteria st ring,
  21420                       see 
  21421         <see 
  21422          cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String)"
  21423         />
  21424         .
  21425                       
  21426        </para>
  21427                      
  21428       </remarks>
  21429                    
  21430                     
  21431       <example>
  21432                      This ex ample show s how extr act all XM L files mo dified aft er 15 Janu ary 2009.
  21433                      
  21434        <code>
  21435                       using ( ZipFile zi p = ZipFil e.Read(zip ArchiveNam e))
  21436                       {
  21437                         zip.E xtractSele ctedEntrie s("name =  *.xml  and   mtime &g t; 2009-01 -15");
  21438                       }
  21439                       
  21440        </code>
  21441                      
  21442       </example>
  21443                     
  21444       <param 
  21445        name="sele ctionCrite ria"
  21446       >
  21447        the select ion criter ia for ent ries to ex tract.
  21448       </param>
  21449                    
  21450                     
  21451       <seealso 
  21452        cref="M:Io nic.Zip.Zi pFile.Extr actSelecte dEntries(S ystem.Stri ng,Ionic.Z ip.Extract ExistingFi leAction)"
  21453       />
  21454               
  21455      </member>
  21456              
  21457      <member 
  21458       name="M:Io nic.Zip.Zi pFile.Extr actSelecte dEntries(S ystem.Stri ng,Ionic.Z ip.Extract ExistingFi leAction)"
  21459      >
  21460                     
  21461       <summary>
  21462                      Selects  and Extra cts a set  of Entries  from the  ZipFile.
  21463                      
  21464       </summary>
  21465                    
  21466                     
  21467       <remarks>
  21468                      
  21469        <para>
  21470                       The ent ries are e xtracted i nto the cu rrent work ing direct ory. When  extraction  would wou ld
  21471                       overwri te an exis ting files ystem file , the acti on taken i s as speci fied in th e
  21472                       
  21473         <paramref 
  21474          name="extr actExistin gFile"
  21475         />
  21476          parameter .
  21477                       
  21478        </para>
  21479                     
  21480                      
  21481        <para>
  21482                       For inf ormation o n the synt ax of the  string des cribing th e entry se lection cr iteria,
  21483                       see 
  21484         <see 
  21485          cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String)"
  21486         />
  21487         .
  21488                       
  21489        </para>
  21490                      
  21491       </remarks>
  21492                    
  21493                     
  21494       <example>
  21495                      This ex ample show s how extr act all XM L files mo dified aft er 15 Janu ary 2009,
  21496                      overwri ting any e xisting fi les.
  21497                      
  21498        <code>
  21499                       using ( ZipFile zi p = ZipFil e.Read(zip ArchiveNam e))
  21500                       {
  21501                         zip.E xtractSele ctedEntrie s("name =  *.xml  and   mtime &g t; 2009-01 -15",
  21502                                                       ExtractE xistingFil eAction.Ov erwriteSil ently);
  21503                       }
  21504                       
  21505        </code>
  21506                      
  21507       </example>
  21508                    
  21509                     
  21510       <param 
  21511        name="sele ctionCrite ria"
  21512       >
  21513        the select ion criter ia for ent ries to ex tract.
  21514       </param>
  21515                    
  21516                     
  21517       <param 
  21518        name="extr actExistin gFile"
  21519       >
  21520                      The act ion to tak e if extra ction woul d overwrit e an exist ing file.
  21521                      
  21522       </param>
  21523               
  21524      </member>
  21525              
  21526      <member 
  21527       name="M:Io nic.Zip.Zi pFile.Extr actSelecte dEntries(S ystem.Stri ng,System. String)"
  21528      >
  21529                     
  21530       <summary>
  21531                      Selects  and Extra cts a set  of Entries  from the  ZipFile.
  21532                      
  21533       </summary>
  21534                    
  21535                     
  21536       <remarks>
  21537                      
  21538        <para>
  21539                       The ent ries are s elected fr om the spe cified dir ectory wit hin the ar chive, and  then
  21540                       extract ed into th e current  working di rectory.
  21541                       
  21542        </para>
  21543                     
  21544                      
  21545        <para>
  21546                       If any  of the fil es to be e xtracted a lready exi st, then t he action  taken is a s
  21547                       specifi ed in the 
  21548         <see 
  21549          cref="P:Io nic.Zip.Zi pEntry.Ext ractExisti ngFile"
  21550         />
  21551          property  on the
  21552                       corresp onding Zip Entry inst ance.  By  default, t he action  taken in t his case i s to
  21553                       throw a n exceptio n.
  21554                       
  21555        </para>
  21556                     
  21557                      
  21558        <para>
  21559                       For inf ormation o n the synt ax of the  string des cribing th e entry se lection cr iteria,
  21560                       see 
  21561         <see 
  21562          cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String)"
  21563         />
  21564         .
  21565                       
  21566        </para>
  21567                      
  21568       </remarks>
  21569                    
  21570                     
  21571       <example>
  21572                      This ex ample show s how extr act all XM L files mo dified aft er 15 Janu ary 2009,
  21573                      and wri tes them t o the "unp ack" direc tory.
  21574                      
  21575        <code>
  21576                       using ( ZipFile zi p = ZipFil e.Read(zip ArchiveNam e))
  21577                       {
  21578                         zip.E xtractSele ctedEntrie s("name =  *.xml  and   mtime &g t; 2009-01 -15","unpa ck");
  21579                       }
  21580                       
  21581        </code>
  21582                      
  21583       </example>
  21584                    
  21585                     
  21586       <param 
  21587        name="sele ctionCrite ria"
  21588       >
  21589        the select ion criter ia for ent ries to ex tract.
  21590       </param>
  21591                    
  21592                     
  21593       <param 
  21594        name="dire ctoryPathI nArchive"
  21595       >
  21596                      the dir ectory in  the archiv e from whi ch to sele ct entries . If null,  then
  21597                      all dir ectories i n the arch ive are us ed.
  21598                      
  21599       </param>
  21600                    
  21601                     
  21602       <seealso 
  21603        cref="M:Io nic.Zip.Zi pFile.Extr actSelecte dEntries(S ystem.Stri ng,System. String,Sys tem.String ,Ionic.Zip .ExtractEx istingFile Action)"
  21604       />
  21605               
  21606      </member>
  21607              
  21608      <member 
  21609       name="M:Io nic.Zip.Zi pFile.Extr actSelecte dEntries(S ystem.Stri ng,System. String,Sys tem.String )"
  21610      >
  21611                     
  21612       <summary>
  21613                      Selects  and Extra cts a set  of Entries  from the  ZipFile.
  21614                      
  21615       </summary>
  21616                    
  21617                     
  21618       <remarks>
  21619                      
  21620        <para>
  21621                       The ent ries are e xtracted i nto the sp ecified di rectory. I f any of t he files t o be
  21622                       extract ed already  exist, an  exception  will be t hrown.
  21623                       
  21624        </para>
  21625                      
  21626        <para>
  21627                       For inf ormation o n the synt ax of the  string des cribing th e entry se lection cr iteria,
  21628                       see 
  21629         <see 
  21630          cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String)"
  21631         />
  21632         .
  21633                       
  21634        </para>
  21635                      
  21636       </remarks>
  21637                    
  21638                     
  21639       <param 
  21640        name="sele ctionCrite ria"
  21641       >
  21642        the select ion criter ia for ent ries to ex tract.
  21643       </param>
  21644                    
  21645                     
  21646       <param 
  21647        name="dire ctoryInArc hive"
  21648       >
  21649                      the dir ectory in  the archiv e from whi ch to sele ct entries . If null,  then
  21650                      all dir ectories i n the arch ive are us ed.
  21651                      
  21652       </param>
  21653                    
  21654                     
  21655       <param 
  21656        name="extr actDirecto ry"
  21657       >
  21658                      the dir ectory on  the disk i nto which  to extract . It will  be created
  21659                      if it d oes not ex ist.
  21660                      
  21661       </param>
  21662               
  21663      </member>
  21664              
  21665      <member 
  21666       name="M:Io nic.Zip.Zi pFile.Extr actSelecte dEntries(S ystem.Stri ng,System. String,Sys tem.String ,Ionic.Zip .ExtractEx istingFile Action)"
  21667      >
  21668                     
  21669       <summary>
  21670                      Selects  and Extra cts a set  of Entries  from the  ZipFile.
  21671                      
  21672       </summary>
  21673                    
  21674                     
  21675       <remarks>
  21676                      
  21677        <para>
  21678                       The ent ries are e xtracted i nto the sp ecified di rectory. W hen extrac tion would  would
  21679                       overwri te an exis ting files ystem file , the acti on taken i s as speci fied in th e
  21680                       
  21681         <paramref 
  21682          name="extr actExistin gFile"
  21683         />
  21684          parameter .
  21685                       
  21686        </para>
  21687                     
  21688                      
  21689        <para>
  21690                       For inf ormation o n the synt ax of the  string des cribing th e entry se lection cr iteria,
  21691                       see 
  21692         <see 
  21693          cref="M:Io nic.Zip.Zi pFile.AddS electedFil es(System. String)"
  21694         />
  21695         .
  21696                       
  21697        </para>
  21698                      
  21699       </remarks>
  21700                    
  21701                     
  21702       <example>
  21703                      This ex ample show s how extr act all fi les  with  an XML ext ension or  with  a si ze larger  than 100,0 00 bytes,
  21704                      and put s them in  the unpack  directory .  For any  files tha t already  exist in
  21705                      that de stination  directory,  they will  not be ov erwritten.
  21706                      
  21707        <code>
  21708                       using ( ZipFile zi p = ZipFil e.Read(zip ArchiveNam e))
  21709                       {
  21710                         zip.E xtractSele ctedEntrie s("name =  *.xml  or   size &gt;  100000",
  21711                                                       null,
  21712                                                       "unpack" ,
  21713                                                       ExtractE xistingFil eAction.Do ntOverwrit e);
  21714                       }
  21715                       
  21716        </code>
  21717                      
  21718       </example>
  21719                    
  21720                     
  21721       <param 
  21722        name="sele ctionCrite ria"
  21723       >
  21724        the select ion criter ia for ent ries to ex tract.
  21725       </param>
  21726                    
  21727                     
  21728       <param 
  21729        name="extr actDirecto ry"
  21730       >
  21731                      The dir ectory on  the disk i nto which  to extract . It will  be created  if it doe s not exis t.
  21732                      
  21733       </param>
  21734                    
  21735                     
  21736       <param 
  21737        name="dire ctoryPathI nArchive"
  21738       >
  21739                      The dir ectory in  the archiv e from whi ch to sele ct entries . If null,  then
  21740                      all dir ectories i n the arch ive are us ed.
  21741                      
  21742       </param>
  21743                    
  21744                     
  21745       <param 
  21746        name="extr actExistin gFile"
  21747       >
  21748                      The act ion to tak e if extra ction woul d overwrit e an exist ing file.
  21749                      
  21750       </param>
  21751                    
  21752               
  21753      </member>
  21754              
  21755      <member 
  21756       name="M:Io nic.Zip.Zi pFile.Save SelfExtrac tor(System .String,Io nic.Zip.Se lfExtracto rFlavor)"
  21757      >
  21758                     
  21759       <summary>
  21760                      Saves t he ZipFile  instance  to a self- extracting  zip archi ve.
  21761                      
  21762       </summary>
  21763                    
  21764                     
  21765       <remarks>
  21766                     
  21767                      
  21768        <para>
  21769                       The gen erated exe  image wil l execute  on any mac hine that  has the .N ET
  21770                       Framewo rk 2.0 ins talled on  it.  The g enerated e xe image i s also a
  21771                       valid Z IP file, r eadable wi th DotNetZ ip or anot her Zip li brary or t ool
  21772                       such as  WinZip.
  21773                       
  21774        </para>
  21775                     
  21776                      
  21777        <para>
  21778                       There a re two "fl avors" of  self-extra cting arch ive.  The
  21779                       
  21780         <c>
  21781          WinFormsAp plication
  21782         </c>
  21783          version w ill pop up  a GUI and  allow the
  21784                       user to  select a  target dir ectory int o which to  extract.  There's al so
  21785                       a check box allowi ng the use r to speci fy to over write exis ting files ,
  21786                       and ano ther check box to all ow the use r to reque st that Ex plorer be
  21787                       opened  to see the  extracted  files aft er extract ion.  The  other flav or
  21788                       is 
  21789         <c>
  21790          ConsoleApp lication
  21791         </c>
  21792         .  A self- extractor  generated  with that
  21793                       flavor  setting wi ll run fro m the comm and line.  It accepts  command-l ine
  21794                       options  to set th e overwrit e behavior , and to s pecify the  target
  21795                       extract ion direct ory.
  21796                       
  21797        </para>
  21798                     
  21799                      
  21800        <para>
  21801                       There a re a few t emporary f iles creat ed during  the saving  to a
  21802                       self-ex tracting z ip.  These  files are  created i n the dire ctory poin ted
  21803                       to by 
  21804         <see 
  21805          cref="P:Io nic.Zip.Zi pFile.Temp FileFolder "
  21806         />
  21807         , which de faults to 
  21808         <see 
  21809          cref="M:Sy stem.IO.Pa th.GetTemp Path"
  21810         />
  21811         .  These t emporary f iles are
  21812                       removed  upon succ essful com pletion of  this meth od.
  21813                       
  21814        </para>
  21815                     
  21816                      
  21817        <para>
  21818                       When a  user runs  the WinFor ms SFX, th e user's p ersonal di rectory (
  21819         <see 
  21820          cref="F:Sy stem.Envir onment.Spe cialFolder .Personal"
  21821         >
  21822          Environmen t.SpecialF older.Pers onal
  21823         </see>
  21824         )
  21825                       will be  used as t he default  extract l ocation.   If you wan t to set t he
  21826                       default  extract l ocation, y ou should  use the ot her overlo ad of
  21827                       
  21828         <c>
  21829          SaveSelfEx tractor()
  21830         </c>
  21831         / The user  who runs  the SFX wi ll have th e
  21832                       opportu nity to ch ange the e xtract dir ectory bef ore extrac ting. When
  21833                       the use r runs the  Command-L ine SFX, t he user mu st explici tly specif y
  21834                       the dir ectory to  which to e xtract.  T he .NET Fr amework 2. 0 is requi red
  21835                       on the  computer w hen the se lf-extract ing archiv e is run.
  21836                       
  21837        </para>
  21838                     
  21839                      
  21840        <para>
  21841                       NB: Thi s method i s not avai lable in t he version  of DotNet Zip build  for
  21842                       the .NE T Compact  Framework,  nor in th e "Reduced " DotNetZi p library.
  21843                       
  21844        </para>
  21845                     
  21846                      
  21847       </remarks>
  21848                    
  21849                     
  21850       <example>
  21851                      
  21852        <code>
  21853                       string  DirectoryP ath = "c:\ \Documents \\Project7 ";
  21854                       using ( ZipFile zi p = new Zi pFile())
  21855                       {
  21856                           zip .AddDirect ory(Direct oryPath, S ystem.IO.P ath.GetFil eName(Dire ctoryPath) );
  21857                           zip .Comment =  "This wil l be embed ded into a  self-extr acting con sole-based  exe";
  21858                           zip .SaveSelfE xtractor(" archive.ex e", SelfEx tractorFla vor.Consol eApplicati on);
  21859                       }
  21860                       
  21861        </code>
  21862                      
  21863        <code 
  21864         lang="VB"
  21865        >
  21866                       Dim Dir ectoryPath  As String  = "c:\Doc uments\Pro ject7"
  21867                       Using z ip As New  ZipFile()
  21868                           zip .AddDirect ory(Direct oryPath, S ystem.IO.P ath.GetFil eName(Dire ctoryPath) )
  21869                           zip .Comment =  "This wil l be embed ded into a  self-extr acting con sole-based  exe"
  21870                           zip .SaveSelfE xtractor(" archive.ex e", SelfEx tractorFla vor.Consol eApplicati on)
  21871                       End Usi ng
  21872                       
  21873        </code>
  21874                      
  21875       </example>
  21876                    
  21877                     
  21878       <param 
  21879        name="exeT oGenerate"
  21880       >
  21881                        a pat hname, pos sibly full y qualifie d, to be c reated. Ty pically it
  21882                        will  end in an  .exe exten sion.
  21883       </param>
  21884                     
  21885       <param 
  21886        name="flav or"
  21887       >
  21888                        Indic ates wheth er a Winfo rms or Con sole self- extractor  is
  21889                        desir ed. 
  21890       </param>
  21891               
  21892      </member>
  21893              
  21894      <member 
  21895       name="M:Io nic.Zip.Zi pFile.Save SelfExtrac tor(System .String,Io nic.Zip.Se lfExtracto rSaveOptio ns)"
  21896      >
  21897                     
  21898       <summary>
  21899                        Saves  the ZipFi le instanc e to a sel f-extracti ng zip arc hive, usin g
  21900                        the s pecified s ave option s.
  21901                      
  21902       </summary>
  21903                    
  21904                     
  21905       <remarks>
  21906                      
  21907        <para>
  21908                         This  method sav es a self  extracting  archive,  using the  specified  save
  21909                         optio ns. These  options in clude the  flavor of  the SFX, t he default  extract
  21910                         direc tory, the  icon file,  and so on .  See the  documenta tion
  21911                         for 
  21912         <see 
  21913          cref="M:Io nic.Zip.Zi pFile.Save SelfExtrac tor(System .String,Io nic.Zip.Se lfExtracto rFlavor)"
  21914         />
  21915          for more
  21916                         detai ls.
  21917                       
  21918        </para>
  21919                     
  21920                      
  21921        <para>
  21922                         The u ser who ru ns the SFX  will have  the oppor tunity to  change the  extract
  21923                         direc tory befor e extracti ng. If at  the time o f extracti on, the sp ecified
  21924                         direc tory does  not exist,  the SFX w ill create  the direc tory befor e
  21925                         extra cting the  files.
  21926                       
  21927        </para>
  21928                     
  21929                      
  21930       </remarks>
  21931                    
  21932                     
  21933       <example>
  21934                        This  example sa ves a WinF orms-based  self-extr acting arc hive EXE t hat
  21935                        will  use c:\Ext ractHere a s the defa ult extrac t location . The C# c ode
  21936                        shows  syntax fo r .NET 3.0 , which us es an obje ct initial izer for
  21937                        the S elfExtract orOptions  object.
  21938                      
  21939        <code>
  21940                       string  DirectoryP ath = "c:\ \Documents \\Project7 ";
  21941                       using ( ZipFile zi p = new Zi pFile())
  21942                       {
  21943                           zip .AddDirect ory(Direct oryPath, S ystem.IO.P ath.GetFil eName(Dire ctoryPath) );
  21944                           zip .Comment =  "This wil l be embed ded into a  self-extr acting Win Forms-base d exe";
  21945                           var  options =  new SelfE xtractorOp tions
  21946                           {
  21947                             F lavor = Se lfExtracto rFlavor.Wi nFormsAppl ication,
  21948                             D efaultExtr actDirecto ry = "%USE RPROFILE%\ \ExtractHe re",
  21949                             P ostExtract CommandLin e = ExeToR unAfterExt ract,
  21950                             S fxExeWindo wTitle = " My Custom  Window Tit le",
  21951                             R emoveUnpac kedFilesAf terExecute  = true
  21952                           };
  21953                           zip .SaveSelfE xtractor(" archive.ex e", option s);
  21954                       }
  21955                       
  21956        </code>
  21957                      
  21958        <code 
  21959         lang="VB"
  21960        >
  21961                       Dim Dir ectoryPath  As String  = "c:\Doc uments\Pro ject7"
  21962                       Using z ip As New  ZipFile()
  21963                           zip .AddDirect ory(Direct oryPath, S ystem.IO.P ath.GetFil eName(Dire ctoryPath) )
  21964                           zip .Comment =  "This wil l be embed ded into a  self-extr acting con sole-based  exe"
  21965                           Dim  options A s New Self ExtractorO ptions()
  21966                           opt ions.Flavo r = SelfEx tractorFla vor.WinFor msApplicat ion
  21967                           opt ions.Defau ltExtractD irectory =  "%USERPRO FILE%\\Ext ractHere"
  21968                           opt ions.PostE xtractComm andLine =  ExeToRunAf terExtract
  21969                           opt ions.SfxEx eWindowTit le = "My C ustom Wind ow Title"
  21970                           opt ions.Remov eUnpackedF ilesAfterE xecute = T rue
  21971                           zip .SaveSelfE xtractor(" archive.ex e", option s)
  21972                       End Usi ng
  21973                       
  21974        </code>
  21975                      
  21976       </example>
  21977                    
  21978                     
  21979       <param 
  21980        name="exeT oGenerate"
  21981       >
  21982        The name o f the EXE  to generat e.
  21983       </param>
  21984                     
  21985       <param 
  21986        name="opti ons"
  21987       >
  21988        provides t he options  for creat ing the
  21989                      Self-ex tracting a rchive.
  21990       </param>
  21991               
  21992      </member>
  21993              
  21994      <member 
  21995       name="M:Io nic.Zip.Zi pFile.GetE numerator"
  21996      >
  21997                     
  21998       <summary>
  21999                      Generic  IEnumerat or support , for use  of a ZipFi le in an e numeration .
  22000                      
  22001       </summary>
  22002                    
  22003                     
  22004       <remarks>
  22005                      You pro bably do n ot want to  call 
  22006        <c>
  22007         GetEnumera tor
  22008        </c>
  22009         explicitl y. Instead
  22010                      it is i mplicitly  called whe n you use 
  22011        <see 
  22012         langword=" foreach"
  22013        />
  22014         loop in C #, or a
  22015                      
  22016        <c>
  22017         For Each
  22018        </c>
  22019         loop in V B.NET.
  22020                      
  22021       </remarks>
  22022                    
  22023                     
  22024       <example>
  22025                      This ex ample read s a zipfil e of a giv en name, t hen enumer ates the
  22026                      entries  in that z ip file, a nd display s the info rmation ab out each
  22027                      entry o n the Cons ole.
  22028                      
  22029        <code>
  22030                       using ( ZipFile zi p = ZipFil e.Read(zip file))
  22031                       {
  22032                         bool  header = t rue;
  22033                         forea ch (ZipEnt ry e in zi p)
  22034                         {
  22035                           if  (header)
  22036                           {
  22037                               System.Con sole.Write Line("Zipf ile: {0}",  zip.Name) ;
  22038                               System.Con sole.Write Line("Vers ion Needed : 0x{0:X2} ", e.Versi onNeeded);
  22039                               System.Con sole.Write Line("BitF ield: 0x{0 :X2}", e.B itField);
  22040                               System.Con sole.Write Line("Comp ression Me thod: 0x{0 :X2}", e.C ompression Method);
  22041                               System.Con sole.Write Line("\n{1 ,-22} {2,- 6} {3,4}    {4,-8}  { 0}",
  22042                                             "Filena me", "Modi fied", "Si ze", "Rati o", "Packe d");
  22043                               System.Con sole.Write Line(new S ystem.Stri ng('-', 72 ));
  22044                               header = f alse;
  22045                           }
  22046                      
  22047                           Sys tem.Consol e.WriteLin e("{1,-22}  {2,-6} {3 ,4:F0}%    {4,-8}  {0 }",
  22048                                        e .FileName,
  22049                                        e .LastModif ied.ToStri ng("yyyy-M M-dd HH:mm :ss"),
  22050                                        e .Uncompres sedSize,
  22051                                        e .Compressi onRatio,
  22052                                        e .Compresse dSize);
  22053                      
  22054                           e.E xtract();
  22055                         }
  22056                       }
  22057                       
  22058        </code>
  22059                     
  22060                      
  22061        <code 
  22062         lang="VB"
  22063        >
  22064                         Dim Z ipFileToEx tract As S tring = "c :\foo.zip"
  22065                         Using  zip As Zi pFile = Zi pFile.Read (ZipFileTo Extract)
  22066                             D im header  As Boolean  = True
  22067                             D im e As Zi pEntry
  22068                             F or Each e  In zip
  22069                                  If head er Then
  22070                                      Con sole.Write Line("Zipf ile: {0}",  zip.Name)
  22071                                      Con sole.Write Line("Vers ion Needed : 0x{0:X2} ", e.Versi onNeeded)
  22072                                      Con sole.Write Line("BitF ield: 0x{0 :X2}", e.B itField)
  22073                                      Con sole.Write Line("Comp ression Me thod: 0x{0 :X2}", e.C ompression Method)
  22074                                      Con sole.Write Line(ChrW( 10) &amp;  "{1,-22} { 2,-6} {3,4 }   {4,-8}   {0}", _
  22075                                        " Filename",  "Modified ", "Size",  "Ratio",  "Packed" )
  22076                                      Con sole.Write Line(New S tring("-"c , 72))
  22077                                      hea der = Fals e
  22078                                  End If
  22079                                  Console .WriteLine ("{1,-22}  {2,-6} {3, 4:F0}%   { 4,-8}  {0} ", _
  22080                                    e.Fil eName, _
  22081                                    e.Las tModified. ToString(" yyyy-MM-dd  HH:mm:ss" ), _
  22082                                    e.Unc ompressedS ize, _
  22083                                    e.Com pressionRa tio, _
  22084                                    e.Com pressedSiz e )
  22085                                  e.Extra ct
  22086                             N ext
  22087                         End U sing
  22088                       
  22089        </code>
  22090                      
  22091       </example>
  22092                    
  22093                     
  22094       <returns>
  22095        A generic  enumerator  suitable  for use  w ithin a fo reach loop .
  22096       </returns>
  22097               
  22098      </member>
  22099              
  22100      <member 
  22101       name="M:Io nic.Zip.Zi pFile.GetN ewEnum"
  22102      >
  22103                     
  22104       <summary>
  22105                      An IEnu merator, f or use of  a ZipFile  in a forea ch constru ct.
  22106                      
  22107       </summary>
  22108                    
  22109                     
  22110       <remarks>
  22111                      This me thod is in cluded for  COM suppo rt.  An ap plication  generally  does not c all
  22112                      this me thod direc tly.  It i s called i mplicitly  by COM cli ents when  enumeratin g
  22113                      the ent ries in th e ZipFile  instance.   In VBScri pt, this i s done wit h a 
  22114        <c>
  22115         For Each
  22116        </c>
  22117                      stateme nt.  In Ja vascript,  this is do ne with 
  22118        <c>
  22119         new Enumer ator(zipfi le)
  22120        </c>
  22121        .
  22122                      
  22123       </remarks>
  22124                    
  22125                     
  22126       <returns>
  22127                      The IEn umerator o ver the en tries in t he ZipFile .
  22128                      
  22129       </returns>
  22130               
  22131      </member>
  22132              
  22133      <member 
  22134       name="P:Io nic.Zip.Zi pFile.Info "
  22135      >
  22136                     
  22137       <summary>
  22138                        Provi des a huma n-readable  string wi th informa tion about  the ZipFi le.
  22139                      
  22140       </summary>
  22141                    
  22142                     
  22143       <remarks>
  22144                        
  22145        <para>
  22146                           The  informati on string  contains 1 0 lines or  so, about  each ZipE ntry,
  22147                           des cribing wh ether encr yption is  in use, th e compress ed and unc ompressed
  22148                           len gth of the  entry, th e offset o f the entr y, and so  on. As a r esult the
  22149                           inf ormation s tring can  be very lo ng for zip  files tha t contain  many
  22150                           ent ries.
  22151                         
  22152        </para>
  22153                        
  22154        <para>
  22155                           Thi s informat ion is mos tly useful  for diagn ostic purp oses.
  22156                         
  22157        </para>
  22158                      
  22159       </remarks>
  22160               
  22161      </member>
  22162              
  22163      <member 
  22164       name="P:Io nic.Zip.Zi pFile.Full Scan"
  22165      >
  22166                     
  22167       <summary>
  22168                      Indicat es whether  to perfor m a full s can of the  zip file  when readi ng it.
  22169                      
  22170       </summary>
  22171                    
  22172                     
  22173       <remarks>
  22174                     
  22175                      
  22176        <para>
  22177                         You a lmost neve r want to  use this p roperty.
  22178                       
  22179        </para>
  22180                     
  22181                      
  22182        <para>
  22183                         When  reading a  zip file,  if this fl ag is 
  22184         <c>
  22185          true
  22186         </c>
  22187          (
  22188         <c>
  22189          True
  22190         </c>
  22191          in
  22192                         VB),  the entire  zip archi ve will be  scanned a nd searche d for entr ies.
  22193                         For l arge archi ves, this  can take a  very, lon g time. Th e much mor e
  22194                         effic ient defau lt behavio r is to re ad the zip  directory , which is
  22195                         store d at the e nd of the  zip file.  But, in so me cases t he directo ry is
  22196                         corru pted and y ou need to  perform a  full scan  of the zi p file to
  22197                         deter mine the c ontents of  the zip f ile. This  property l ets you do
  22198                         that,  when nece ssary.
  22199                       
  22200        </para>
  22201                     
  22202                      
  22203        <para>
  22204                         This  flag is ef fective on ly when ca lling 
  22205         <see 
  22206          cref="M:Io nic.Zip.Zi pFile.Init ialize(Sys tem.String )"
  22207         />
  22208         . Normally  you would  read a Zi pFile with  the
  22209                         stati
  22210         <see 
  22211          cref="M:Io nic.Zip.Zi pFile.Read (System.St ring)"
  22212         >
  22213          ZipFile.Re ad
  22214         </see>
  22215                         metho d. But you  can't set  the 
  22216         <c>
  22217          FullScan
  22218         </c>
  22219          property  on the
  22220                         
  22221         <c>
  22222          ZipFile
  22223         </c>
  22224          instance  when you u se a stati c factory  method lik e
  22225                         
  22226         <c>
  22227          ZipFile.Re ad
  22228         </c>
  22229         .
  22230                       
  22231        </para>
  22232                     
  22233                      
  22234       </remarks>
  22235                    
  22236                     
  22237       <example>
  22238                     
  22239                        This  example sh ows how to  read a zi p file usi ng the ful l scan app roach,
  22240                        and t hen save i t, thereby  producing  a correct ed zip fil e.
  22241                     
  22242                      
  22243        <code 
  22244         lang="C#"
  22245        >
  22246                       using ( var zip =  new ZipFil e())
  22247                       {
  22248                           zip .FullScan  = true;
  22249                           zip .Initializ e(zipFileN ame);
  22250                           zip .Save(newN ame);
  22251                       }
  22252                       
  22253        </code>
  22254                     
  22255                      
  22256        <code 
  22257         lang="VB"
  22258        >
  22259                       Using z ip As New  ZipFile
  22260                           zip .FullScan  = True
  22261                           zip .Initializ e(zipFileN ame)
  22262                           zip .Save(newN ame)
  22263                       End Usi ng
  22264                       
  22265        </code>
  22266                      
  22267       </example>
  22268                    
  22269               
  22270      </member>
  22271              
  22272      <member 
  22273       name="P:Io nic.Zip.Zi pFile.Sort EntriesBef oreSaving"
  22274      >
  22275                     
  22276       <summary>
  22277                        Wheth er to sort  the ZipEn tries befo re saving  the file.
  22278                      
  22279       </summary>
  22280                    
  22281                     
  22282       <remarks>
  22283                        The d efault is  false.  If  you have  a large nu mber of zi p entries,  the sort
  22284                        alone  can consu me signifi cant time.
  22285                      
  22286       </remarks>
  22287                    
  22288                     
  22289       <example>
  22290                      
  22291        <code 
  22292         lang="C#"
  22293        >
  22294                       using ( var zip =  new ZipFil e())
  22295                       {
  22296                           zip .AddFiles( filesToAdd );
  22297                           zip .SortEntri esBeforeSa ving = tru e;
  22298                           zip .Save(name );
  22299                       }
  22300                       
  22301        </code>
  22302                     
  22303                      
  22304        <code 
  22305         lang="VB"
  22306        >
  22307                       Using z ip As New  ZipFile
  22308                           zip .AddFiles( filesToAdd )
  22309                           zip .SortEntri esBeforeSa ving = Tru e
  22310                           zip .Save(name )
  22311                       End Usi ng
  22312                       
  22313        </code>
  22314                      
  22315       </example>
  22316                    
  22317               
  22318      </member>
  22319              
  22320      <member 
  22321       name="P:Io nic.Zip.Zi pFile.AddD irectoryWi llTraverse ReparsePoi nts"
  22322      >
  22323                     
  22324       <summary>
  22325                        Indic ates wheth er NTFS Re parse Poin ts, like j unctions,  should be
  22326                        trave rsed durin g calls to  
  22327        <c>
  22328         AddDirecto ry()
  22329        </c>
  22330        .
  22331                      
  22332       </summary>
  22333                    
  22334                     
  22335       <remarks>
  22336                        By de fault, cal ls to AddD irectory()  will trav erse NTFS  reparse
  22337                        point s, like mo unted volu mes, and d irectory j unctions.   An exampl e
  22338                        of a  junction i s the "My  Music" dir ectory in  Windows Vi sta.  In s ome
  22339                        cases  you may n ot want Do tNetZip to  traverse  those dire ctories.   In
  22340                        that  case, set  this prope rty to fal se.
  22341                      
  22342       </remarks>
  22343                    
  22344                     
  22345       <example>
  22346                      
  22347        <code 
  22348         lang="C#"
  22349        >
  22350                       using ( var zip =  new ZipFil e())
  22351                       {
  22352                           zip .AddDirect oryWillTra verseRepar sePoints =  false;
  22353                           zip .AddDirect ory(dirToZ ip,"fodder ");
  22354                           zip .Save(zipF ileToCreat e);
  22355                       }
  22356                       
  22357        </code>
  22358                      
  22359       </example>
  22360               
  22361      </member>
  22362              
  22363      <member 
  22364       name="P:Io nic.Zip.Zi pFile.Buff erSize"
  22365      >
  22366                     
  22367       <summary>
  22368                        Size  of the IO  buffer use d while sa ving.
  22369                      
  22370       </summary>
  22371                    
  22372                     
  22373       <remarks>
  22374                     
  22375                      
  22376        <para>
  22377                         First , let me s ay that yo u really d on't need  to bother  with this.   It is
  22378                         here  to allow f or optimiz ations tha t you prob ably won't  make! It  will work
  22379                         fine  if you don 't set or  get this p roperty at  all. Ok?
  22380                       
  22381        </para>
  22382                     
  22383                      
  22384        <para>
  22385                         Now t hat we hav
  22386         <em>
  22387          that
  22388         </em>
  22389          out of th e way, the  fine prin t: This
  22390                         prope rty affect s the size  of the bu ffer that  is used fo r I/O for  each
  22391                         entry  contained  in the zi p file. Wh en a file  is read in  to be com pressed,
  22392                         it us es a buffe r given by  the size  here.  Whe n you upda te a zip f ile, the
  22393                         data  for unmodi fied entri es is copi ed from th e first zi p file to  the
  22394                         other , through  a buffer g iven by th e size her e.
  22395                       
  22396        </para>
  22397                     
  22398                      
  22399        <para>
  22400                         Chang ing the bu ffer size  affects a  few things : first, f or larger  buffer
  22401                         sizes , the memo ry used by  the 
  22402         <c>
  22403          ZipFile
  22404         </c>
  22405         , obviousl y, will be  larger
  22406                         durin g I/O oper ations.  T his may ma ke operati ons faster  for very  much
  22407                         large r files.   Last, for  any given  entry, whe n you use  a larger b uffer
  22408                         there  will be f ewer progr ess events  during I/ O operatio ns, becaus e there's
  22409                         one p rogress ev ent genera ted for ea ch time th e buffer i s filled a nd then
  22410                         empti ed.
  22411                       
  22412        </para>
  22413                     
  22414                      
  22415        <para>
  22416                         The d efault buf fer size i s 8k.  Inc reasing th e buffer s ize may sp eed
  22417                         thing s up as yo u compress  larger fi les.  But  there are  no hard-an d-fast
  22418                         rules  here, eh?   You won' t know til  you test  it.  And t here will  be a
  22419                         limit  where eve r larger b uffers act ually slow  things do wn.  So as  I said
  22420                         in th e beginnin g, it's pr obably bes t if you d on't set o r get this  property
  22421                         at al l.
  22422                       
  22423        </para>
  22424                     
  22425                      
  22426       </remarks>
  22427                    
  22428                     
  22429       <example>
  22430                      This ex ample show s how you  might set  a large bu ffer size  for effici ency when
  22431                      dealing  with zip  entries th at are lar ger than 1 gb.
  22432                      
  22433        <code 
  22434         lang="C#"
  22435        >
  22436                       using ( ZipFile zi p = new Zi pFile())
  22437                       {
  22438                           zip .SaveProgr ess += thi s.zip1_Sav eProgress;
  22439                           zip .AddDirect ory(direct oryToZip,  "");
  22440                           zip .UseZip64W henSaving  = Zip64Opt ion.Always ;
  22441                           zip .BufferSiz e = 65536* 8; // 6553 6 * 8 = 51 2k
  22442                           zip .Save(ZipF ileToCreat e);
  22443                       }
  22444                       
  22445        </code>
  22446                      
  22447       </example>
  22448               
  22449      </member>
  22450              
  22451      <member 
  22452       name="P:Io nic.Zip.Zi pFile.Code cBufferSiz e"
  22453      >
  22454                     
  22455       <summary>
  22456                        Size  of the wor k buffer t o use for  the ZLIB c odec durin g compress ion.
  22457                      
  22458       </summary>
  22459                    
  22460                     
  22461       <remarks>
  22462                        
  22463        <para>
  22464                           Whe n doing ZL IB or Defl ate compre ssion, the  library f ills a buf fer,
  22465                           the n passes i t to the c ompressor  for compre ssion. The n the libr ary
  22466                           rea ds out the  compresse d bytes. T his happen s repeated ly until t here
  22467                           is  no more un compressed  data to c ompress. T his proper ty sets th e
  22468                           siz e of the b uffer that  will be u sed for ch unk-wise c ompression . In
  22469                           ord er for the  setting t o take eff ect, your  applicatio n needs to  set
  22470                           thi s property  before ca lling one  of the 
  22471         <c>
  22472          ZipFile.Sa ve()
  22473         </c>
  22474                           ove rloads.
  22475                         
  22476        </para>
  22477                        
  22478        <para>
  22479                           Set ting this  affects th e performa nce and me mory effic iency of
  22480                           com pression a nd decompr ession. Fo r larger f iles, sett ing this t o a
  22481                           lar ger size m ay improve  compressi on perform ance, but  the exact
  22482                           num bers vary  depending  on availab le memory,  the size  of the str eams
  22483                           you  are compr essing, an d a bunch  of other v ariables.  I don't ha ve
  22484                           goo d firm rec ommendatio ns on how  to set it.   You'll h ave to tes t it
  22485                           you rself. Or  just leave  it alone  and accept  the defau lt.
  22486                         
  22487        </para>
  22488                      
  22489       </remarks>
  22490               
  22491      </member>
  22492              
  22493      <member 
  22494       name="P:Io nic.Zip.Zi pFile.Flat tenFolders OnExtract"
  22495      >
  22496                     
  22497       <summary>
  22498                        Indic ates wheth er extract ed files s hould keep  their pat hs as
  22499                        store d in the z ip archive .
  22500                      
  22501       </summary>
  22502                    
  22503                     
  22504       <remarks>
  22505                       
  22506        <para>
  22507                          This  property  affects Ex traction.   It is not  used when  creating  zip
  22508                          arch ives.
  22509                        
  22510        </para>
  22511                     
  22512                       
  22513        <para>
  22514                          With  this prop erty set t
  22515         <c>
  22516          false
  22517         </c>
  22518         , the defa ult, extra cting entr ies
  22519                          from  a zip fil e will cre ate files  in the fil esystem th at have th e full
  22520                          path  associate d to the e ntry withi n the zip  file.  Wit h this pro perty set
  22521                          to 
  22522         <c>
  22523          true
  22524         </c>
  22525         , extracti ng entries  from the  zip file r esults in  files
  22526                          with  no path:  the folder s are "fla ttened."
  22527                        
  22528        </para>
  22529                     
  22530                       
  22531        <para>
  22532                          An e xample: su ppose the  zip file c ontains en tries /dir ectory1/fi le1.txt an d
  22533                          /dir ectory2/fi le2.txt.   With 
  22534         <c>
  22535          FlattenFol dersOnExtr act
  22536         </c>
  22537          set to fa lse,
  22538                          the  files crea ted will b e \directo ry1\file1. txt and \d irectory2\ file2.txt.
  22539                          With  the prope rty set to  true, the  files cre ated are f ile1.txt a nd file2.t xt.
  22540                        
  22541        </para>
  22542                     
  22543                      
  22544       </remarks>
  22545               
  22546      </member>
  22547              
  22548      <member 
  22549       name="P:Io nic.Zip.Zi pFile.Stra tegy"
  22550      >
  22551                     
  22552       <summary>
  22553                        The c ompression  strategy  to use for  all entri es.
  22554                      
  22555       </summary>
  22556                    
  22557                     
  22558       <remarks>
  22559                        Set t he Strateg y used by  the ZLIB-c ompatible  compressor , when
  22560                        compr essing ent ries using  the DEFLA TE method.  Different  compressi on
  22561                        strat egies work  better on  different  sorts of  data. The  strategy
  22562                        param eter can a ffect the  compressio n ratio an d the spee d of
  22563                        compr ession but  not the c orrectness  of the co mpresssion .  For mor e
  22564                        infor mation see  
  22565        <see 
  22566         cref="T:Io nic.Zlib.C ompression Strategy"
  22567        >
  22568         Ionic.Zlib .Compressi onStrategy
  22569        </see>
  22570        .
  22571                      
  22572       </remarks>
  22573               
  22574      </member>
  22575              
  22576      <member 
  22577       name="P:Io nic.Zip.Zi pFile.Name "
  22578      >
  22579                     
  22580       <summary>
  22581                        The n ame of the  
  22582        <c>
  22583         ZipFile
  22584        </c>
  22585        , on disk.
  22586                      
  22587       </summary>
  22588                    
  22589                     
  22590       <remarks>
  22591                     
  22592                      
  22593        <para>
  22594                         When  the 
  22595         <c>
  22596          ZipFile
  22597         </c>
  22598          instance  was create d by readi ng an arch ive using
  22599                         one o f the 
  22600         <c>
  22601          ZipFile.Re ad
  22602         </c>
  22603          methods,  this prope rty repres ents the n ame
  22604                         of th e zip file  that was  read.  Whe n the 
  22605         <c>
  22606          ZipFile
  22607         </c>
  22608          instance  was
  22609                         creat ed by usin g the no-a rgument co nstructor,  this valu e is 
  22610         <c>
  22611          null
  22612         </c>
  22613                         (
  22614         <c>
  22615          Nothing
  22616         </c>
  22617          in VB).
  22618                       
  22619        </para>
  22620                     
  22621                      
  22622        <para>
  22623                         If yo u use the  no-argumen t construc tor, and y ou then ex plicitly s et this
  22624                         prope rty, when  you call 
  22625         <see 
  22626          cref="M:Io nic.Zip.Zi pFile.Save "
  22627         />
  22628         , this nam e will
  22629                         speci fy the nam e of the z ip file cr eated.  Do ing so is  equivalent  to
  22630                         calli ng 
  22631         <see 
  22632          cref="M:Io nic.Zip.Zi pFile.Save (System.St ring)"
  22633         />
  22634         .  When in stantiatin g a
  22635                         
  22636         <c>
  22637          ZipFile
  22638         </c>
  22639          by readin g from a s tream or b yte array,  the 
  22640         <c>
  22641          Name
  22642         </c>
  22643                         prope rty remain
  22644         <c>
  22645          null
  22646         </c>
  22647         .  When sa ving to a  stream, th
  22648         <c>
  22649          Name
  22650         </c>
  22651                         prope rty is imp licitly se t to 
  22652         <c>
  22653          null
  22654         </c>
  22655         .
  22656                       
  22657        </para>
  22658                      
  22659       </remarks>
  22660               
  22661      </member>
  22662              
  22663      <member 
  22664       name="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  22665      >
  22666                     
  22667       <summary>
  22668                        Sets  the compre ssion leve l to be us ed for ent ries subse quently ad ded to
  22669                        the z ip archive .
  22670                      
  22671       </summary>
  22672                    
  22673                     
  22674       <remarks>
  22675                       
  22676        <para>
  22677                          Vary ing the co mpression  level used  on entrie s can affe ct the
  22678                          size -vs-speed  tradeoff w hen compre ssion and  decompress ing data s treams
  22679                          or f iles.
  22680                        
  22681        </para>
  22682                     
  22683                       
  22684        <para>
  22685                          As w ith some o ther prope rties on t he 
  22686         <c>
  22687          ZipFile
  22688         </c>
  22689          class, li ke 
  22690         <see 
  22691          cref="P:Io nic.Zip.Zi pFile.Pass word"
  22692         />
  22693        
  22694         <see 
  22695          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  22696         />
  22697         , and 
  22698         <see 
  22699          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  22700         />
  22701         , setting  this prope rty on a 
  22702         <c>
  22703          ZipFile
  22704         </c>
  22705                          inst ance will  cause the  specified 
  22706         <c>
  22707          Compressio nLevel
  22708         </c>
  22709          to be use d on all
  22710                          
  22711         <see 
  22712          cref="T:Io nic.Zip.Zi pEntry"
  22713         />
  22714          items tha t are subs equently a dded to th e
  22715                          
  22716         <c>
  22717          ZipFile
  22718         </c>
  22719          instance.  If you se t this pro perty afte r you have  added
  22720                          item s to the 
  22721         <c>
  22722          ZipFile
  22723         </c>
  22724         , but befo re you hav e called 
  22725         <c>
  22726          Save()
  22727         </c>
  22728         ,
  22729                          thos e items wi ll not use  the speci fied compr ession lev el.
  22730                        
  22731        </para>
  22732                     
  22733                       
  22734        <para>
  22735                          If y ou do not  set this p roperty, t he default  compressi on level i s used,
  22736                          whic h normally  gives a g ood balanc e of compr ession eff iciency an d
  22737                          comp ression sp eed.  In s ome tests,  using 
  22738         <c>
  22739          BestCompre ssion
  22740         </c>
  22741          can
  22742                          doub le the tim e it takes  to compre ss, while  delivering  just a sm all
  22743                          incr ease in co mpression  efficiency .  This be havior wil l vary wit h the
  22744                          type  of data y ou compres s.  If you  are in do ubt, just  leave this  setting
  22745                          alon e, and acc ept the de fault.
  22746                        
  22747        </para>
  22748                      
  22749       </remarks>
  22750               
  22751      </member>
  22752              
  22753      <member 
  22754       name="P:Io nic.Zip.Zi pFile.Comp ressionMet hod"
  22755      >
  22756                    
  22757       <summary>
  22758                       The co mpression  method for  the zipfi le.
  22759                     
  22760       </summary>
  22761                    
  22762       <remarks>
  22763                       
  22764        <para>
  22765                          By d efault, th e compress ion method  is 
  22766         <c>
  22767          Compressio nMethod.De flate.
  22768         </c>
  22769                        
  22770        </para>
  22771                     
  22772       </remarks>
  22773                    
  22774       <seealso 
  22775        cref="T:Io nic.Zip.Co mpressionM ethod"
  22776       />
  22777               
  22778      </member>
  22779              
  22780      <member 
  22781       name="P:Io nic.Zip.Zi pFile.Comm ent"
  22782      >
  22783                     
  22784       <summary>
  22785                        A com ment attac hed to the  zip archi ve.
  22786                      
  22787       </summary>
  22788                    
  22789                     
  22790       <remarks>
  22791                     
  22792                      
  22793        <para>
  22794                         This  property i s read/wri te. It all ows the ap plication  to specify  a
  22795                         comme nt for the  
  22796         <c>
  22797          ZipFile
  22798         </c>
  22799         , or read  the commen t for the
  22800                         
  22801         <c>
  22802          ZipFile
  22803         </c>
  22804         .  After s etting thi s property , changes  are only m ade
  22805                         perma nent when  you call a  
  22806         <c>
  22807          Save()
  22808         </c>
  22809          method.
  22810                       
  22811        </para>
  22812                     
  22813                      
  22814        <para>
  22815                         Accor ding to 
  22816         <see 
  22817          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  22818         >
  22819          PKWARE's
  22820                          zip s pecificati on
  22821         </see>
  22822         , the comm ent is not  encrypted , even if  there is a
  22823                         passw ord set on  the zip f ile.
  22824                       
  22825        </para>
  22826                     
  22827                      
  22828        <para>
  22829                         The s pecificati on does no t describe  how to in dicate the  encoding  used
  22830                         on a  comment st ring. Many  "complian t" zip too ls and lib raries use
  22831                         IBM43 7 as the c ode page f or comment s; DotNetZ ip, too, f ollows tha t
  22832                         pract ice.  On t he other h and, there  are situa tions wher e you want  a
  22833                         Comme nt to be e ncoded wit h somethin g else, fo r example  using code  page
  22834                         950 " Big-5 Chin ese". To f ill that n eed, DotNe tZip will  encode the
  22835                         comme nt followi ng the sam e procedur e it follo ws for enc oding
  22836                         filen ames: (a)  if 
  22837         <see 
  22838          cref="P:Io nic.Zip.Zi pFile.Alte rnateEncod ingUsage"
  22839         />
  22840          is
  22841                         
  22842         <c>
  22843          Never
  22844         </c>
  22845         , it uses  the defaul t encoding  (IBM437).  (b) if 
  22846         <see 
  22847          cref="P:Io nic.Zip.Zi pFile.Alte rnateEncod ingUsage"
  22848         />
  22849          is 
  22850         <c>
  22851          Always
  22852         </c>
  22853         , it alway s uses the
  22854                         alter nate encod ing (
  22855         <see 
  22856          cref="P:Io nic.Zip.Zi pFile.Alte rnateEncod ing"
  22857         />
  22858         ). (c) if 
  22859         <see 
  22860          cref="P:Io nic.Zip.Zi pFile.Alte rnateEncod ingUsage"
  22861         />
  22862          is 
  22863         <c>
  22864          AsNecessar y
  22865         </c>
  22866         , it uses  the
  22867                         alter nate encod ing only i f the defa ult encodi ng is not  sufficient  for
  22868                         encod ing the co mment - in  other wor ds if deco ding the r esult does  not
  22869                         produ ce the ori ginal stri ng.  This  decision i s taken at  the time  of
  22870                         the c all to 
  22871         <c>
  22872          ZipFile.Sa ve()
  22873         </c>
  22874         .
  22875                       
  22876        </para>
  22877                     
  22878                      
  22879        <para>
  22880                         When  creating a  zip archi ve using t his librar y, it is p ossible to  change
  22881                         the v alue of 
  22882         <see 
  22883          cref="P:Io nic.Zip.Zi pFile.Alte rnateEncod ing"
  22884         />
  22885          between e ach
  22886                         entry  you add,  and betwee n adding e ntries and  the call  to
  22887                         
  22888         <c>
  22889          Save()
  22890         </c>
  22891         . Don't do  this.  It  will like ly result  in a zip f ile that i s
  22892                         not r eadable by  any tool  or applica tion.  For  best inte roperabili ty, leave
  22893                         
  22894         <see 
  22895          cref="P:Io nic.Zip.Zi pFile.Alte rnateEncod ing"
  22896         />
  22897          alone, or  specify i t only
  22898                         once,  before ad ding any e ntries to  the 
  22899         <c>
  22900          ZipFile
  22901         </c>
  22902          instance.
  22903                       
  22904        </para>
  22905                     
  22906                      
  22907       </remarks>
  22908               
  22909      </member>
  22910              
  22911      <member 
  22912       name="P:Io nic.Zip.Zi pFile.Emit TimesInWin dowsFormat WhenSaving "
  22913      >
  22914                     
  22915       <summary>
  22916                        Speci fies wheth er the Cre ation, Acc ess, and M odified ti mes for en tries
  22917                        added  to the zi p file wil l be emitt ed in Â“Wi ndows form at”
  22918                        when  the zip ar chive is s aved.
  22919                      
  22920       </summary>
  22921                    
  22922                     
  22923       <remarks>
  22924                      
  22925        <para>
  22926                         An ap plication  creating a  zip archi ve can use  this flag  to explic itly
  22927                         speci fy that th e file tim es for the  entries s hould or s hould not  be stored
  22928                         in th e zip arch ive in the  format us ed by Wind ows. By de fault this  flag is
  22929                         
  22930         <c>
  22931          true
  22932         </c>
  22933         , meaning  the Window s-format t imes are s tored in t he zip
  22934                         archi ve.
  22935                       
  22936        </para>
  22937                     
  22938                      
  22939        <para>
  22940                         When  adding an  entry from  a file or  directory , the Crea tion (
  22941         <see 
  22942          cref="P:Io nic.Zip.Zi pEntry.Cre ationTime"
  22943         />
  22944         ), Access  (
  22945         <see 
  22946          cref="P:Io nic.Zip.Zi pEntry.Acc essedTime"
  22947         />
  22948         ), and Mod ified (
  22949         <see 
  22950          cref="P:Io nic.Zip.Zi pEntry.Mod ifiedTime"
  22951         />
  22952         ) times fo r the give n entry ar e
  22953                         autom atically s et from th e filesyst em values.  When addi ng an entr y from a
  22954                         strea m or strin g, all thr ee values  are implic itly set t o
  22955                         
  22956         <c>
  22957          DateTime.N ow
  22958         </c>
  22959         .  Applica tions can  also expli citly set  those time s by
  22960                         calli ng 
  22961         <see 
  22962          cref="M:Io nic.Zip.Zi pEntry.Set EntryTimes (System.Da teTime,Sys tem.DateTi me,System. DateTime)"
  22963         />
  22964         .
  22965                       
  22966        </para>
  22967                     
  22968                      
  22969        <para>
  22970                         
  22971         <see 
  22972          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  22973         >
  22974          PKWARE's
  22975                          zip s pecificati on
  22976         </see>
  22977          describes  multiple  ways to fo rmat these  times in  a
  22978                         zip f ile. One i s the form at Windows  applicati ons normal ly use: 10 0ns ticks
  22979                         since  January 1 , 1601 UTC .  The oth er is a fo rmat Unix  applicatio ns typical ly
  22980                         use:  seconds si nce Januar y 1, 1970  UTC.  Each  format ca n be store d in an
  22981                         "extr a field" i n the zip  entry when  saving th e zip arch ive. The f ormer
  22982                         uses  an extra f ield with  a Header I d of 0x000 A, while t he latter  uses a
  22983                         heade r ID of 0x 5455, alth ough you p robably do n't need t o know tha t.
  22984                       
  22985        </para>
  22986                     
  22987                      
  22988        <para>
  22989                         Not a ll tools a nd librari es can int erpret the se fields.   Windows
  22990                         compr essed fold ers is one  that can  read the W indows For mat timest amps,
  22991                         while  I believe  
  22992         <see 
  22993          href="http ://www.inf o-zip.org/ "
  22994         >
  22995          the Infozi p
  22996                          tools
  22997         </see>
  22998          can read  the Unix f ormat time stamps. So me tools a nd librari es
  22999                         may b e able to  read only  one or the  other. Do tNetZip ca n read or  write
  23000                         times  in either  or both f ormats.
  23001                       
  23002        </para>
  23003                     
  23004                      
  23005        <para>
  23006                         The t imes store d are take n from 
  23007         <see 
  23008          cref="P:Io nic.Zip.Zi pEntry.Mod ifiedTime"
  23009         />
  23010        
  23011         <see 
  23012          cref="P:Io nic.Zip.Zi pEntry.Acc essedTime"
  23013         />
  23014         , and 
  23015         <see 
  23016          cref="P:Io nic.Zip.Zi pEntry.Cre ationTime"
  23017         />
  23018         .
  23019                       
  23020        </para>
  23021                     
  23022                      
  23023        <para>
  23024                         The v alue set h ere applie s to all e ntries sub sequently  added to t he
  23025                         
  23026         <c>
  23027          ZipFile
  23028         </c>
  23029         .
  23030                       
  23031        </para>
  23032                     
  23033                      
  23034        <para>
  23035                         This  property i s not mutu ally exclu sive of th
  23036         <see 
  23037          cref="P:Io nic.Zip.Zi pFile.Emit TimesInUni xFormatWhe nSaving"
  23038         />
  23039          property.  It is pos sible and
  23040                         legal  and valid  to produc e a zip fi le that co ntains tim estamps en coded in
  23041                         the U nix format  as well a s in the W indows for mat, in ad dition to  the 
  23042         <see 
  23043          cref="P:Io nic.Zip.Zi pEntry.Las tModified"
  23044         >
  23045          LastModifi ed
  23046         </see>
  23047          time atta ched to ea ch
  23048                         entry  in the ar chive, a t ime that i s always s tored in " DOS format ". And,
  23049                         notwi thstanding  the names  PKWare us es for the se time fo rmats, any  of them
  23050                         can b e read and  written b y any comp uter, on a ny operati ng system.   But,
  23051                         there  are no gu arantees t hat a prog ram runnin g on Mac o r Linux wi ll
  23052                         grace fully hand le a zip f ile with " Windows" f ormatted t imes, or t hat an
  23053                         appli cation tha t does not  use DotNe tZip but r uns on Win dows will  be able to
  23054                         handl e file tim es in Unix  format.
  23055                       
  23056        </para>
  23057                     
  23058                      
  23059        <para>
  23060                         When  in doubt,  test.  Sor ry, I have n't got a  complete l ist of too ls and
  23061                         which  sort of t imestamps  they can u se and wil l tolerate .  If you  get any
  23062                         good  informatio n and woul d like to  pass it on , please d o so and I  will
  23063                         inclu de that in formation  in this do cumentatio n.
  23064                       
  23065        </para>
  23066                      
  23067       </remarks>
  23068                    
  23069                     
  23070       <example>
  23071                        This  example sh ows how to  save a zi p file tha t contains  file time stamps
  23072                        in a  format nor mally used  by Unix.
  23073                      
  23074        <code 
  23075         lang="C#"
  23076        >
  23077                       using ( var zip =  new ZipFil e())
  23078                       {
  23079                           //  produce a  zip file t he Mac wil l like
  23080                           zip .EmitTimes InWindowsF ormatWhenS aving = fa lse;
  23081                           zip .EmitTimes InUnixForm atWhenSavi ng = true;
  23082                           zip .AddDirect ory(direct oryToZip,  "files");
  23083                           zip .Save(outp utFile);
  23084                       }
  23085                       
  23086        </code>
  23087                     
  23088                      
  23089        <code 
  23090         lang="VB"
  23091        >
  23092                       Using z ip As New  ZipFile
  23093                           ''  produce a  zip file t he Mac wil l like
  23094                           zip .EmitTimes InWindowsF ormatWhenS aving = Fa lse
  23095                           zip .EmitTimes InUnixForm atWhenSavi ng = True
  23096                           zip .AddDirect ory(direct oryToZip,  "files")
  23097                           zip .Save(outp utFile)
  23098                       End Usi ng
  23099                       
  23100        </code>
  23101                      
  23102       </example>
  23103                    
  23104                     
  23105       <seealso 
  23106        cref="P:Io nic.Zip.Zi pEntry.Emi tTimesInWi ndowsForma tWhenSavin g"
  23107       />
  23108                     
  23109       <seealso 
  23110        cref="P:Io nic.Zip.Zi pFile.Emit TimesInUni xFormatWhe nSaving"
  23111       />
  23112               
  23113      </member>
  23114              
  23115      <member 
  23116       name="P:Io nic.Zip.Zi pFile.Emit TimesInUni xFormatWhe nSaving"
  23117      >
  23118                     
  23119       <summary>
  23120                      Specifi es whether  the Creat ion, Acces s, and Mod ified time s
  23121                      for ent ries added  to the zi p file wil l be emitt ed in "Uni x(tm)
  23122                      format"  when the  zip archiv e is saved .
  23123                      
  23124       </summary>
  23125                    
  23126                     
  23127       <remarks>
  23128                      
  23129        <para>
  23130                         An ap plication  creating a  zip archi ve can use  this flag  to explic itly
  23131                         speci fy that th e file tim es for the  entries s hould or s hould not  be stored
  23132                         in th e zip arch ive in the  format us ed by Unix . By defau lt this fl ag is
  23133                         
  23134         <c>
  23135          false
  23136         </c>
  23137         , meaning  the Unix-f ormat time s are not  stored in  the zip
  23138                         archi ve.
  23139                       
  23140        </para>
  23141                     
  23142                      
  23143        <para>
  23144                         When  adding an  entry from  a file or  directory , the Crea tion (
  23145         <see 
  23146          cref="P:Io nic.Zip.Zi pEntry.Cre ationTime"
  23147         />
  23148         ), Access  (
  23149         <see 
  23150          cref="P:Io nic.Zip.Zi pEntry.Acc essedTime"
  23151         />
  23152         ), and Mod ified (
  23153         <see 
  23154          cref="P:Io nic.Zip.Zi pEntry.Mod ifiedTime"
  23155         />
  23156         ) times fo r the give n entry ar e
  23157                         autom atically s et from th e filesyst em values.  When addi ng an entr y from a
  23158                         strea m or strin g, all thr ee values  are implic itly set t o DateTime .Now.
  23159                         Appli cations ca n also exp licitly se t those ti mes by cal ling 
  23160         <see 
  23161          cref="M:Io nic.Zip.Zi pEntry.Set EntryTimes (System.Da teTime,Sys tem.DateTi me,System. DateTime)"
  23162         />
  23163         .
  23164                       
  23165        </para>
  23166                     
  23167                      
  23168        <para>
  23169                         
  23170         <see 
  23171          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  23172         >
  23173          PKWARE's
  23174                          zip s pecificati on
  23175         </see>
  23176          describes  multiple  ways to fo rmat these  times in  a
  23177                         zip f ile. One i s the form at Windows  applicati ons normal ly use: 10 0ns ticks
  23178                         since  January 1 , 1601 UTC .  The oth er is a fo rmat Unix  applicatio ns
  23179                         typic ally use:  seconds si nce Januar y 1, 1970  UTC.  Each  format ca n be
  23180                         store d in an "e xtra field " in the z ip entry w hen saving  the zip
  23181                         archi ve. The fo rmer uses  an extra f ield with  a Header I d of 0x000 A, while
  23182                         the l atter uses  a header  ID of 0x54 55, althou gh you pro bably don' t need to
  23183                         know  that.
  23184                       
  23185        </para>
  23186                     
  23187                      
  23188        <para>
  23189                         Not a ll tools a nd librari es can int erpret the se fields.   Windows
  23190                         compr essed fold ers is one  that can  read the W indows For mat timest amps,
  23191                         while  I believe  the 
  23192         <see 
  23193          href="http ://www.inf o-zip.org/ "
  23194         >
  23195          Infozip
  23196         </see>
  23197                         tools  can read  the Unix f ormat time stamps. So me tools a nd librari es may be
  23198                         able  to read on ly one or  the other.   DotNetZi p can read  or write  times in
  23199                         eithe r or both  formats.
  23200                       
  23201        </para>
  23202                     
  23203                      
  23204        <para>
  23205                         The t imes store d are take n from 
  23206         <see 
  23207          cref="P:Io nic.Zip.Zi pEntry.Mod ifiedTime"
  23208         />
  23209        
  23210         <see 
  23211          cref="P:Io nic.Zip.Zi pEntry.Acc essedTime"
  23212         />
  23213         , and 
  23214         <see 
  23215          cref="P:Io nic.Zip.Zi pEntry.Cre ationTime"
  23216         />
  23217         .
  23218                       
  23219        </para>
  23220                     
  23221                      
  23222        <para>
  23223                         This  property i s not mutu ally exclu sive of th
  23224         <see 
  23225          cref="P:Io nic.Zip.Zi pFile.Emit TimesInWin dowsFormat WhenSaving "
  23226         />
  23227          property.  It is pos sible and
  23228                         legal  and valid  to produc e a zip fi le that co ntains tim estamps en coded in
  23229                         the U nix format  as well a s in the W indows for mat, in ad dition to  the 
  23230         <see 
  23231          cref="P:Io nic.Zip.Zi pEntry.Las tModified"
  23232         >
  23233          LastModifi ed
  23234         </see>
  23235          time atta ched to ea ch
  23236                         entry  in the zi p archive,  a time th at is alwa ys stored  in "DOS
  23237                         forma t". And, n otwithstan ding the n ames PKWar e uses for  these tim e
  23238                         forma ts, any of  them can  be read an d written  by any com puter, on  any
  23239                         opera ting syste m.  But, t here are n o guarante es that a  program ru nning on
  23240                         Mac o r Linux wi ll gracefu lly handle  a zip fil e with "Wi ndows" for matted
  23241                         times , or that  an applica tion that  does not u se DotNetZ ip but run s on
  23242                         Windo ws will be  able to h andle file  times in  Unix forma t.
  23243                       
  23244        </para>
  23245                     
  23246                      
  23247        <para>
  23248                         When  in doubt,  test.  Sor ry, I have n't got a  complete l ist of too ls and
  23249                         which  sort of t imestamps  they can u se and wil l tolerate .  If you  get any
  23250                         good  informatio n and woul d like to  pass it on , please d o so and I  will
  23251                         inclu de that in formation  in this do cumentatio n.
  23252                       
  23253        </para>
  23254                      
  23255       </remarks>
  23256                    
  23257                     
  23258       <seealso 
  23259        cref="P:Io nic.Zip.Zi pEntry.Emi tTimesInUn ixFormatWh enSaving"
  23260       />
  23261                     
  23262       <seealso 
  23263        cref="P:Io nic.Zip.Zi pFile.Emit TimesInWin dowsFormat WhenSaving "
  23264       />
  23265               
  23266      </member>
  23267              
  23268      <member 
  23269       name="P:Io nic.Zip.Zi pFile.Verb ose"
  23270      >
  23271                     
  23272       <summary>
  23273                        Indic ates wheth er verbose  output is  sent to t he 
  23274        <see 
  23275         cref="P:Io nic.Zip.Zi pFile.Stat usMessageT extWriter"
  23276        />
  23277         during 
  23278        <c>
  23279         AddXxx()
  23280        </c>
  23281         and
  23282                        
  23283        <c>
  23284         ReadXxx()
  23285        </c>
  23286         operation s.
  23287                      
  23288       </summary>
  23289                    
  23290                     
  23291       <remarks>
  23292                        This  is a 
  23293        <em>
  23294         synthetic
  23295        </em>
  23296         property.   It retur ns true if  the 
  23297        <see 
  23298         cref="P:Io nic.Zip.Zi pFile.Stat usMessageT extWriter"
  23299        />
  23300         is non-nu ll.
  23301                      
  23302       </remarks>
  23303               
  23304      </member>
  23305              
  23306      <member 
  23307       name="P:Io nic.Zip.Zi pFile.Case SensitiveR etrieval"
  23308      >
  23309                     
  23310       <summary>
  23311                        Indic ates wheth er to perf orm case-s ensitive m atching on  the filen ame when
  23312                        retri eving entr ies in the  zipfile v ia the str ing-based  indexer.
  23313                      
  23314       </summary>
  23315                    
  23316                     
  23317       <remarks>
  23318                        The d efault val ue is 
  23319        <c>
  23320         false
  23321        </c>
  23322        , which me ans don't  do case-se nsitive
  23323                        match ing. In ot her words,  retrievin g zip["Rea dMe.Txt"]  is the sam e as
  23324                        zip[" readme.txt "].  It re ally makes  sense to  set this t
  23325        <c>
  23326         true
  23327        </c>
  23328         only
  23329                        if yo u are not  running on  Windows,  which has  case-insen sitive
  23330                        filen ames. But  since this  library i s not buil t for non- Windows pl atforms,
  23331                        in mo st cases y ou should  just leave  this prop erty alone .
  23332                      
  23333       </remarks>
  23334               
  23335      </member>
  23336              
  23337      <member 
  23338       name="P:Io nic.Zip.Zi pFile.UseU nicodeAsNe cessary"
  23339      >
  23340                     
  23341       <summary>
  23342                        Indic ates wheth er to enco de entry f ilenames a nd entry c omments us ing Unicod e
  23343                        (UTF- 8).
  23344                      
  23345       </summary>
  23346                    
  23347                     
  23348       <remarks>
  23349                      
  23350        <para>
  23351                         
  23352         <see 
  23353          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  23354         >
  23355          The
  23356                          PKWar e zip spec ification
  23357         </see>
  23358          provides  for encodi ng file na mes and fi le
  23359                         comme nts in eit her the IB M437 code  page, or i n UTF-8.   This flag  selects
  23360                         the e ncoding ac cording to  that spec ification.   By defau lt, this f lag is
  23361                         false , and file names and  comments a re encoded  into the  zip file i n the
  23362                         IBM43 7 codepage .  Setting  this flag  to true w ill specif y that fil enames
  23363                         and c omments th at cannot  be encoded  with IBM4 37 will be  encoded w ith
  23364                         UTF-8 .
  23365                       
  23366        </para>
  23367                     
  23368                      
  23369        <para>
  23370                         Zip f iles creat ed with st rict adher ence to th e PKWare s pecificati on with
  23371                         respe ct to UTF- 8 encoding  can conta in entries  with file names cont aining
  23372                         any c ombination  of Unicod e characte rs, includ ing the fu ll range o f
  23373                         chara cters from  Chinese,  Latin, Heb rew, Greek , Cyrillic , and many  other
  23374                         alpha bets.  How ever, beca use at thi s time, th e UTF-8 po rtion of t he PKWare
  23375                         speci fication i s not broa dly suppor ted by oth er zip lib raries and
  23376                         utili ties, such  zip files  may not b e readable  by your f avorite zi p tool or
  23377                         archi ver. In ot her words,  interoper ability wi ll decreas e if you s et this
  23378                         flag  to true.
  23379                       
  23380        </para>
  23381                     
  23382                      
  23383        <para>
  23384                         In pa rticular,  Zip files  created wi th strict  adherence  to the PKW are
  23385                         speci fication w ith respec t to UTF-8  encoding  will not w ork well w ith
  23386                         Explo rer in Win dows XP or  Windows V ista, beca use Window s compress ed
  23387                         folde rs, as far  as I know , do not s upport UTF -8 in zip  files.  Vi sta can
  23388                         read  the zip fi les, but s hows the f ilenames i ncorrectly . Unpackin g from
  23389                         Windo ws Vista E xplorer wi ll result  in filenam es that ha ve rubbish
  23390                         chara cters in p lace of th e high-ord er UTF-8 b ytes.
  23391                       
  23392        </para>
  23393                     
  23394                      
  23395        <para>
  23396                         Also,  zip files  that use  UTF-8 enco ding will  not work w ell with J ava
  23397                         appli cations th at use the  java.util .zip class es, as of  v5.0 of th e Java
  23398                         runti me. The Ja va runtime  does not  correctly  implement  the PKWare
  23399                         speci fication i n this reg ard.
  23400                       
  23401        </para>
  23402                     
  23403                      
  23404        <para>
  23405                         As a  result, we  have the  unfortunat e situatio n that "co rrect" beh avior by
  23406                         the D otNetZip l ibrary wit h regard t o Unicode  encoding o f filename s during
  23407                         zip c reation wi ll result  in zip fil es that ar e readable  by strict ly
  23408                         compl iant and c urrent too ls (for ex ample the  most recen t release  of the
  23409                         comme rcial WinZ ip tool);  but these  zip files  will not b e readable  by
  23410                         vario us other t ools or li braries, i ncluding W indows Exp lorer.
  23411                       
  23412        </para>
  23413                     
  23414                      
  23415        <para>
  23416                         The D otNetZip l ibrary can  read and  write zip  files with  UTF8-enco ded
  23417                         entri es, accord ing to the  PKware sp ec.  If yo u use DotN etZip for  both
  23418                         creat ing and re ading the  zip file,  and you us e UTF-8, t here will  be no
  23419                         loss  of informa tion in th e filename s. For exa mple, usin g a self-e xtractor
  23420                         creat ed by this  library w ill allow  you to unp ack files  correctly  with no
  23421                         loss  of informa tion in th e filename s.
  23422                       
  23423        </para>
  23424                     
  23425                      
  23426        <para>
  23427                         If yo u do not s et this fl ag, it wil l remain f alse.  If  this flag  is false,
  23428                         your 
  23429         <c>
  23430          ZipFile
  23431         </c>
  23432          will enco de all fil enames and  comments  using the
  23433                         IBM43 7 codepage .  This ca n cause "l oss of inf ormation"  on some fi lenames,
  23434                         but t he resulti ng zipfile  will be m ore intero perable wi th other
  23435                         utili ties. As a n example  of the los s of infor mation, di acritics c an be
  23436                         lost.   The o-ti lde charac ter will b e down-cod ed to plai n o.  The  c with a
  23437                         cedil la (Unicod e 0xE7) us ed in Port ugese will  be downco ded to a c .
  23438                         Likew ise, the O -stroke ch aracter (U nicode 248 ), used in  Danish an d
  23439                         Norwe gian, will  be down-c oded to pl ain o. Chi nese chara cters cann ot be
  23440                         repre sented in  codepage I BM437; whe n using th e default  encoding,  Chinese
  23441                         chara cters in f ilenames w ill be rep resented a s ?. These  are all e xamples
  23442                         of "i nformation  loss".
  23443                       
  23444        </para>
  23445                     
  23446                      
  23447        <para>
  23448                         The l oss of inf ormation a ssociated  to the use  of the IB M437 encod ing is
  23449                         incon venient, a nd can als o lead to  runtime er rors. For  example, u sing
  23450                         IBM43 7, any seq uence of 4  Chinese c haracters  will be en coded as ? ???.  If
  23451                         your  applicatio n creates 
  23452         <c>
  23453          ZipFile
  23454         </c>
  23455         , then add s two file s, each wi th
  23456                         names  of four C hinese cha racters ea ch, this w ill result  in a dupl icate
  23457                         filen ame except ion.  In t he case wh ere you ad d a single  file with  a name
  23458                         conta ining four  Chinese c haracters,  calling E xtract() o n the entr y that
  23459                         has q uestion ma rks in the  filename  will resul t in an ex ception, b ecause
  23460                         the q uestion ma rk is not  legal for  use within  filenames  on Window s.  These
  23461                         are j ust a few  examples o f the prob lems assoc iated to l oss of inf ormation.
  23462                       
  23463        </para>
  23464                     
  23465                      
  23466        <para>
  23467                         This  flag is in dependent  of the enc oding of t he content  within th e entries
  23468                         in th e zip file . Think of  the zip f ile as a c ontainer -  it suppor ts an
  23469                         encod ing.  With in the con tainer are  other "co ntainers"  - the file  entries
  23470                         thems elves.  Th e encoding  within th ose entrie s is indep endent of  the
  23471                         encod ing of the  zip archi ve contain er for tho se entries .
  23472                       
  23473        </para>
  23474                     
  23475                      
  23476        <para>
  23477                         Rathe r than spe cify the e ncoding in  a binary  fashion us ing this f lag, an
  23478                         appli cation can  specify a n arbitrar y encoding  via the 
  23479         <see 
  23480          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  23481         />
  23482          property.   Setting  the encodi ng
  23483                         expli citly when  creating  zip archiv es will re sult in no n-complian t zip
  23484                         files  that, cur iously, ar e fairly i nteroperab le.  The c hallenge i s, the
  23485                         PKWar e specific ation does  not provi de for a w ay to spec ify that a n entry
  23486                         in a  zip archiv e uses a c ode page t hat is nei ther IBM43 7 nor UTF- 8.
  23487                         There fore if yo u set the  encoding e xplicitly  when creat ing a zip  archive,
  23488                         you m ust take c are upon r eading the  zip archi ve to use  the same c ode page.
  23489                         If yo u get it w rong, the  behavior i s undefine d and may  result in  incorrect
  23490                         filen ames, exce ptions, st omach upse t, hair lo ss, and ac ne.
  23491                       
  23492        </para>
  23493                      
  23494       </remarks>
  23495                     
  23496       <seealso 
  23497        cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  23498       />
  23499               
  23500      </member>
  23501              
  23502      <member 
  23503       name="P:Io nic.Zip.Zi pFile.UseZ ip64WhenSa ving"
  23504      >
  23505                     
  23506       <summary>
  23507                        Speci fy whether  to use ZI P64 extens ions when  saving a z ip archive .
  23508                      
  23509       </summary>
  23510                    
  23511                     
  23512       <remarks>
  23513                     
  23514                      
  23515        <para>
  23516                         When  creating a  zip file,  the defau lt value f or the pro perty is 
  23517         <see 
  23518          cref="F:Io nic.Zip.Zi p64Option. Never"
  23519         />
  23520        
  23521         <see 
  23522          cref="F:Io nic.Zip.Zi p64Option. AsNecessar y"
  23523         />
  23524          is
  23525                         safes t, in the  sense that  you will  not get an  Exception  if a pre- ZIP64
  23526                         limit  is exceed ed.
  23527                       
  23528        </para>
  23529                     
  23530                      
  23531        <para>
  23532                         You m ay set the  property  at any tim e before c alling Sav e().
  23533                       
  23534        </para>
  23535                     
  23536                      
  23537        <para>
  23538                         When  reading a  zip file v ia the 
  23539         <c>
  23540          Zipfile.Re ad()
  23541         </c>
  23542          method, D otNetZip
  23543                         will  properly r ead ZIP64- endowed zi p archives , regardle ss of the  value of
  23544                         this  property.   DotNetZip  will alwa ys read ZI P64 archiv es.  This  property
  23545                         gover ns only wh ether DotN etZip will  write the m. Therefo re, when u pdating
  23546                         archi ves, be ca reful abou t setting  this prope rty after  reading an  archive
  23547                         that  may use ZI P64 extens ions.
  23548                       
  23549        </para>
  23550                     
  23551                      
  23552        <para>
  23553                         An in teresting  question i s, if you  have set t his proper ty to
  23554                         
  23555         <c>
  23556          AsNecessar y
  23557         </c>
  23558         , and then  successfu lly saved,  does the  resulting
  23559                         archi ve use ZIP 64 extensi ons or not ?  To lear n this, ch eck the 
  23560         <see 
  23561          cref="P:Io nic.Zip.Zi pFile.Outp utUsedZip6 4"
  23562         />
  23563          property,  after cal ling 
  23564         <c>
  23565          Save()
  23566         </c>
  23567         .
  23568                       
  23569        </para>
  23570                     
  23571                      
  23572        <para>
  23573                         Have  you though t about
  23574                         
  23575         <see 
  23576          href="http ://cheeso. members.wi nisp.net/D otNetZipDo nate.aspx"
  23577         >
  23578          donating
  23579         </see>
  23580         ?
  23581                       
  23582        </para>
  23583                     
  23584                      
  23585       </remarks>
  23586                     
  23587       <seealso 
  23588        cref="P:Io nic.Zip.Zi pFile.Requ iresZip64"
  23589       />
  23590               
  23591      </member>
  23592              
  23593      <member 
  23594       name="P:Io nic.Zip.Zi pFile.Requ iresZip64"
  23595      >
  23596                     
  23597       <summary>
  23598                        Indic ates wheth er the arc hive requi res ZIP64  extensions .
  23599                      
  23600       </summary>
  23601                    
  23602                     
  23603       <remarks>
  23604                     
  23605                      
  23606        <para>
  23607                         This  property i
  23608         <c>
  23609          null
  23610         </c>
  23611          (or 
  23612         <c>
  23613          Nothing
  23614         </c>
  23615          in VB) if  the archi ve has
  23616                         not b een saved,  and there  are fewer  than 6533
  23617         <c>
  23618          ZipEntry
  23619         </c>
  23620          items
  23621                         conta ined in th e archive.
  23622                       
  23623        </para>
  23624                     
  23625                      
  23626        <para>
  23627                         The 
  23628         <c>
  23629          Value
  23630         </c>
  23631          is true i f any of t he followi ng four co nditions h olds:
  23632                         the u ncompresse d size of  any entry  is larger  than 0xFFF FFFFF; the
  23633                         compr essed size  of any en try is lar ger than 0 xFFFFFFFF;  the relat ive
  23634                         offse t of any e ntry withi n the zip  archive is  larger th an 0xFFFFF FFF; or
  23635                         there  are more  than 65534  entries i n the arch ive.  (0xF FFFFFFF =
  23636                         4,294 ,967,295).   The resu lt may not  be known  until a 
  23637         <c>
  23638          Save()
  23639         </c>
  23640          is attemp ted
  23641                         on th e zip arch ive.  The  Value of t his 
  23642         <see 
  23643          cref="T:Sy stem.Nulla ble"
  23644         />
  23645                         prope rty may be  set only  AFTER one  of the Sav e() method s has been  called.
  23646                       
  23647        </para>
  23648                     
  23649                      
  23650        <para>
  23651                         If no ne of the  four condi tions hold s, and the  archive h as been sa ved, then
  23652                         the 
  23653         <c>
  23654          Value
  23655         </c>
  23656          is false.
  23657                       
  23658        </para>
  23659                     
  23660                      
  23661        <para>
  23662                         A 
  23663         <c>
  23664          Value
  23665         </c>
  23666          of false  does not i ndicate th at the zip  archive,  as saved,
  23667                         does  not use ZI P64.  It m erely indi cates that  ZIP64 is  not requir ed.  An
  23668                         archi ve may use  ZIP64 eve n when not  required  if the 
  23669         <see 
  23670          cref="P:Io nic.Zip.Zi pFile.UseZ ip64WhenSa ving"
  23671         />
  23672          property  is set to 
  23673         <see 
  23674          cref="F:Io nic.Zip.Zi p64Option. Always"
  23675         />
  23676         , or if th
  23677         <see 
  23678          cref="P:Io nic.Zip.Zi pFile.UseZ ip64WhenSa ving"
  23679         />
  23680          property  is set to 
  23681         <see 
  23682          cref="F:Io nic.Zip.Zi p64Option. AsNecessar y"
  23683         />
  23684          and the o utput stre am was not
  23685                         seeka ble. Use t he 
  23686         <see 
  23687          cref="P:Io nic.Zip.Zi pFile.Outp utUsedZip6 4"
  23688         />
  23689          property  to determi ne if
  23690                         the m ost recent  
  23691         <c>
  23692          Save()
  23693         </c>
  23694          method re sulted in  an archive  that util ized
  23695                         the Z IP64 exten sions.
  23696                       
  23697        </para>
  23698                     
  23699                      
  23700       </remarks>
  23701                     
  23702       <seealso 
  23703        cref="P:Io nic.Zip.Zi pFile.UseZ ip64WhenSa ving"
  23704       />
  23705                     
  23706       <seealso 
  23707        cref="P:Io nic.Zip.Zi pFile.Outp utUsedZip6 4"
  23708       />
  23709               
  23710      </member>
  23711              
  23712      <member 
  23713       name="P:Io nic.Zip.Zi pFile.Outp utUsedZip6 4"
  23714      >
  23715                     
  23716       <summary>
  23717                        Indic ates wheth er the mos t recent 
  23718        <c>
  23719         Save()
  23720        </c>
  23721         operation  used ZIP6 4 extensio ns.
  23722                      
  23723       </summary>
  23724                    
  23725                     
  23726       <remarks>
  23727                      
  23728        <para>
  23729                         The u se of ZIP6 4 extensio ns within  an archive  is not al ways neces sary, and
  23730                         for i nteroperab ility conc erns, it m ay be desi red to NOT  use ZIP64  if
  23731                         possi ble.  The 
  23732         <see 
  23733          cref="P:Io nic.Zip.Zi pFile.UseZ ip64WhenSa ving"
  23734         />
  23735          property  can be
  23736                         set t o use ZIP6 4 extensio ns only wh en necessa ry.  In th ose cases,
  23737                         Somet imes appli cations wa nt to know  whether a  Save() ac tually use d ZIP64
  23738                         exten sions.  Ap plications  can query  this read -only prop erty to le arn
  23739                         wheth er ZIP64 h as been us ed in a ju st-saved 
  23740         <c>
  23741          ZipFile
  23742         </c>
  23743         .
  23744                       
  23745        </para>
  23746                     
  23747                      
  23748        <para>
  23749                         The v alue is 
  23750         <c>
  23751          null
  23752         </c>
  23753          (or 
  23754         <c>
  23755          Nothing
  23756         </c>
  23757          in VB) if  the archi ve has not
  23758                         been  saved.
  23759                       
  23760        </para>
  23761                     
  23762                      
  23763        <para>
  23764                         Non-n ull values  (
  23765         <c>
  23766          HasValue
  23767         </c>
  23768          is true)  indicate w hether ZIP 64
  23769                         exten sions were  used duri ng the mos t recent 
  23770         <c>
  23771          Save()
  23772         </c>
  23773          operation .  The
  23774                         ZIP64  extension s may have  been used  as requir ed by any  particular  entry
  23775                         becau se of its  uncompress ed or comp ressed siz e, or beca use the ar chive is
  23776                         large r than 429 4967295 by tes, or be cause ther e are more  than 6553 4 entries
  23777                         in th e archive,  or becaus e the 
  23778         <c>
  23779          UseZip64Wh enSaving
  23780         </c>
  23781          property  was set
  23782                         to 
  23783         <see 
  23784          cref="F:Io nic.Zip.Zi p64Option. Always"
  23785         />
  23786         , or becau se the
  23787                         
  23788         <c>
  23789          UseZip64Wh enSaving
  23790         </c>
  23791          property  was set to  
  23792         <see 
  23793          cref="F:Io nic.Zip.Zi p64Option. AsNecessar y"
  23794         />
  23795          and the o utput stre am was not  seekable.
  23796                         The v alue of th is propert y does not  indicate  the reason  the ZIP64
  23797                         exten sions were  used.
  23798                       
  23799        </para>
  23800                     
  23801                      
  23802       </remarks>
  23803                     
  23804       <seealso 
  23805        cref="P:Io nic.Zip.Zi pFile.UseZ ip64WhenSa ving"
  23806       />
  23807                     
  23808       <seealso 
  23809        cref="P:Io nic.Zip.Zi pFile.Requ iresZip64"
  23810       />
  23811               
  23812      </member>
  23813              
  23814      <member 
  23815       name="P:Io nic.Zip.Zi pFile.Inpu tUsesZip64 "
  23816      >
  23817                     
  23818       <summary>
  23819                        Indic ates wheth er the mos t recent 
  23820        <c>
  23821         Read()
  23822        </c>
  23823         operation  read a zi p file tha t uses
  23824                        ZIP64  extension s.
  23825                      
  23826       </summary>
  23827                    
  23828                     
  23829       <remarks>
  23830                        This  property w ill return  null (Not hing in VB ) if you'v e added an  entry aft er reading
  23831                        the z ip file.
  23832                      
  23833       </remarks>
  23834               
  23835      </member>
  23836              
  23837      <member 
  23838       name="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  23839      >
  23840                     
  23841       <summary>
  23842                        The t ext encodi ng to use  when writi ng new ent ries to th
  23843        <c>
  23844         ZipFile
  23845        </c>
  23846        ,
  23847                        for t hose entri es that ca nnot be en coded with  the defau lt (IBM437 )
  23848                        encod ing; or, t he text en coding tha t was used  when read ing the en tries
  23849                        from  the 
  23850        <c>
  23851         ZipFile
  23852        </c>
  23853        .
  23854                      
  23855       </summary>
  23856                    
  23857                     
  23858       <remarks>
  23859                      
  23860        <para>
  23861                         In 
  23862         <see 
  23863          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  23864         >
  23865          its
  23866                          zip s pecificati on
  23867         </see>
  23868         , PKWare d escribes t wo options  for encod ing
  23869                         filen ames and c omments: u sing IBM43 7 or UTF-8 .  But, so me archivi ng tools
  23870                         or li braries do  not follo w the spec ification,  and inste ad encode
  23871                         chara cters usin g the syst em default  code page .  For exa mple, WinR AR when
  23872                         run o n a machin e in Shang hai may en code filen ames with  the Big-5  Chinese
  23873                         (950)  code page .  This be havior is  contrary t o the Zip  specificat ion, but
  23874                         it oc curs anywa y.
  23875                       
  23876        </para>
  23877                     
  23878                      
  23879        <para>
  23880                         When  using DotN etZip to w rite zip a rchives th at will be  read by o ne of
  23881                         these  other arc hivers, se t this pro perty to s pecify the  code page  to use
  23882                         when  encoding t he 
  23883         <see 
  23884          cref="P:Io nic.Zip.Zi pEntry.Fil eName"
  23885         />
  23886          and 
  23887         <see 
  23888          cref="P:Io nic.Zip.Zi pEntry.Com ment"
  23889         />
  23890          for each 
  23891         <c>
  23892          ZipEntry
  23893         </c>
  23894          in the zi p file, fo r
  23895                         value s that can not be enc oded with  the defaul t codepage  for zip f iles,
  23896                         IBM43 7.  This i s why this  property  is "provis ional".  I n all case s, IBM437
  23897                         is us ed where p ossible, i n other wo rds, where  no loss o f data wou ld
  23898                         resul t. It is p ossible, t herefore,  to have a  given entr y with a
  23899                         
  23900         <c>
  23901          Comment
  23902         </c>
  23903          encoded i n IBM437 a nd a 
  23904         <c>
  23905          FileName
  23906         </c>
  23907          encoded w ith the
  23908                         speci fied "prov isional" c odepage.
  23909                       
  23910        </para>
  23911                     
  23912                      
  23913        <para>
  23914                         Be aw are that a  zip file  created af ter you've  explicitl y set the 
  23915         <see 
  23916          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  23917         />
  23918          property  to a value  other tha n
  23919                         IBM43 7 may not  be complia nt to the  PKWare spe cification , and may  not be
  23920                         reada ble by com pliant arc hivers.  O n the othe r hand, ma ny (most?)
  23921                         archi vers are n on-complia nt and can  read zip  files crea ted in arb itrary
  23922                         code  pages.  Th e trick is  to use or  specify t he proper  codepage w hen
  23923                         readi ng the zip .
  23924                       
  23925        </para>
  23926                     
  23927                      
  23928        <para>
  23929                         When  creating a  zip archi ve using t his librar y, it is p ossible to  change
  23930                         the v alue of 
  23931         <see 
  23932          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  23933         />
  23934          between e ach
  23935                         entry  you add,  and betwee n adding e ntries and  the call  to
  23936                         
  23937         <c>
  23938          Save()
  23939         </c>
  23940         . Don't do  this. It  will likel y result i n a zipfil e that is
  23941                         not r eadable.   For best i nteroperab ility, eit her leave 
  23942         <see 
  23943          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  23944         />
  23945          alone, or  specify i t only onc e,
  23946                         befor e adding a ny entries  to the 
  23947         <c>
  23948          ZipFile
  23949         </c>
  23950          instance.   There is  one
  23951                         excep tion to th is recomme ndation, d escribed l ater.
  23952                       
  23953        </para>
  23954                     
  23955                      
  23956        <para>
  23957                         When  using an a rbitrary,  non-UTF8 c ode page f or encodin g, there i s no
  23958                         stand ard way fo r the crea tor applic ation - wh ether DotN etZip, Win Zip,
  23959                         WinRa r, or some thing else  - to form ally speci fy in the  zip file w hich
  23960                         codep age has be en used fo r the entr ies. As a  result, re aders of z ip files
  23961                         are n ot able to  inspect t he zip fil e and dete rmine the  codepage t hat was
  23962                         used  for the en tries cont ained with in it.  It  is left t o the appl ication
  23963                         or us er to dete rmine the  necessary  codepage w hen readin g zip file s encoded
  23964                         this  way.  In o ther words , if you e xplicitly  specify th e codepage  when you
  23965                         creat e the zipf ile, you m ust explic itly speci fy the sam e codepage  when
  23966                         readi ng the zip file.
  23967                       
  23968        </para>
  23969                     
  23970                      
  23971        <para>
  23972                         The w ay you spe cify the c ode page t o use when  reading a  zip file  varies
  23973                         depen ding on th e tool or  library yo u use to r ead the zi p.  In Dot NetZip,
  23974                         you u se a ZipFi le.Read()  method tha t accepts  an encodin g paramete r.  It
  23975                         isn't  possible  with Windo ws Explore r, as far  as I know,  to specif y an
  23976                         expli cit codepa ge to use  when readi ng a zip.   If you us e an incor rect
  23977                         codep age when r eading a z ipfile, yo u will get  entries w ith filena mes that
  23978                         are i ncorrect,  and the in correct fi lenames ma y even con tain chara cters
  23979                         that  are not le gal for us e within f ilenames i n Windows.  Extractin g entries
  23980                         with  illegal ch aracters i n the file names will  lead to e xceptions.  It's too
  23981                         bad,  but this i s just the  way thing s are with  code page s in zip
  23982                         files . Caveat E mptor.
  23983                       
  23984        </para>
  23985                     
  23986                      
  23987        <para>
  23988                         Examp le: Suppos e you crea te a zipfi le that co ntains ent ries with
  23989                         filen ames that  have Danis h characte rs.  If yo u use 
  23990         <see 
  23991          cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  23992         />
  23993          equal to  "iso-8859- 1" (cp 285 91),
  23994                         the f ilenames w ill be cor rectly enc oded in th e zip.  Bu t, to read  that
  23995                         zipfi le correct ly, you ha ve to spec ify the sa me codepag e at the t ime you
  23996                         read  it. If try  to read t hat zip fi le with Wi ndows Expl orer or an other
  23997                         appli cation tha t is not f lexible wi th respect  to the co depage use d to
  23998                         decod e filename s in zipfi les, you w ill get a  filename l ike "Inf° .txt".
  23999                       
  24000        </para>
  24001                     
  24002                      
  24003        <para>
  24004                         When  using DotN etZip to r ead a zip  archive, a nd the zip  archive u ses an
  24005                         arbit rary code  page, you  must speci fy the enc oding to u se before  or when
  24006                         the 
  24007         <c>
  24008          Zipfile
  24009         </c>
  24010          is READ.   This mean s you must  use a 
  24011         <c>
  24012          ZipFile.Re ad()
  24013         </c>
  24014                         metho d that all ows you to  specify a  System.Te xt.Encodin g paramete r.  Settin g
  24015                         the P rovisional AlternateE ncoding pr operty aft er your ap plication  has read i n
  24016                         the z ip archive  will not  affect the  entry nam es of entr ies that h ave alread y
  24017                         been  read in.
  24018                       
  24019        </para>
  24020                     
  24021                      
  24022        <para>
  24023                         And n ow, the ex ception to  the rule  described  above.  On e strategy  for
  24024                         speci fying the  code page  for a give n zip file  is to des cribe the  code page
  24025                         in a  human-read able form  in the Zip  comment.  For exampl e, the com ment may
  24026                         read  "Entries i n this arc hive are e ncoded in  the Big5 c ode page".   For
  24027                         maxim um interop erability,  the zip c omment in  this case  should be  encoded
  24028                         in th e default,  IBM437 co de page.   In this ca se, the zi p comment  is
  24029                         encod ed using a  different  page than  the filen ames.  To  do this, S pecify
  24030                         
  24031         <c>
  24032          Provisiona lAlternate Encoding
  24033         </c>
  24034          to your d esired reg ion-specif ic code
  24035                         page,  once befo re adding  any entrie s, and the n reset
  24036                         
  24037         <c>
  24038          Provisiona lAlternate Encoding
  24039         </c>
  24040          to IBM437  before se tting the 
  24041         <see 
  24042          cref="P:Io nic.Zip.Zi pFile.Comm ent"
  24043         />
  24044          property  and callin g Save().
  24045                       
  24046        </para>
  24047                      
  24048       </remarks>
  24049                    
  24050                     
  24051       <example>
  24052                      This ex ample show s how to r ead a zip  file using  the Big-5  Chinese c ode page
  24053                      (950),  and extrac t each ent ry in the  zip file.   For this  code to wo rk as
  24054                      desired , the 
  24055        <c>
  24056         Zipfile
  24057        </c>
  24058         must have  been crea ted using  the big5 c ode page
  24059                      (CP950) . This is  typical, f or example , when usi ng WinRar  on a machi ne with
  24060                      CP950 s et as the  default co de page.   In that ca se, the na mes of ent ries
  24061                      within  the Zip ar chive will  be stored  in that c ode page,  and readin g the zip
  24062                      archive  must be d one using  that code  page.  If  the applic ation did  not use
  24063                      the cor rect code  page in 
  24064        <c>
  24065         ZipFile.Re ad()
  24066        </c>
  24067        , then nam es of entr ies within  the
  24068                      zip arc hive would  not be co rrectly re trieved.
  24069                      
  24070        <code>
  24071                       using ( var zip =  ZipFile.Re ad(zipFile Name, Syst em.Text.En coding.Get Encoding(" big5")))
  24072                       {
  24073                           //  retrieve a nd extract  an entry  using a na me encoded  with CP95 0
  24074                           zip [MyDesired Entry].Ext ract("unpa ck");
  24075                       }
  24076                       
  24077        </code>
  24078                     
  24079                      
  24080        <code 
  24081         lang="VB"
  24082        >
  24083                       Using z ip As ZipF ile = ZipF ile.Read(Z ipToExtrac t, System. Text.Encod ing.GetEnc oding("big 5"))
  24084                           ' r etrieve an d extract  an entry u sing a nam e encoded  with CP950
  24085                           zip (MyDesired Entry).Ext ract("unpa ck")
  24086                       End Usi ng
  24087                       
  24088        </code>
  24089                      
  24090       </example>
  24091                    
  24092                     
  24093       <seealso 
  24094        cref="P:Io nic.Zip.Zi pFile.Defa ultEncodin g"
  24095       >
  24096        DefaultEnc oding
  24097       </seealso>
  24098               
  24099      </member>
  24100              
  24101      <member 
  24102       name="P:Io nic.Zip.Zi pFile.Alte rnateEncod ing"
  24103      >
  24104                    
  24105       <summary>
  24106                       A Text  Encoding  to use whe n encoding  the filen ames and c omments fo r
  24107                       all th e ZipEntry  items, du ring a Zip File.Save( ) operatio n.
  24108                     
  24109       </summary>
  24110                    
  24111       <remarks>
  24112                       
  24113        <para>
  24114                          Whet her the en coding spe cified her e is used  during the  save depe nds
  24115                          on 
  24116         <see 
  24117          cref="P:Io nic.Zip.Zi pFile.Alte rnateEncod ingUsage"
  24118         />
  24119         .
  24120                        
  24121        </para>
  24122                     
  24123       </remarks>
  24124               
  24125      </member>
  24126              
  24127      <member 
  24128       name="P:Io nic.Zip.Zi pFile.Alte rnateEncod ingUsage"
  24129      >
  24130                    
  24131       <summary>
  24132                       A flag  that tell s if and w hen this i nstance sh ould apply
  24133                       Altern ateEncodin g to encod e the file names and  comments a ssociated  to
  24134                       of Zip Entry obje cts contai ned within  this inst ance.
  24135                     
  24136       </summary>
  24137               
  24138      </member>
  24139              
  24140      <member 
  24141       name="P:Io nic.Zip.Zi pFile.Defa ultEncodin g"
  24142      >
  24143                    
  24144       <summary>
  24145                     The defa ult text e ncoding us ed in zip  archives.   It is num eric 437,  also
  24146                     known as  IBM437.
  24147                     
  24148       </summary>
  24149                    
  24150       <seealso 
  24151        cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  24152       />
  24153               
  24154      </member>
  24155              
  24156      <member 
  24157       name="P:Io nic.Zip.Zi pFile.Stat usMessageT extWriter"
  24158      >
  24159                     
  24160       <summary>
  24161                      Gets or  sets the 
  24162        <c>
  24163         TextWriter
  24164        </c>
  24165         to which  status mes sages are  delivered
  24166                      for the  instance.
  24167                      
  24168       </summary>
  24169                    
  24170                     
  24171       <remarks>
  24172                        If th e TextWrit er is set  to a non-n ull value,  then verb ose output  is sent
  24173                        to th
  24174        <c>
  24175         TextWriter
  24176        </c>
  24177         during 
  24178        <c>
  24179         Add
  24180        </c>
  24181        <c>
  24182         , Read
  24183        </c>
  24184        <c>
  24185         , Save
  24186        </c>
  24187         and
  24188                        
  24189        <c>
  24190         Extract
  24191        </c>
  24192         operation s.  Typica lly, conso le applica tions migh t use
  24193                        
  24194        <c>
  24195         Console.Ou t
  24196        </c>
  24197         and graph ical or he adless app lications  might use  a
  24198                        
  24199        <c>
  24200         System.IO. StringWrit er
  24201        </c>
  24202        . The outp ut of this  is suitab le for vie wing
  24203                        by hu mans.
  24204                      
  24205       </remarks>
  24206                    
  24207                     
  24208       <example>
  24209                      
  24210        <para>
  24211                         In th is example , a consol e applicat ion instan tiates a 
  24212         <c>
  24213          ZipFile
  24214         </c>
  24215         , then
  24216                         sets  the 
  24217         <c>
  24218          StatusMess ageTextWri ter
  24219         </c>
  24220          to 
  24221         <c>
  24222          Console.Ou t
  24223         </c>
  24224         .  At that
  24225                         point , all verb ose status  messages  for that 
  24226         <c>
  24227          ZipFile
  24228         </c>
  24229          are sent  to the
  24230                         conso le.
  24231                       
  24232        </para>
  24233                     
  24234                      
  24235        <code 
  24236         lang="C#"
  24237        >
  24238                       using ( ZipFile zi p= ZipFile .Read(File Path))
  24239                       {
  24240                         zip.S tatusMessa geTextWrit er= System .Console.O ut;
  24241                         // me ssages are  sent to t he console  during ex traction
  24242                         zip.E xtractAll( );
  24243                       }
  24244                       
  24245        </code>
  24246                     
  24247                      
  24248        <code 
  24249         lang="VB"
  24250        >
  24251                       Using z ip As ZipF ile = ZipF ile.Read(F ilePath)
  24252                         zip.S tatusMessa geTextWrit er= System .Console.O ut
  24253                         'Stat us Message s will be  sent to th e console  during ext raction
  24254                         zip.E xtractAll( )
  24255                       End Usi ng
  24256                       
  24257        </code>
  24258                     
  24259                      
  24260        <para>
  24261                         In th is example , a Window s Forms ap plication  instantiat es a
  24262                         
  24263         <c>
  24264          ZipFile
  24265         </c>
  24266         , then set s the 
  24267         <c>
  24268          StatusMess ageTextWri ter
  24269         </c>
  24270          to a
  24271                         
  24272         <c>
  24273          StringWrit er
  24274         </c>
  24275         .  At that  point, al l verbose  status mes sages for  that
  24276                         
  24277         <c>
  24278          ZipFile
  24279         </c>
  24280          are sent  to the 
  24281         <c>
  24282          StringWrit er
  24283         </c>
  24284         .
  24285                       
  24286        </para>
  24287                     
  24288                      
  24289        <code 
  24290         lang="C#"
  24291        >
  24292                       var sw  = new Syst em.IO.Stri ngWriter() ;
  24293                       using ( ZipFile zi p= ZipFile .Read(File Path))
  24294                       {
  24295                         zip.S tatusMessa geTextWrit er= sw;
  24296                         zip.E xtractAll( );
  24297                       }
  24298                       Console .WriteLine ("{0}", sw .ToString( ));
  24299                       
  24300        </code>
  24301                     
  24302                      
  24303        <code 
  24304         lang="VB"
  24305        >
  24306                       Dim sw  as New Sys tem.IO.Str ingWriter
  24307                       Using z ip As ZipF ile = ZipF ile.Read(F ilePath)
  24308                         zip.S tatusMessa geTextWrit er= sw
  24309                         zip.E xtractAll( )
  24310                       End Usi ng
  24311                       'Status  Messages  are now av ailable in  sw
  24312                      
  24313                       
  24314        </code>
  24315                      
  24316       </example>
  24317               
  24318      </member>
  24319              
  24320      <member 
  24321       name="P:Io nic.Zip.Zi pFile.Temp FileFolder "
  24322      >
  24323                     
  24324       <summary>
  24325                        Gets  or sets th e name for  the folde r to store  the tempo rary file
  24326                        this  library wr ites when  saving a z ip archive .
  24327                      
  24328       </summary>
  24329                    
  24330                     
  24331       <remarks>
  24332                      
  24333        <para>
  24334                         This  library wi ll create  a temporar y file whe n saving a  Zip archi ve to a
  24335                         file.   This fil e is writt en when ca lling one  of the 
  24336         <c>
  24337          Save()
  24338         </c>
  24339          methods
  24340                         that  does not s ave to a s tream, or  one of the  
  24341         <c>
  24342          SaveSelfEx tractor()
  24343         </c>
  24344                         metho ds.
  24345                       
  24346        </para>
  24347                     
  24348                      
  24349        <para>
  24350                         By de fault, the  library w ill create  the tempo rary file  in the dir ectory
  24351                         speci fied for t he file it self, via  the 
  24352         <see 
  24353          cref="P:Io nic.Zip.Zi pFile.Name "
  24354         />
  24355          property  or via
  24356                         the 
  24357         <see 
  24358          cref="M:Io nic.Zip.Zi pFile.Save (System.St ring)"
  24359         />
  24360          method.
  24361                       
  24362        </para>
  24363                     
  24364                      
  24365        <para>
  24366                         Setti ng this pr operty all ows applic ations to  override t his defaul t
  24367                         behav ior, so th at the lib rary will  create the  temporary  file in t he
  24368                         speci fied folde r. For exa mple, to h ave the li brary crea te the tem porary
  24369                         file  in the cur rent worki ng directo ry, regard less where  the 
  24370         <c>
  24371          ZipFile
  24372         </c>
  24373                         is sa ved, specf y ".".  To  revert to  the defau lt behavio r, set thi s
  24374                         prope rty to 
  24375         <c>
  24376          null
  24377         </c>
  24378          (
  24379         <c>
  24380          Nothing
  24381         </c>
  24382          in VB).
  24383                       
  24384        </para>
  24385                     
  24386                      
  24387        <para>
  24388                         When  setting th e property  to a non- null value , the fold er specifi ed must
  24389                         exist ; if it do es not an  exception  is thrown.   The appl ication sh ould have
  24390                         write  and delet e permissi ons on the  folder.   The permis sions are  not
  24391                         expli citly chec ked ahead  of time; i f the appl ication do es not hav e the
  24392                         appro priate rig hts, an ex ception wi ll be thro wn at the  time 
  24393         <c>
  24394          Save()
  24395         </c>
  24396                         is ca lled.
  24397                       
  24398        </para>
  24399                     
  24400                      
  24401        <para>
  24402                         There  is no tem porary fil e created  when readi ng a zip a rchive.  W hen
  24403                         savin g to a Str eam, there  is no tem porary fil e created.   For exam ple, if
  24404                         the a pplication  is an ASP .NET appli cation and  calls 
  24405         <c>
  24406          Save()
  24407         </c>
  24408                         speci fying the 
  24409         <c>
  24410          Response.O utputStrea m
  24411         </c>
  24412          as the ou tput strea m, there i s
  24413                         no te mporary fi le created .
  24414                       
  24415        </para>
  24416                      
  24417       </remarks>
  24418                    
  24419                     
  24420       <exception  
  24421        cref="T:Sy stem.IO.Fi leNotFound Exception"
  24422       >
  24423                      Thrown  when setti ng the pro perty if t he directo ry does no t exist.
  24424                      
  24425       </exceptio n>
  24426                    
  24427               
  24428      </member>
  24429              
  24430      <member 
  24431       name="P:Io nic.Zip.Zi pFile.Pass word"
  24432      >
  24433                     
  24434       <summary>
  24435                      Sets th e password  to be use d on the 
  24436        <c>
  24437         ZipFile
  24438        </c>
  24439         instance.
  24440                      
  24441       </summary>
  24442                    
  24443                     
  24444       <remarks>
  24445                     
  24446                      
  24447        <para>
  24448                         When  writing a  zip archiv e, this pa ssword is  applied to  the entri es, not
  24449                         to th e zip arch ive itself . It appli es to any 
  24450         <c>
  24451          ZipEntry
  24452         </c>
  24453          subsequen tly
  24454                         added  to the 
  24455         <c>
  24456          ZipFile
  24457         </c>
  24458         , using on e of the 
  24459         <c>
  24460          AddFile
  24461         </c>
  24462         ,
  24463                         
  24464         <c>
  24465          AddDirecto ry
  24466         </c>
  24467        
  24468         <c>
  24469          AddEntry
  24470         </c>
  24471         , or 
  24472         <c>
  24473          AddItem
  24474         </c>
  24475          methods,  etc.
  24476                         When  reading a  zip archiv e, this pr operty app lies to an y entry
  24477                         subse quently ex tracted fr om the 
  24478         <c>
  24479          ZipFile
  24480         </c>
  24481          using one  of the Ex tract
  24482                         metho ds on the 
  24483         <c>
  24484          ZipFile
  24485         </c>
  24486          class.
  24487                       
  24488        </para>
  24489                     
  24490                      
  24491        <para>
  24492                         When  writing a  zip archiv e, keep th is in mind : though t he passwor d is set
  24493                         on th e ZipFile  object, ac cording to  the Zip s pec, the " directory"  of the
  24494                         archi ve - in ot her words  the list o f entries  or files c ontained i n the arch ive - is
  24495                         not e ncrypted w ith the pa ssword, or  protected  in any wa y.  If you  set the
  24496                         Passw ord proper ty, the pa ssword act ually appl ies to ind ividual en tries
  24497                         that  are added  to the arc hive, subs equent to  the settin g of this  property.
  24498                         The l ist of fil enames in  the archiv e that is  eventually  created w ill
  24499                         appea r in clear  text, but  the conte nts of the  individua l files ar e
  24500                         encry pted.  Thi s is how Z ip encrypt ion works.
  24501                       
  24502        </para>
  24503                     
  24504                      
  24505        <para>
  24506                         One s imple way  around thi s limitati on is to s imply doub le-wrap se nsitive
  24507                         filen ames: Stor e the file s in a zip  file, and  then stor e that zip  file
  24508                         withi n a second , "outer"  zip file.   If you ap ply a pass word to th e outer
  24509                         zip f ile, then  readers wi ll be able  to see th at the out er zip fil e
  24510                         conta ins an inn er zip fil e.  But re aders will  not be ab le to read  the
  24511                         direc tory or fi le list of  the inner  zip file.
  24512                       
  24513        </para>
  24514                     
  24515                      
  24516        <para>
  24517                         If yo u set the  password o n the 
  24518         <c>
  24519          ZipFile
  24520         </c>
  24521         , and then  add a set  of files
  24522                         to th e archive,  then each  entry is  encrypted  with that  password.   You may
  24523                         also  want to ch ange the p assword be tween addi ng differe nt entries . If you
  24524                         set t he passwor d, add an  entry, the n set the  password t
  24525         <c>
  24526          null
  24527         </c>
  24528                         (
  24529         <c>
  24530          Nothing
  24531         </c>
  24532          in VB), a nd add ano ther entry , the firs t entry is
  24533                         encry pted and t he second  is not.  I f you call  
  24534         <c>
  24535          AddFile()
  24536         </c>
  24537         , then set
  24538                         the 
  24539         <c>
  24540          Password
  24541         </c>
  24542          property,  then call  
  24543         <c>
  24544          ZipFile.Sa ve
  24545         </c>
  24546         , the file
  24547                         added  will not  be passwor d-protecte d, and no  warning wi ll be gene rated.
  24548                       
  24549        </para>
  24550                     
  24551                      
  24552        <para>
  24553                         When  setting th e Password , you may  also want  to explici tly set th
  24554         <see 
  24555          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  24556         />
  24557          property,  to specif y how to e ncrypt the  entries a dded
  24558                         to th e ZipFile.   If you s et the Pas sword to a  non-null  value and  do not
  24559                         set 
  24560         <see 
  24561          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  24562         />
  24563         , then PKZ ip 2.0 ("W eak") encr yption is  used.
  24564                         This  encryption  is relati vely weak  but is ver y interope rable. If  you set
  24565                         the p assword to  a 
  24566         <c>
  24567          null
  24568         </c>
  24569          value (
  24570         <c>
  24571          Nothing
  24572         </c>
  24573          in VB), E ncryption  is
  24574                         reset  to None.
  24575                       
  24576        </para>
  24577                     
  24578                      
  24579        <para>
  24580                         All o f the prec eding appl ies to wri ting zip a rchives, i n other wo rds when
  24581                         you u se one of  the Save m ethods.  T o use this  property  when readi ng or an
  24582                         exist ing ZipFil e, do the  following:  set the P assword pr operty on  the
  24583                         
  24584         <c>
  24585          ZipFile
  24586         </c>
  24587         , then cal l one of t he Extract () overloa ds on the 
  24588         <see 
  24589          cref="T:Io nic.Zip.Zi pEntry"
  24590         />
  24591         . In this  case, the  entry is e xtracted u sing the
  24592                         
  24593         <c>
  24594          Password
  24595         </c>
  24596          that is s pecified o n the 
  24597         <c>
  24598          ZipFile
  24599         </c>
  24600          instance.  If you
  24601                         have  not set th
  24602         <c>
  24603          Password
  24604         </c>
  24605          property,  then the  password i s
  24606                         
  24607         <c>
  24608          null
  24609         </c>
  24610         , and the  entry is e xtracted w ith no pas sword.
  24611                       
  24612        </para>
  24613                     
  24614                      
  24615        <para>
  24616                         If yo u set the  Password p roperty on  the 
  24617         <c>
  24618          ZipFile
  24619         </c>
  24620         , then cal l
  24621                         
  24622         <c>
  24623          Extract()
  24624         </c>
  24625          an entry  that has n ot been en crypted wi th a passw ord, the
  24626                         passw ord is not  used for  that entry , and the 
  24627         <c>
  24628          ZipEntry
  24629         </c>
  24630          is extrac ted
  24631                         as no rmal. In o ther words , the pass word is us ed only if  necessary .
  24632                       
  24633        </para>
  24634                     
  24635                      
  24636        <para>
  24637                         The 
  24638         <see 
  24639          cref="T:Io nic.Zip.Zi pEntry"
  24640         />
  24641          class als o has a 
  24642         <see 
  24643          cref="P:Io nic.Zip.Zi pEntry.Pas sword"
  24644         >
  24645          Password
  24646         </see>
  24647          property.   It takes  precedenc e
  24648                         over  this prope rty on the  
  24649         <c>
  24650          ZipFile
  24651         </c>
  24652         .  Typical ly, you wo uld use th e
  24653                         per-e ntry Passw ord when m ost entrie s in the z ip archive  use one p assword,
  24654                         and a  few entri es use a d ifferent p assword.   If all ent ries in th e zip
  24655                         file  use the sa me passwor d, then it  is simple r to just  set this p roperty
  24656                         on th
  24657         <c>
  24658          ZipFile
  24659         </c>
  24660          itself, w hether cre ating a zi p archive  or extract ing
  24661                         a zip  archive.
  24662                       
  24663        </para>
  24664                     
  24665                      
  24666       </remarks>
  24667                    
  24668                     
  24669       <example>
  24670                      
  24671        <para>
  24672                         This  example cr eates a zi p file, us ing passwo rd protect ion for th e
  24673                         entri es, and th en extract s the entr ies from t he zip fil e.  When c reating
  24674                         the z ip file, t he Readme. txt file i s not prot ected with  a passwor d, but
  24675                         the o ther two a re passwor d-protecte d as they  are saved.  During ex traction,
  24676                         each  file is ex tracted wi th the app ropriate p assword.
  24677                       
  24678        </para>
  24679                      
  24680        <code>
  24681                       // crea te a file  with encry ption
  24682                       using ( ZipFile zi p = new Zi pFile())
  24683                       {
  24684                           zip .AddFile(" ReadMe.txt ");
  24685                             zip.Passwo rd= " AI ";
  24686                           zip .AddFile(" MapToTheSi te-7440-N4 9th.png");
  24687                           zip .AddFile(" 2008-Regio nal-Sales- Report.pdf ");
  24688                           zip .Save("Enc ryptedArch ive.zip");
  24689                       }
  24690                      
  24691                       // extr act entrie s that use  encryptio n
  24692                       using ( ZipFile zi p = ZipFil e.Read("En cryptedArc hive.zip") )
  24693                       {
  24694                             zip.Passwo rd= " AI ";
  24695                           zip .ExtractAl l("extract Dir");
  24696                       }
  24697                      
  24698                       
  24699        </code>
  24700                     
  24701                      
  24702        <code 
  24703         lang="VB"
  24704        >
  24705                       Using z ip As New  ZipFile
  24706                           zip .AddFile(" ReadMe.txt ")
  24707                             zip.Passwo rd = " AI "
  24708                           zip .AddFile(" MapToTheSi te-7440-N4 9th.png")
  24709                             zip.Passwo rd= " AI ";
  24710                           zip .AddFile(" 2008-Regio nal-Sales- Report.pdf ")
  24711                           zip .Save("Enc ryptedArch ive.zip")
  24712                       End Usi ng
  24713                      
  24714                      
  24715                       ' extra ct entries  that use  encryption
  24716                       Using ( zip as Zip File = Zip File.Read( "Encrypted Archive.zi p"))
  24717                             zip.Passwo rd= " AI "
  24718                           zip .ExtractAl l("extract Dir")
  24719                       End Usi ng
  24720                      
  24721                       
  24722        </code>
  24723                     
  24724                      
  24725       </example>
  24726                    
  24727                     
  24728       <seealso 
  24729        cref="P:Io nic.Zip.Zi pFile.Encr yption"
  24730       >
  24731        ZipFile.En cryption
  24732       </seealso>
  24733                     
  24734       <seealso 
  24735        cref="P:Io nic.Zip.Zi pEntry.Pas sword"
  24736       >
  24737        ZipEntry.P assword
  24738       </seealso>
  24739               
  24740      </member>
  24741              
  24742      <member 
  24743       name="P:Io nic.Zip.Zi pFile.Extr actExistin gFile"
  24744      >
  24745                     
  24746       <summary>
  24747                        The a ction the  library sh ould take  when extra cting a fi le that al ready
  24748                        exist s.
  24749                      
  24750       </summary>
  24751                    
  24752                     
  24753       <remarks>
  24754                      
  24755        <para>
  24756                         This  property a ffects the  behavior  of the Ext ract metho ds (one of  the
  24757                         
  24758         <c>
  24759          Extract()
  24760         </c>
  24761          or 
  24762         <c>
  24763          ExtractWit hPassword( )
  24764         </c>
  24765          overloads ), when
  24766                         extra ction woul d would ov erwrite an  existing  filesystem  file. If  you do
  24767                         not s et this pr operty, th e library  throws an  exception  when extra cting an
  24768                         entry  would ove rwrite an  existing f ile.
  24769                       
  24770        </para>
  24771                     
  24772                      
  24773        <para>
  24774                         This  property h as no effe ct when ex tracting t o a stream , or when  the file
  24775                         to be  extracted  does not  already ex ist.
  24776                       
  24777        </para>
  24778                      
  24779       </remarks>
  24780                     
  24781       <seealso 
  24782        cref="P:Io nic.Zip.Zi pEntry.Ext ractExisti ngFile"
  24783       />
  24784               
  24785      </member>
  24786              
  24787      <member 
  24788       name="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  24789      >
  24790                     
  24791       <summary>
  24792                        The a ction the  library sh ould take  when an er ror is enc ountered w hile
  24793                        openi ng or read ing files  as they ar e saved in to a zip a rchive.
  24794                      
  24795       </summary>
  24796                    
  24797                     
  24798       <remarks>
  24799                       
  24800        <para>
  24801                          Erro rs can occ ur as a fi le is bein g saved to  the zip a rchive.  F or
  24802                          exam ple, the F ile.Open m ay fail, o r a File.R ead may fa il, becaus e of
  24803                          lock  conflicts  or other  reasons.
  24804                        
  24805        </para>
  24806                     
  24807                       
  24808        <para>
  24809                          The  first prob lem might  occur afte r having c alled AddD irectory()  on a
  24810                          dire ctory that  contains  a Clipper  .dbf file;  the file  is locked  by
  24811                          Clip per and ca nnot be op ened for r ead by ano ther proce ss. An exa mple of
  24812                          the  second pro blem might  occur whe n trying t o zip a .p st file th at is in
  24813                          use  by Microso ft Outlook . Outlook  locks a ra nge on the  file, whi ch allows
  24814                          othe r processe s to open  the file,  but not re ad it in i ts entiret y.
  24815                        
  24816        </para>
  24817                     
  24818                       
  24819        <para>
  24820                          This  property  tells DotN etZip what  you would  like to d o in the c ase of
  24821                          thes e errors.   The prima ry options  are: 
  24822         <c>
  24823          ZipErrorAc tion.Throw
  24824         </c>
  24825          to
  24826                          thro w an excep tion (this  is the de fault beha vior if yo u don't se t this
  24827                          prop erty); 
  24828         <c>
  24829          ZipErrorAc tion.Skip
  24830         </c>
  24831          to Skip t he file fo r which th ere
  24832                          was  an error a nd continu e saving; 
  24833         <c>
  24834          ZipErrorAc tion.Retry
  24835         </c>
  24836          to Retry
  24837                          the  entry that  caused th e problem;  or
  24838                          
  24839         <c>
  24840          ZipErrorAc tion.Invok eErrorEven t
  24841         </c>
  24842          to invoke  an event  handler.
  24843                        
  24844        </para>
  24845                     
  24846                       
  24847        <para>
  24848                          This  property  is implici tly set to  
  24849         <c>
  24850          ZipErrorAc tion.Invok eErrorEven t
  24851         </c>
  24852                          if y ou add a h andler to  the 
  24853         <see 
  24854          cref="E:Io nic.Zip.Zi pFile.ZipE rror"
  24855         />
  24856          event.  I f you set
  24857                          this  property  to somethi ng other t han
  24858                          
  24859         <c>
  24860          ZipErrorAc tion.Invok eErrorEven t
  24861         </c>
  24862         , then the  
  24863         <c>
  24864          ZipError
  24865         </c>
  24866                          even t is impli citly clea red.  What  it means  is you can  set one o r the
  24867                          othe r (or neit her), depe nding on w hat you wa nt, but yo u never ne ed to set
  24868                          both .
  24869                        
  24870        </para>
  24871                     
  24872                       
  24873        <para>
  24874                          As w ith some o ther prope rties on t he 
  24875         <c>
  24876          ZipFile
  24877         </c>
  24878          class, li ke 
  24879         <see 
  24880          cref="P:Io nic.Zip.Zi pFile.Pass word"
  24881         />
  24882        
  24883         <see 
  24884          cref="P:Io nic.Zip.Zi pFile.Encr yption"
  24885         />
  24886         , and 
  24887         <see 
  24888          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  24889         />
  24890         , setting  this prope rty on a 
  24891         <c>
  24892          ZipFile
  24893         </c>
  24894                          inst ance will  cause the  specified 
  24895         <c>
  24896          ZipErrorAc tion
  24897         </c>
  24898          to be use d on all
  24899                          
  24900         <see 
  24901          cref="T:Io nic.Zip.Zi pEntry"
  24902         />
  24903          items tha t are subs equently a dded to th e
  24904                          
  24905         <c>
  24906          ZipFile
  24907         </c>
  24908          instance.  If you se t this pro perty afte r you have  added
  24909                          item s to the 
  24910         <c>
  24911          ZipFile
  24912         </c>
  24913         , but befo re you hav e called 
  24914         <c>
  24915          Save()
  24916         </c>
  24917         ,
  24918                          thos e items wi ll not use  the speci fied error  handling  action.
  24919                        
  24920        </para>
  24921                     
  24922                       
  24923        <para>
  24924                          If y ou want to  handle an y errors t hat occur  with any e ntry in th e zip
  24925                          file  in the sa me way, th en set thi s property  once, bef ore adding  any
  24926                          entr ies to the  zip archi ve.
  24927                        
  24928        </para>
  24929                     
  24930                       
  24931        <para>
  24932                          If y ou set thi s property  to 
  24933         <c>
  24934          ZipErrorAc tion.Skip
  24935         </c>
  24936          and you'd  like to
  24937                          lear n which fi les may ha ve been sk ipped afte r a 
  24938         <c>
  24939          Save()
  24940         </c>
  24941         , you can
  24942                          set  the 
  24943         <see 
  24944          cref="P:Io nic.Zip.Zi pFile.Stat usMessageT extWriter"
  24945         />
  24946          on the Zi pFile befo re
  24947                          call ing 
  24948         <c>
  24949          Save()
  24950         </c>
  24951         . A messag e will be  emitted in to that wr iter for
  24952                          each  skipped f ile, if an y.
  24953                        
  24954        </para>
  24955                     
  24956                      
  24957       </remarks>
  24958                    
  24959                     
  24960       <example>
  24961                        This  example sh ows how to  tell DotN etZip to s kip any fi les for wh ich an
  24962                        error  is genera ted during  the Save( ).
  24963                      
  24964        <code 
  24965         lang="VB"
  24966        >
  24967                       Public  Sub SaveZi pFile()
  24968                           Dim  SourceFol der As Str ing = "fod der"
  24969                           Dim  DestFile  As String  =  "eHandl er.zip"
  24970                           Dim  sw as New  StringWri ter
  24971                           Usi ng zipArch ive As Zip File = New  ZipFile
  24972                                ' Tell Do tNetZip to  skip any  files for  which it e ncounters  an error
  24973                                zipArchiv e.ZipError Action = Z ipErrorAct ion.Skip
  24974                                zipArchiv e.StatusMe ssageTextW riter = sw
  24975                                zipArchiv e.AddDirec tory(Sourc eFolder)
  24976                                zipArchiv e.Save(Des tFile)
  24977                           End  Using
  24978                           ' e xamine sw  here to se e any mess ages
  24979                       End Sub
  24980                      
  24981                       
  24982        </code>
  24983                      
  24984       </example>
  24985                    
  24986                     
  24987       <seealso 
  24988        cref="P:Io nic.Zip.Zi pEntry.Zip ErrorActio n"
  24989       />
  24990                     
  24991       <seealso 
  24992        cref="E:Io nic.Zip.Zi pFile.ZipE rror"
  24993       />
  24994               
  24995      </member>
  24996              
  24997      <member 
  24998       name="P:Io nic.Zip.Zi pFile.Encr yption"
  24999      >
  25000                     
  25001       <summary>
  25002                        The E ncryption  to use for  entries a dded to th
  25003        <c>
  25004         ZipFile
  25005        </c>
  25006        .
  25007                      
  25008       </summary>
  25009                    
  25010                     
  25011       <remarks>
  25012                      
  25013        <para>
  25014                         Set t his when c reating a  zip archiv e, or when  updating  a zip arch ive. The
  25015                         speci fied Encry ption is a pplied to  the entrie s subseque ntly added  to the
  25016                         
  25017         <c>
  25018          ZipFile
  25019         </c>
  25020          instance.   Applicat ions do no t need to  set the
  25021                         
  25022         <c>
  25023          Encryption
  25024         </c>
  25025          property  when readi ng or extr acting a z ip archive .
  25026                       
  25027        </para>
  25028                     
  25029                      
  25030        <para>
  25031                         If yo u set this  to someth ing other  than Encry ptionAlgor ithm.None,  you
  25032                         will  also need  to set the  
  25033         <see 
  25034          cref="P:Io nic.Zip.Zi pFile.Pass word"
  25035         />
  25036         .
  25037                       
  25038        </para>
  25039                     
  25040                      
  25041        <para>
  25042                         As wi th some ot her proper ties on th
  25043         <c>
  25044          ZipFile
  25045         </c>
  25046          class, li ke 
  25047         <see 
  25048          cref="P:Io nic.Zip.Zi pFile.Pass word"
  25049         />
  25050          and 
  25051         <see 
  25052          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  25053         />
  25054         , setting  this
  25055                         prope rty on a 
  25056         <c>
  25057          ZipFile
  25058         </c>
  25059          instance  will cause  the speci fied
  25060                         
  25061         <c>
  25062          Encryption Algorithm
  25063         </c>
  25064          to be use d on all 
  25065         <see 
  25066          cref="T:Io nic.Zip.Zi pEntry"
  25067         />
  25068          items
  25069                         that  are subseq uently add ed to the 
  25070         <c>
  25071          ZipFile
  25072         </c>
  25073          instance.  In other
  25074                         words , if you s et this pr operty aft er you hav e added it ems to the
  25075                         
  25076         <c>
  25077          ZipFile
  25078         </c>
  25079         , but befo re you hav e called 
  25080         <c>
  25081          Save()
  25082         </c>
  25083         , those it ems will
  25084                         not b e encrypte d or prote cted with  a password  in the re sulting zi p
  25085                         archi ve. To get  a zip arc hive with  encrypted  entries, s et this pr operty,
  25086                         along  with the 
  25087         <see 
  25088          cref="P:Io nic.Zip.Zi pFile.Pass word"
  25089         />
  25090          property,  before ca lling
  25091                         
  25092         <c>
  25093          AddFile
  25094         </c>
  25095        
  25096         <c>
  25097          AddItem
  25098         </c>
  25099         , or 
  25100         <c>
  25101          AddDirecto ry
  25102         </c>
  25103          (etc.) on  the
  25104                         
  25105         <c>
  25106          ZipFile
  25107         </c>
  25108          instance.
  25109                       
  25110        </para>
  25111                     
  25112                      
  25113        <para>
  25114                         If yo u read a 
  25115         <c>
  25116          ZipFile
  25117         </c>
  25118         , you can  modify the  
  25119         <c>
  25120          Encryption
  25121         </c>
  25122          on an
  25123                         encry pted entry , only by  setting th
  25124         <c>
  25125          Encryption
  25126         </c>
  25127          property  on the
  25128                         
  25129         <c>
  25130          ZipEntry
  25131         </c>
  25132          itself.   Setting th
  25133         <c>
  25134          Encryption
  25135         </c>
  25136          property  on the
  25137                         
  25138         <c>
  25139          ZipFile
  25140         </c>
  25141         , once it  has been c reated via  a call to
  25142                         
  25143         <c>
  25144          ZipFile.Re ad()
  25145         </c>
  25146         , does not  affect en tries that  were prev iously rea d.
  25147                       
  25148        </para>
  25149                     
  25150                      
  25151        <para>
  25152                         For e xample, su ppose you  read a 
  25153         <c>
  25154          ZipFile
  25155         </c>
  25156         , and ther e is an en crypted
  25157                         entry .  Setting  the 
  25158         <c>
  25159          Encryption
  25160         </c>
  25161          property  on that 
  25162         <c>
  25163          ZipFile
  25164         </c>
  25165          and
  25166                         then  calling 
  25167         <c>
  25168          Save()
  25169         </c>
  25170          on the 
  25171         <c>
  25172          ZipFile
  25173         </c>
  25174          does not  update the
  25175                         
  25176         <c>
  25177          Encryption
  25178         </c>
  25179          used for  the entrie s in the a rchive.  N either is  an
  25180                         excep tion throw n. Instead , what hap pens durin g the 
  25181         <c>
  25182          Save()
  25183         </c>
  25184          is that
  25185                         all p reviously  existing e ntries are  copied th rough to t he new zip  archive,
  25186                         with  whatever e ncryption  and passwo rd that wa s used whe n original ly
  25187                         creat ing the zi p archive.  Upon re-r eading tha t archive,  to extrac t
  25188                         entri es, applic ations sho uld use th e original  password  or passwor ds, if
  25189                         any.
  25190                       
  25191        </para>
  25192                     
  25193                      
  25194        <para>
  25195                         Suppo se an appl ication re ads a 
  25196         <c>
  25197          ZipFile
  25198         </c>
  25199         , and ther e is an en crypted
  25200                         entry .  Setting  the 
  25201         <c>
  25202          Encryption
  25203         </c>
  25204          property  on that 
  25205         <c>
  25206          ZipFile
  25207         </c>
  25208          and
  25209                         then  adding new  entries ( via 
  25210         <c>
  25211          AddFile()
  25212         </c>
  25213        
  25214         <c>
  25215          AddEntry()
  25216         </c>
  25217         , etc)
  25218                         and t hen callin
  25219         <c>
  25220          Save()
  25221         </c>
  25222          on the 
  25223         <c>
  25224          ZipFile
  25225         </c>
  25226          does not  update the
  25227                         
  25228         <c>
  25229          Encryption
  25230         </c>
  25231          on any of  the entri es that ha d previous ly been in  the
  25232                         
  25233         <c>
  25234          ZipFile
  25235         </c>
  25236         .  The 
  25237         <c>
  25238          Encryption
  25239         </c>
  25240          property  applies on ly to the
  25241                         newly -added ent ries.
  25242                       
  25243        </para>
  25244                     
  25245                      
  25246       </remarks>
  25247                    
  25248                     
  25249       <example>
  25250                      
  25251        <para>
  25252                         This  example cr eates a zi p archive  that uses  encryption , and then  extracts
  25253                         entri es from th e archive.   When cre ating the  zip archiv e, the Rea dMe.txt
  25254                         file  is zipped  without us ing a pass word or en cryption.   The other  files
  25255                         use e ncryption.
  25256                       
  25257        </para>
  25258                     
  25259                      
  25260        <code>
  25261                       // Crea te a zip a rchive wit h AES Encr yption.
  25262                       using ( ZipFile zi p = new Zi pFile())
  25263                       {
  25264                           zip .AddFile(" ReadMe.txt ");
  25265                           zip .Encryptio n= Encrypt ionAlgorit hm.WinZipA es256;
  25266                           zip .Password=  "Top.Secr et.No.Peek ing!";
  25267                           zip .AddFile(" 7440-N49th .png");
  25268                           zip .AddFile(" 2008-Regio nal-Sales- Report.pdf ");
  25269                           zip .Save("Enc ryptedArch ive.zip");
  25270                       }
  25271                      
  25272                       // Extr act a zip  archive th at uses AE S Encrypti on.
  25273                       // You  do not nee d to speci fy the alg orithm dur ing extrac tion.
  25274                       using ( ZipFile zi p = ZipFil e.Read("En cryptedArc hive.zip") )
  25275                       {
  25276                           zip .Password=  "Top.Secr et.No.Peek ing!";
  25277                           zip .ExtractAl l("extract Directory" );
  25278                       }
  25279                       
  25280        </code>
  25281                     
  25282                      
  25283        <code 
  25284         lang="VB"
  25285        >
  25286                       ' Creat e a zip th at uses En cryption.
  25287                       Using z ip As New  ZipFile()
  25288                           zip .Encryptio n= Encrypt ionAlgorit hm.WinZipA es256
  25289                           zip .Password=  "Top.Secr et.No.Peek ing!"
  25290                           zip .AddFile(" ReadMe.txt ")
  25291                           zip .AddFile(" 7440-N49th .png")
  25292                           zip .AddFile(" 2008-Regio nal-Sales- Report.pdf ")
  25293                           zip .Save("Enc ryptedArch ive.zip")
  25294                       End Usi ng
  25295                      
  25296                       ' Extra ct a zip a rchive tha t uses AES  Encryptio n.
  25297                       ' You d o not need  to specif y the algo rithm duri ng extract ion.
  25298                       Using ( zip as Zip File = Zip File.Read( "Encrypted Archive.zi p"))
  25299                           zip .Password=  "Top.Secr et.No.Peek ing!"
  25300                           zip .ExtractAl l("extract Directory" )
  25301                       End Usi ng
  25302                       
  25303        </code>
  25304                     
  25305                      
  25306       </example>
  25307                    
  25308                     
  25309       <seealso 
  25310        cref="P:Io nic.Zip.Zi pFile.Pass word"
  25311       >
  25312        ZipFile.Pa ssword
  25313       </seealso>
  25314                     
  25315       <seealso 
  25316        cref="P:Io nic.Zip.Zi pEntry.Enc ryption"
  25317       >
  25318        ZipEntry.E ncryption
  25319       </seealso>
  25320               
  25321      </member>
  25322              
  25323      <member 
  25324       name="P:Io nic.Zip.Zi pFile.SetC ompression "
  25325      >
  25326                     
  25327       <summary>
  25328                        A cal lback that  allows th e applicat ion to spe cify the c ompression  level
  25329                        to us e for entr ies subseq uently add ed to the  zip archiv e.
  25330                      
  25331       </summary>
  25332                    
  25333                     
  25334       <remarks>
  25335                     
  25336                      
  25337        <para>
  25338                         With  this callb ack, the D otNetZip l ibrary all ows the ap plication  to
  25339                         deter mine wheth er compres sion will  be used, a t the time  of the
  25340                         
  25341         <c>
  25342          Save
  25343         </c>
  25344         . This may  be useful  if the ap plication  wants to f avor
  25345                         speed  over size , and want s to defer  the decis ion until  the time o f
  25346                         
  25347         <c>
  25348          Save
  25349         </c>
  25350         .
  25351                       
  25352        </para>
  25353                     
  25354                      
  25355        <para>
  25356                         Typic ally appli cations se t the 
  25357         <see 
  25358          cref="P:Io nic.Zip.Zi pFile.Comp ressionLev el"
  25359         />
  25360          property  on
  25361                         the 
  25362         <c>
  25363          ZipFile
  25364         </c>
  25365          or on eac
  25366         <c>
  25367          ZipEntry
  25368         </c>
  25369          to determ ine the le vel of
  25370                         compr ession use d. This is  done at t he time th e entry is  added to  the
  25371                         
  25372         <c>
  25373          ZipFile
  25374         </c>
  25375         . Setting  the proper ty to
  25376                         
  25377         <c>
  25378          Ionic.Zlib .Compressi onLevel.No ne
  25379         </c>
  25380          means no  compressio n will be  used.
  25381                       
  25382        </para>
  25383                     
  25384                      
  25385        <para>
  25386                         This  callback a llows the  applicatio n to defer  the decis ion on the
  25387                         
  25388         <c>
  25389          Compressio nLevel
  25390         </c>
  25391          to use, u ntil the t ime of the  call to
  25392                         
  25393         <c>
  25394          ZipFile.Sa ve()
  25395         </c>
  25396         . The call back is in voked once  per 
  25397         <c>
  25398          ZipEntry
  25399         </c>
  25400         ,
  25401                         at th e time the  data for  the entry  is being w ritten out  as part o f a
  25402                         
  25403         <c>
  25404          Save()
  25405         </c>
  25406          operation . The appl ication ca n use what ever crite ria it
  25407                         likes  in determ ining the  level to r eturn.  Fo r example,  an applic ation may
  25408                         wish  that no .m p3 files s hould be c ompressed,  because t hey are al ready
  25409                         compr essed and  the extra  compressio n is not w orth the C PU time in curred,
  25410                         and s o can retu rn 
  25411         <c>
  25412          None
  25413         </c>
  25414          for all . mp3 entrie s.
  25415                       
  25416        </para>
  25417                     
  25418                      
  25419        <para>
  25420                         The l ibrary det ermines wh ether comp ression wi ll be atte mpted for  an entry
  25421                         this  way: If th e entry is  a zero le ngth file,  or a dire ctory, no
  25422                         compr ession is  used.  Oth erwise, if  this call back is se t, it is i nvoked
  25423                         and t he 
  25424         <c>
  25425          Compressio nLevel
  25426         </c>
  25427          is set to  the retur n value. I f this
  25428                         callb ack has no t been set , then the  previousl y set valu e for
  25429                         
  25430         <c>
  25431          Compressio nLevel
  25432         </c>
  25433          is used.
  25434                       
  25435        </para>
  25436                     
  25437                      
  25438       </remarks>
  25439               
  25440      </member>
  25441              
  25442      <member 
  25443       name="P:Io nic.Zip.Zi pFile.MaxO utputSegme ntSize"
  25444      >
  25445                     
  25446       <summary>
  25447                      The max imum size  of an outp ut segment , when sav ing a spli t Zip file .
  25448                      
  25449       </summary>
  25450                     
  25451       <remarks>
  25452                        
  25453        <para>
  25454                           Set  this to a  non-zero  value befo re calling  
  25455         <see 
  25456          cref="M:Io nic.Zip.Zi pFile.Save "
  25457         />
  25458          or 
  25459         <see 
  25460          cref="M:Io nic.Zip.Zi pFile.Save (System.St ring)"
  25461         />
  25462          to specif y that the  ZipFile s hould be s aved as a
  25463                           spl it archive , also som etimes cal led a span ned archiv e. Some al so
  25464                           cal l them mul ti-file ar chives.
  25465                         
  25466        </para>
  25467                     
  25468                        
  25469        <para>
  25470                           A s plit zip a rchive is  saved in a  set of di screte fil esystem fi les,
  25471                           rat her than i n a single  file. Thi s is handy  when tran smitting t he
  25472                           arc hive in em ail or som e other me chanism th at has a l imit to th e size of
  25473                           eac h file.  T he first f ile in a s plit archi ve will be  named
  25474                           
  25475         <c>
  25476          basename.z 01
  25477         </c>
  25478         , the seco nd will be  named 
  25479         <c>
  25480          basename.z 02
  25481         </c>
  25482         , and
  25483                           so  on. The fi nal file i s named 
  25484         <c>
  25485          basename.z ip
  25486         </c>
  25487         . Accordin g to the z ip
  25488                           spe cification  from PKWa re, the mi nimum valu e is 65536 , for a 64 k segment
  25489                           siz e. The max imum numbe r of segme nts allows  in a spli t archive  is 99.
  25490                         
  25491        </para>
  25492                     
  25493                        
  25494        <para>
  25495                           The  value of  this prope rty determ ines the m aximum siz e of a spl it
  25496                           seg ment when  writing a  split arch ive.  For  example, s uppose you  have a
  25497                           
  25498         <c>
  25499          ZipFile
  25500         </c>
  25501          that woul d save to  a single f ile of 200 k. If you  set the
  25502                           
  25503         <c>
  25504          MaxOutputS egmentSize
  25505         </c>
  25506          to 65536  before cal ling 
  25507         <c>
  25508          Save()
  25509         </c>
  25510         , you
  25511                           wil l get four  distinct  output fil es. On the  other han d if you s et this
  25512                           pro perty to 2 56k, then  you will g et a singl e-file arc hive for t hat
  25513                           
  25514         <c>
  25515          ZipFile
  25516         </c>
  25517         .
  25518                         
  25519        </para>
  25520                     
  25521                        
  25522        <para>
  25523                           The  size of e ach split  output fil e will be  as large a s possible , up to
  25524                           the  maximum s ize set he re. The zi p specific ation requ ires that  some data
  25525                           fie lds in a z ip archive  may not s pan a spli t boundary , and an o utput
  25526                           seg ment may b e smaller  than the m aximum if  necessary  to avoid t hat
  25527                           pro blem. Also , obviousl y the fina l segment  of the arc hive may b e smaller
  25528                           tha n the maxi mum segmen t size. Se gments wil l never be  larger th an the
  25529                           val ue set wit h this pro perty.
  25530                         
  25531        </para>
  25532                     
  25533                        
  25534        <para>
  25535                           You  can save  a split Zi p file onl y when sav ing to a r egular fil esystem
  25536                           fil e. It's no t possible  to save a  split zip  file as a  self-extr acting
  25537                           arc hive, nor  is it poss ible to sa ve a split  zip file  to a strea m. When
  25538                           sav ing to a S FX or to a  Stream, t his proper ty is igno red.
  25539                         
  25540        </para>
  25541                     
  25542                        
  25543        <para>
  25544                           Abo ut interop erability:  Split or  spanned zi p files pr oduced by  DotNetZip
  25545                           can  be read b y WinZip o r PKZip, a nd vice-ve rsa. Segme nted zip f iles may
  25546                           not  be readab le by othe r tools, i f those ot her tools  don't supp ort zip
  25547                           spa nning or s plitting.   When in d oubt, test .  I don't  believe W indows
  25548                           Exp lorer can  extract a  split arch ive.
  25549                         
  25550        </para>
  25551                     
  25552                        
  25553        <para>
  25554                           Thi s property  has no ef fect when  reading a  split arch ive. You c an read
  25555                           a s plit archi ve in the  normal way  with DotN etZip.
  25556                         
  25557        </para>
  25558                     
  25559                        
  25560        <para>
  25561                           Whe n saving a  zip file,  if you wa nt a regul ar zip fil e rather t han a
  25562                           spl it zip fil e, don't s et this pr operty, or  set it to  Zero.
  25563                         
  25564        </para>
  25565                     
  25566                        
  25567        <para>
  25568                           If  you read a  split arc hive, with  
  25569         <see 
  25570          cref="M:Io nic.Zip.Zi pFile.Read (System.St ring)"
  25571         />
  25572          and
  25573                           the n subseque ntly call 
  25574         <c>
  25575          ZipFile.Sa ve()
  25576         </c>
  25577         , unless y ou set thi s
  25578                           pro perty befo re calling  
  25579         <c>
  25580          Save()
  25581         </c>
  25582         , you will  get a nor mal,
  25583                           sin gle-file a rchive.
  25584                         
  25585        </para>
  25586                      
  25587       </remarks>
  25588                    
  25589                     
  25590       <seealso 
  25591        cref="P:Io nic.Zip.Zi pFile.Numb erOfSegmen tsForMostR ecentSave"
  25592       />
  25593               
  25594      </member>
  25595              
  25596      <member 
  25597       name="P:Io nic.Zip.Zi pFile.Numb erOfSegmen tsForMostR ecentSave"
  25598      >
  25599                    
  25600       <summary>
  25601                       Return s the numb er of segm ents used  in the mos t recent S ave() oper ation.
  25602                     
  25603       </summary>
  25604                    
  25605       <remarks>
  25606                       
  25607        <para>
  25608                          This  is normal ly zero, u nless you  have set t he 
  25609         <see 
  25610          cref="P:Io nic.Zip.Zi pFile.MaxO utputSegme ntSize"
  25611         />
  25612          property.   If you h ave set 
  25613         <see 
  25614          cref="P:Io nic.Zip.Zi pFile.MaxO utputSegme ntSize"
  25615         />
  25616         , and then  you save  a file, af ter the ca ll to
  25617                          Save () complet es, you ca n read thi s value to  learn the  number of  segments  that
  25618                          were  created.
  25619                        
  25620        </para>
  25621                       
  25622        <para>
  25623                          If y ou call Sa ve("Archiv e.zip"), a nd it crea tes 5 segm ents, then  you
  25624                          will  have file system fil es named A rchive.z01 , Archive. z02, Archi ve.z03,
  25625                          Arch ive.z04, a nd Archive .zip, and  the value  of this pr operty wil l be 5.
  25626                        
  25627        </para>
  25628                     
  25629       </remarks>
  25630                    
  25631       <seealso 
  25632        cref="P:Io nic.Zip.Zi pFile.MaxO utputSegme ntSize"
  25633       />
  25634               
  25635      </member>
  25636              
  25637      <member 
  25638       name="P:Io nic.Zip.Zi pFile.Para llelDeflat eThreshold "
  25639      >
  25640                     
  25641       <summary>
  25642                        The s ize thresh old for an  entry, ab ove which  a parallel  deflate i s used.
  25643                      
  25644       </summary>
  25645                    
  25646                     
  25647       <remarks>
  25648                     
  25649                        
  25650        <para>
  25651                           Dot NetZip wil l use mult iple threa ds to comp ress any Z ipEntry,
  25652                           if  the entry  is larger  than the g iven size.   Zero mea ns "always
  25653                           use  parallel  deflate",  while -1 m eans "neve r use para llel
  25654                           def late". The  default v alue for t his proper ty is 512k . Aside
  25655                           fro m the spec ial values  of 0 and  1, the min imum value  is 65536.
  25656                         
  25657        </para>
  25658                     
  25659                        
  25660        <para>
  25661                           If  the entry  size canno t be known  before co mpression,  as with a
  25662                           rea d-forward  stream, th en Paralle l deflate  will never  be
  25663                           per formed, un less the v alue of th is propert y is zero.
  25664                         
  25665        </para>
  25666                     
  25667                        
  25668        <para>
  25669                           A p arallel de flate oper ations wil l speed up  the compr ession of
  25670                           lar ge files,  on compute rs with mu ltiple CPU s or multi ple CPU
  25671                           cor es.  For f iles above  1mb, on a  dual core  or dual-c pu (2p)
  25672                           mac hine, the  time requi red to com press the  file can b e 70% of t he
  25673                           sin gle-thread ed deflate .  For ver y large fi les on 4p  machines t he
  25674                           com pression c an be done  in 30% of  the norma l time.  T he downsid e
  25675                           is  that paral lel deflat e consumes  extra mem ory during  the defla te,
  25676                           and  the defla tion is no t as effec tive.
  25677                         
  25678        </para>
  25679                     
  25680                        
  25681        <para>
  25682                           Par allel defl ate tends  to yield s lightly le ss compres sion when
  25683                           com pared to a s single-t hreaded de flate; thi s is becau se the ori ginal
  25684                           dat a stream i s split in to multipl e independ ent buffer s, each of  which
  25685                           is  compressed  in parall el.  But b ecause the y are trea ted
  25686                           ind ependently , there is  no opport unity to s hare compr ession
  25687                           dic tionaries.   For that  reason, a  deflated  stream may  be slight ly
  25688                           lar ger when c ompressed  using para llel defla te, as com pared to a
  25689                           tra ditional s ingle-thre aded defla te. Someti mes the in crease ove r the
  25690                           nor mal deflat e is as mu ch as 5% o f the tota l compress ed size. F or
  25691                           lar ger files  it can be  as small a s 0.1%.
  25692                         
  25693        </para>
  25694                     
  25695                        
  25696        <para>
  25697                           Mul ti-threade d compress ion does n ot give as  much an a dvantage w hen
  25698                           usi ng Encrypt ion. This  is primari ly because  encryptio n tends to  slow
  25699                           dow n the enti re pipelin e. Also, m ulti-threa ded compre ssion give s less
  25700                           of  an advanta ge when us ing lower  compressio n levels,  for exampl
  25701         <see 
  25702          cref="F:Io nic.Zlib.C ompression Level.Best Speed"
  25703         />
  25704         .  You may  have to
  25705                           per form some  tests to d etermine t he best ap proach for  your situ ation.
  25706                         
  25707        </para>
  25708                     
  25709                      
  25710       </remarks>
  25711                    
  25712                     
  25713       <seealso 
  25714        cref="P:Io nic.Zip.Zi pFile.Para llelDeflat eMaxBuffer Pairs"
  25715       />
  25716                    
  25717               
  25718      </member>
  25719              
  25720      <member 
  25721       name="P:Io nic.Zip.Zi pFile.Para llelDeflat eMaxBuffer Pairs"
  25722      >
  25723                     
  25724       <summary>
  25725                        The m aximum num ber of buf fer pairs  to use whe n performi ng
  25726                        paral lel compre ssion.
  25727                      
  25728       </summary>
  25729                    
  25730                     
  25731       <remarks>
  25732                      
  25733        <para>
  25734                         This  property s ets an upp er limit o n the numb er of memo ry
  25735                         buffe r pairs to  create wh en perform ing parall el
  25736                         compr ession.  T he impleme ntation of  the paral lel
  25737                         compr ession str eam alloca tes multip le buffers  to
  25738                         facil itate para llel compr ession.  A s each buf fer fills  up,
  25739                         the s tream uses  
  25740         <see 
  25741          cref="M:Sy stem.Threa ding.Threa dPool.Queu eUserWorkI tem(System .Threading .WaitCallb ack)"
  25742         >
  25743                          Threa dPool.Queu eUserWorkI tem()
  25744         </see>
  25745          to compre ss those
  25746                         buffe rs in a ba ckground t hreadpool  thread. Af ter a buff er
  25747                         is co mpressed,  it is re-o rdered and  written t o the outp ut
  25748                         strea m.
  25749                       
  25750        </para>
  25751                     
  25752                      
  25753        <para>
  25754                         A hig her number  of buffer  pairs ena bles a hig her degree  of
  25755                         paral lelism, wh ich tends  to increas e the spee d of compr ession on
  25756                         multi -cpu compu ters.  On  the other  hand, a hi gher numbe r of buffe r
  25757                         pairs  also impl ies a larg er memory  consumptio n, more ac tive worke r
  25758                         threa ds, and a  higher cpu  utilizati on for any  compressi on. This
  25759                         prope rty enable s the appl ication to  limit its  memory co nsumption  and
  25760                         CPU u tilization  behavior  depending  on require ments.
  25761                       
  25762        </para>
  25763                     
  25764                      
  25765        <para>
  25766                         For e ach compre ssion "tas k" that oc curs in pa rallel, th ere are 2
  25767                         buffe rs allocat ed: one fo r input an d one for  output.  T his proper ty
  25768                         sets  a limit fo r the numb er of pair s.  The to tal amount  of storag e
  25769                         space  allocated  for buffe ring will  then be (N *S*2), whe re N is th e
  25770                         numbe r of buffe r pairs, S  is the si ze of each  buffer (
  25771         <see 
  25772          cref="P:Io nic.Zip.Zi pFile.Buff erSize"
  25773         />
  25774         ).  By def ault, DotN etZip allo cates 4 bu ffer
  25775                         pairs  per CPU c ore, so if  your mach ine has 4  cores, and  you retai n
  25776                         the d efault buf fer size o f 128k, th en the
  25777                         Paral lelDeflate OutputStre am will us e 4 * 4 *  2 * 128kb  of buffer
  25778                         memor y in total , or 4mb,  in blocks  of 128kb.   If you th en set thi s
  25779                         prope rty to 8,  then the n umber will  be 8 * 2  * 128kb of  buffer
  25780                         memor y, or 2mb.
  25781                       
  25782        </para>
  25783                     
  25784                      
  25785        <para>
  25786                         CPU u tilization  will also  go up wit h addition al buffers , because  a
  25787                         large r number o f buffer p airs allow s a larger  number of  backgroun d
  25788                         threa ds to comp ress in pa rallel. If  you find  that paral lel
  25789                         compr ession is  consuming  too much m emory or C PU, you ca n adjust t his
  25790                         value  downward.
  25791                       
  25792        </para>
  25793                     
  25794                      
  25795        <para>
  25796                         The d efault val ue is 16.  Different  values may  deliver b etter or
  25797                         worse  results,  depending  on your pr iorities a nd the dyn amic
  25798                         perfo rmance cha racteristi cs of your  storage a nd compute  resources .
  25799                       
  25800        </para>
  25801                     
  25802                      
  25803        <para>
  25804                         This  property i s not the  number of  buffer pai rs to use;  it is an
  25805                         upper  limit. An  illustrat ion: Suppo se you hav e an appli cation tha t
  25806                         uses  the defaul t value of  this prop erty (whic h is 16),  and it run s
  25807                         on a  machine wi th 2 CPU c ores. In t hat case,  DotNetZip  will alloc ate
  25808                         4 buf fer pairs  per CPU co re, for a  total of 8  pairs.  T he upper
  25809                         limit  specified  by this p roperty ha s no effec t.
  25810                       
  25811        </para>
  25812                     
  25813                      
  25814        <para>
  25815                         The a pplication  can set t his value  at any tim e
  25816                         befor e calling 
  25817         <c>
  25818          ZipFile.Sa ve()
  25819         </c>
  25820         .
  25821                       
  25822        </para>
  25823                      
  25824       </remarks>
  25825                    
  25826                     
  25827       <seealso 
  25828        cref="P:Io nic.Zip.Zi pFile.Para llelDeflat eThreshold "
  25829       />
  25830                    
  25831               
  25832      </member>
  25833              
  25834      <member 
  25835       name="P:Io nic.Zip.Zi pFile.Libr aryVersion "
  25836      >
  25837                     
  25838       <summary>
  25839                      Returns  the versi on number  on the Dot NetZip ass embly.
  25840                      
  25841       </summary>
  25842                    
  25843                     
  25844       <remarks>
  25845                        
  25846        <para>
  25847                           Thi s property  is expose d as a con venience.   Callers c ould also  get the
  25848                           ver sion value  by retrie ving GetNa me().Versi on on the
  25849                           Sys tem.Reflec tion.Assem bly object  pointing  to the Dot NetZip
  25850                           ass embly. But  sometimes  it is not  clear whi ch assembl y is being  loaded.
  25851                           Thi s property  makes it  clear.
  25852                         
  25853        </para>
  25854                        
  25855        <para>
  25856                           Thi s static p roperty is  primarily  useful fo r diagnost ic purpose s.
  25857                         
  25858        </para>
  25859                      
  25860       </remarks>
  25861               
  25862      </member>
  25863              
  25864      <member 
  25865       name="P:Io nic.Zip.Zi pFile.Item (System.In t32)"
  25866      >
  25867                     
  25868       <summary>
  25869                        This  is an inte ger indexe r into the  Zip archi ve.
  25870                      
  25871       </summary>
  25872                    
  25873                     
  25874       <remarks>
  25875                      
  25876        <para>
  25877                         This  property i s read-onl y.
  25878                       
  25879        </para>
  25880                     
  25881                      
  25882        <para>
  25883                         Inter nally, the  
  25884         <c>
  25885          ZipEntry
  25886         </c>
  25887          instances  that belo ng to the
  25888                         
  25889         <c>
  25890          ZipFile
  25891         </c>
  25892          are store d in a Dic tionary.   When you u se this
  25893                         index er the fir st time, i t creates  a read-onl y
  25894                         
  25895         <c>
  25896          List&lt;Zi pEntry&gt;
  25897         </c>
  25898          from the  Dictionary .Values Co llection.
  25899                         If at  any time  you modify  the set o f entries  in the 
  25900         <c>
  25901          ZipFile
  25902         </c>
  25903         ,
  25904                         eithe r by addin g an entry , removing  an entry,  or renami ng an
  25905                         entry , a new Li st will be  created,  and the nu meric inde xes for th e
  25906                         remai ning entri es may be  different.
  25907                       
  25908        </para>
  25909                     
  25910                      
  25911        <para>
  25912                         This  means you  cannot ren ame any Zi pEntry fro m
  25913                         insid e an enume ration of  the zip fi le.
  25914                       
  25915        </para>
  25916                     
  25917                      
  25918        <param 
  25919         name="ix"
  25920        >
  25921                         The i ndex value .
  25922                       
  25923        </param>
  25924                     
  25925                      
  25926       </remarks>
  25927                    
  25928                     
  25929       <returns>
  25930                        The 
  25931        <c>
  25932         ZipEntry
  25933        </c>
  25934         within th e Zip arch ive at the  specified  index. If  the
  25935                        entry  does not  exist in t he archive , this ind exer throw s.
  25936                      
  25937       </returns>
  25938                    
  25939               
  25940      </member>
  25941              
  25942      <member 
  25943       name="P:Io nic.Zip.Zi pFile.Item (System.St ring)"
  25944      >
  25945                     
  25946       <summary>
  25947                        This  is a name- based inde xer into t he Zip arc hive.
  25948                      
  25949       </summary>
  25950                    
  25951                     
  25952       <remarks>
  25953                      
  25954        <para>
  25955                         This  property i s read-onl y.
  25956                       
  25957        </para>
  25958                     
  25959                      
  25960        <para>
  25961                         The 
  25962         <see 
  25963          cref="P:Io nic.Zip.Zi pFile.Case SensitiveR etrieval"
  25964         />
  25965          property  on the 
  25966         <c>
  25967          ZipFile
  25968         </c>
  25969                         deter mines whet her retrie val via th is indexer  is done v ia case-se nsitive
  25970                         compa risons. By  default,  retrieval  is not cas e sensitiv e.  This m akes
  25971                         sense  on Window s, in whic h filesyst ems are no t case sen sitive.
  25972                       
  25973        </para>
  25974                     
  25975                      
  25976        <para>
  25977                         Regar dless of c ase-sensit ivity, it  is not alw ays the ca se that
  25978                         
  25979         <c>
  25980          this[value ].FileName  == value
  25981         </c>
  25982         . In other  words, th
  25983         <c>
  25984          FileName
  25985         </c>
  25986                         prope rty of the  
  25987         <c>
  25988          ZipEntry
  25989         </c>
  25990          retrieved  with this  indexer,  may or may
  25991                         not b e equal to  the index  value.
  25992                       
  25993        </para>
  25994                     
  25995                      
  25996        <para>
  25997                         This  is because  DotNetZip  performs  a normaliz ation of f ilenames p assed to
  25998                         this  indexer, b efore atte mpting to  retrieve t he item.   That norma lization
  25999                         inclu des: remov al of a vo lume lette r and colo n, swappin g backward  slashes
  26000                         for f orward sla shes.  So,  
  26001         <c>
  26002          zip["dir1\ \entry1.tx t"].FileNa me ==
  26003                          "dir1 /entry.txt "
  26004         </c>
  26005         .
  26006                       
  26007        </para>
  26008                     
  26009                      
  26010        <para>
  26011                         Direc tory entri es in the  zip file m ay be retr ieved via  this index er only
  26012                         with  names that  have a tr ailing sla sh. DotNet Zip automa tically ap pends a
  26013                         trail ing slash  to the nam es of any  directory  entries ad ded to a z ip.
  26014                       
  26015        </para>
  26016                     
  26017                      
  26018       </remarks>
  26019                    
  26020                     
  26021       <example>
  26022                      This ex ample extr acts only  the entrie s in a zip  file that  are .txt  files.
  26023                      
  26024        <code>
  26025                       using ( ZipFile zi p = ZipFil e.Read("Pa ckedDocume nts.zip"))
  26026                       {
  26027                         forea ch (string  s1 in zip .EntryFile names)
  26028                         {
  26029                           if  (s1.EndsWi th(".txt") )
  26030                             z ip[s1].Ext ract("text files");
  26031                         }
  26032                       }
  26033                       
  26034        </code>
  26035                      
  26036        <code 
  26037         lang="VB"
  26038        >
  26039                         Using  zip As Zi pFile = Zi pFile.Read ("PackedDo cuments.zi p")
  26040                             D im s1 As S tring
  26041                             F or Each s1  In zip.En tryFilenam es
  26042                                  If s1.E ndsWith(". txt") Then
  26043                                      zip (s1).Extra ct("textfi les")
  26044                                  End If
  26045                             N ext
  26046                         End U sing
  26047                       
  26048        </code>
  26049                      
  26050       </example>
  26051                     
  26052       <seealso 
  26053        cref="M:Io nic.Zip.Zi pFile.Remo veEntry(Sy stem.Strin g)"
  26054       />
  26055                    
  26056                     
  26057       <exception  
  26058        cref="T:Sy stem.Argum entExcepti on"
  26059       >
  26060                        Throw n if the c aller atte mpts to as sign a non -null valu e to the i ndexer.
  26061                      
  26062       </exceptio n>
  26063                    
  26064                     
  26065       <param 
  26066        name="file Name"
  26067       >
  26068                        The n ame of the  file, inc luding any  directory  path, to  retrieve f rom the
  26069                        zip.   The filen ame match  is not cas e-sensitiv e by defau lt; you ca n use the
  26070                        
  26071        <see 
  26072         cref="P:Io nic.Zip.Zi pFile.Case SensitiveR etrieval"
  26073        />
  26074         property  to change  this behav ior. The
  26075                        pathn ame can us e forward- slashes or  backward  slashes.
  26076                      
  26077       </param>
  26078                    
  26079                     
  26080       <returns>
  26081                        The 
  26082        <c>
  26083         ZipEntry
  26084        </c>
  26085         within th e Zip arch ive, given  by the sp ecified
  26086                        filen ame. If th e named en try does n ot exist i n the arch ive, this  indexer
  26087                        retur ns 
  26088        <c>
  26089         null
  26090        </c>
  26091         (
  26092        <c>
  26093         Nothing
  26094        </c>
  26095         in VB).
  26096                      
  26097       </returns>
  26098                    
  26099               
  26100      </member>
  26101              
  26102      <member 
  26103       name="P:Io nic.Zip.Zi pFile.Entr yFileNames "
  26104      >
  26105                     
  26106       <summary>
  26107                        The l ist of fil enames for  the entri es contain ed within  the zip ar chive.
  26108                      
  26109       </summary>
  26110                    
  26111                     
  26112       <remarks>
  26113                        Accor ding to th e ZIP spec ification,  the names  of the en tries use  forward
  26114                        slash es in path names.  If  you are s canning th rough the  list, you  may have
  26115                        to sw ap forward  slashes f or backsla shes.
  26116                      
  26117       </remarks>
  26118                    
  26119                     
  26120       <seealso 
  26121        cref="P:Io nic.Zip.Zi pFile.Item (System.St ring)"
  26122       />
  26123                    
  26124                     
  26125       <example>
  26126                        This  example sh ows one wa y to test  if a filen ame is alr eady conta ined
  26127                        withi n a zip ar chive.
  26128                      
  26129        <code>
  26130                       String  zipFileToR ead= "Pack edDocument s.zip";
  26131                       string  candidate  = "DatedMa terial.xps ";
  26132                       using ( ZipFile zi p = new Zi pFile(zipF ileToRead) )
  26133                       {
  26134                         if (z ip.EntryFi lenames.Co ntains(can didate))
  26135                           Con sole.Write Line("The  file '{0}'  exists in  the zip a rchive '{1 }'",
  26136                                               candi date,
  26137                                               zipFi leName);
  26138                         else
  26139                           Con sole.Write Line("The  file, '{0} ', does no t exist in  the zip a rchive '{1 }'",
  26140                                               candi date,
  26141                                               zipFi leName);
  26142                         Conso le.WriteLi ne();
  26143                       }
  26144                       
  26145        </code>
  26146                      
  26147        <code 
  26148         lang="VB"
  26149        >
  26150                         Dim z ipFileToRe ad As Stri ng = "Pack edDocument s.zip"
  26151                         Dim c andidate A s String =  "DatedMat erial.xps"
  26152                         Using  zip As Zi pFile.Read (ZipFileTo Read)
  26153                             I f zip.Entr yFilenames .Contains( candidate)  Then
  26154                                  Console .WriteLine ("The file  '{0}' exi sts in the  zip archi ve '{1}'",  _
  26155                                               candi date, _
  26156                                               zipFi leName)
  26157                             E lse
  26158                                Console.W riteLine(" The file,  '{0}', doe s not exis t in the z ip archive  '{1}'", _
  26159                                               candi date, _
  26160                                               zipFi leName)
  26161                             E nd If
  26162                             C onsole.Wri teLine
  26163                         End U sing
  26164                       
  26165        </code>
  26166                      
  26167       </example>
  26168                    
  26169                     
  26170       <returns>
  26171                        The l ist of str ings for t he filenam es contain ed within  the Zip ar chive.
  26172                      
  26173       </returns>
  26174                    
  26175               
  26176      </member>
  26177              
  26178      <member 
  26179       name="P:Io nic.Zip.Zi pFile.Entr ies"
  26180      >
  26181                     
  26182       <summary>
  26183                        Retur ns the rea donly coll ection of  entries in  the Zip a rchive.
  26184                      
  26185       </summary>
  26186                    
  26187                     
  26188       <remarks>
  26189                     
  26190                      
  26191        <para>
  26192                         If th ere are no  entries i n the curr ent 
  26193         <c>
  26194          ZipFile
  26195         </c>
  26196         , the valu e returned  is a
  26197                         non-n ull zero-e lement col lection.   If there a re entries  in the zi p file,
  26198                         the e lements ar e returned  in no par ticular or der.
  26199                       
  26200        </para>
  26201                      
  26202        <para>
  26203                         This  is the imp lied enume rator on t he 
  26204         <c>
  26205          ZipFile
  26206         </c>
  26207          class.  I f you use  a
  26208                         
  26209         <c>
  26210          ZipFile
  26211         </c>
  26212          instance  in a conte xt that ex pects an e numerator,  you will
  26213                         get t his collec tion.
  26214                       
  26215        </para>
  26216                      
  26217       </remarks>
  26218                     
  26219       <seealso 
  26220        cref="P:Io nic.Zip.Zi pFile.Entr iesSorted"
  26221       />
  26222               
  26223      </member>
  26224              
  26225      <member 
  26226       name="P:Io nic.Zip.Zi pFile.Entr iesSorted"
  26227      >
  26228                     
  26229       <summary>
  26230                        Retur ns a reado nly collec tion of en tries in t he Zip arc hive, sort ed by File Name.
  26231                      
  26232       </summary>
  26233                    
  26234                     
  26235       <remarks>
  26236                        If th ere are no  entries i n the curr ent 
  26237        <c>
  26238         ZipFile
  26239        </c>
  26240        , the valu e returned
  26241                        is a  non-null z ero-elemen t collecti on.  If th ere are en tries in t he zip
  26242                        file,  the eleme nts are re turned sor ted by the  name of t he entry.
  26243                      
  26244       </remarks>
  26245                    
  26246                     
  26247       <example>
  26248                     
  26249                        This  example fi lls a Wind ows Forms  ListView w ith the en tries in a  zip file.
  26250                     
  26251                      
  26252        <code 
  26253         lang="C#"
  26254        >
  26255                       using ( ZipFile zi p = ZipFil e.Read(zip File))
  26256                       {
  26257                           for each (ZipE ntry entry  in zip.En triesSorte d)
  26258                           {
  26259                                ListViewI tem item =  new ListV iewItem(n. ToString() );
  26260                                n++;
  26261                                string[]  subitems =  new strin g[] {
  26262                                    entry .FileName. Replace("/ ","\\"),
  26263                                    entry .LastModif ied.ToStri ng("yyyy-M M-dd HH:mm :ss"),
  26264                                    entry .Uncompres sedSize.To String(),
  26265                                    Strin g.Format(" {0,5:F0}%" , entry.Co mpressionR atio),
  26266                                    entry .Compresse dSize.ToSt ring(),
  26267                                    (entr y.UsesEncr yption) ?  "Y" : "N",
  26268                                    Strin g.Format(" {0:X8}", e ntry.Crc)} ;
  26269                      
  26270                                foreach ( String s i n subitems )
  26271                                {
  26272                                    ListV iewItem.Li stViewSubI tem subite m = new Li stViewItem .ListViewS ubItem();
  26273                                    subit em.Text =  s;
  26274                                    item. SubItems.A dd(subitem );
  26275                                }
  26276                      
  26277                                this.list View1.Item s.Add(item );
  26278                           }
  26279                       }
  26280                       
  26281        </code>
  26282                      
  26283       </example>
  26284                    
  26285                     
  26286       <seealso 
  26287        cref="P:Io nic.Zip.Zi pFile.Entr ies"
  26288       />
  26289               
  26290      </member>
  26291              
  26292      <member 
  26293       name="P:Io nic.Zip.Zi pFile.Coun t"
  26294      >
  26295                    
  26296       <summary>
  26297                     Returns  the number  of entrie s in the Z ip archive .
  26298                     
  26299       </summary>
  26300               
  26301      </member>
  26302              
  26303      <member 
  26304       name="E:Io nic.Zip.Zi pFile.Save Progress"
  26305      >
  26306                     
  26307       <summary>
  26308                        An ev ent handle r invoked  when a Sav e() starts , before a nd after e ach
  26309                        entry  has been  written to  the archi ve, when a  Save() co mpletes, a nd
  26310                        durin g other Sa ve events.
  26311                      
  26312       </summary>
  26313                    
  26314                     
  26315       <remarks>
  26316                      
  26317        <para>
  26318                         Depen ding on th e particul ar event,  different  properties  on the 
  26319         <see 
  26320          cref="T:Io nic.Zip.Sa veProgress EventArgs"
  26321         />
  26322          parameter  are set.   The follo wing
  26323                         table  summarize s the avai lable Even tTypes and  the condi tions unde r
  26324                         which  this even t handler  is invoked  with a
  26325                         
  26326         <c>
  26327          SaveProgre ssEventArg s
  26328         </c>
  26329          with the  given Even tType.
  26330                       
  26331        </para>
  26332                     
  26333                      
  26334        <list 
  26335         type="tabl e"
  26336        >
  26337                       
  26338         <listheade r>
  26339                        
  26340          <term>
  26341           value of E ntryType
  26342          </term>
  26343                        
  26344          <descripti on>
  26345           Meaning an d conditio ns
  26346          </descript ion>
  26347                        
  26348         </listhead er>
  26349                      
  26350                       
  26351         <item>
  26352                        
  26353          <term>
  26354           ZipProgres sEventType .Saving_St arted
  26355          </term>
  26356                        
  26357          <descripti on>
  26358           Fired when  ZipFile.S ave() begi ns.
  26359                         
  26360          </descript ion>
  26361                        
  26362         </item>
  26363                      
  26364                       
  26365         <item>
  26366                        
  26367          <term>
  26368           ZipProgres sEventType .Saving_Be foreSaveEn try
  26369          </term>
  26370                        
  26371          <descripti on>
  26372                           Fired  within Zi pFile.Save (), just b efore writ ing data f or each
  26373                           parti cular entr y.
  26374                         
  26375          </descript ion>
  26376                        
  26377         </item>
  26378                      
  26379                       
  26380         <item>
  26381                        
  26382          <term>
  26383           ZipProgres sEventType .Saving_Af terSaveEnt ry
  26384          </term>
  26385                        
  26386          <descripti on>
  26387                           Fired  within Zi pFile.Save (), just a fter havin g finished  writing d ata
  26388                           for e ach partic ular entry .
  26389                         
  26390          </descript ion>
  26391                        
  26392         </item>
  26393                      
  26394                       
  26395         <item>
  26396                        
  26397          <term>
  26398           ZipProgres sEventType .Saving_Co mpleted
  26399          </term>
  26400                        
  26401          <descripti on>
  26402           Fired when  ZipFile.S ave() has  completed.
  26403                         
  26404          </descript ion>
  26405                        
  26406         </item>
  26407                      
  26408                       
  26409         <item>
  26410                        
  26411          <term>
  26412           ZipProgres sEventType .Saving_Af terSaveTem pArchive
  26413          </term>
  26414                        
  26415          <descripti on>
  26416                           Fired  after the  temporary  file has  been creat ed.  This  happens on ly
  26417                           when  saving to  a disk fil e.  This e vent will  not be inv oked when
  26418                           savin g to a str eam.
  26419                         
  26420          </descript ion>
  26421                        
  26422         </item>
  26423                      
  26424                       
  26425         <item>
  26426                        
  26427          <term>
  26428           ZipProgres sEventType .Saving_Be foreRename TempArchiv e
  26429          </term>
  26430                        
  26431          <descripti on>
  26432                           Fired  just befo re renamin g the temp orary file  to the pe rmanent
  26433                           locat ion.  This  happens o nly when s aving to a  disk file .  This ev ent
  26434                           will  not be inv oked when  saving to  a stream.
  26435                         
  26436          </descript ion>
  26437                        
  26438         </item>
  26439                      
  26440                       
  26441         <item>
  26442                        
  26443          <term>
  26444           ZipProgres sEventType .Saving_Af terRenameT empArchive
  26445          </term>
  26446                        
  26447          <descripti on>
  26448                           Fired  just afte r renaming  the tempo rary file  to the per manent
  26449                           locat ion.  This  happens o nly when s aving to a  disk file .  This ev ent
  26450                           will  not be inv oked when  saving to  a stream.
  26451                         
  26452          </descript ion>
  26453                        
  26454         </item>
  26455                      
  26456                       
  26457         <item>
  26458                        
  26459          <term>
  26460           ZipProgres sEventType .Saving_Af terCompile SelfExtrac tor
  26461          </term>
  26462                        
  26463          <descripti on>
  26464                           Fired  after a s elf-extrac ting archi ve has fin ished comp iling.  Th is
  26465                           Event Type is us ed only wi thin SaveS elfExtract or().
  26466                         
  26467          </descript ion>
  26468                        
  26469         </item>
  26470                      
  26471                       
  26472         <item>
  26473                        
  26474          <term>
  26475           ZipProgres sEventType .Saving_By tesRead
  26476          </term>
  26477                        
  26478          <descripti on>
  26479                           Set d uring the  save of a  particular  entry, to  update pr ogress of  the
  26480                           Save( ).  When t his EventT ype is set , the Byte sTransferr ed is the
  26481                           numbe r of bytes  that have  been read  from the  source str eam.  The
  26482                           Total BytesToTra nsfer is t he number  of bytes i n the unco mpressed
  26483                           file.
  26484                         
  26485          </descript ion>
  26486                        
  26487         </item>
  26488                      
  26489                       
  26490        </list>
  26491                      
  26492       </remarks>
  26493                    
  26494                     
  26495       <example>
  26496                     
  26497                         This  example u ses an ano nymous met hod to han dle the
  26498                         Save Progress e vent, by u pdating a  progress b ar.
  26499                     
  26500                      
  26501        <code 
  26502         lang="C#"
  26503        >
  26504                       progres sBar1.Valu e = 0;
  26505                       progres sBar1.Max  = listbox1 .Items.Cou nt;
  26506                       using ( ZipFile zi p = new Zi pFile())
  26507                       {
  26508                          // l istbox1 co ntains a l ist of fil enames
  26509                          zip. AddFiles(l istbox1.It ems);
  26510                      
  26511                          // d o the prog ress bar:
  26512                          zip. SaveProgre ss += (sen der, e) =& gt; {
  26513                             i f (e.Event Type == Zi pProgressE ventType.S aving_Befo reWriteEnt ry) {
  26514                                 progress Bar1.Perfo rmStep();
  26515                             }
  26516                          };
  26517                      
  26518                          zip. Save(fs);
  26519                       }
  26520                       
  26521        </code>
  26522                      
  26523       </example>
  26524                    
  26525                     
  26526       <example>
  26527                        This  example us es a named  method as  the
  26528                        
  26529        <c>
  26530         SaveProgre ss
  26531        </c>
  26532         event han dler, to u pdate the  user, in a
  26533                        conso le-based a pplication .
  26534                     
  26535                      
  26536        <code 
  26537         lang="C#"
  26538        >
  26539                       static  bool justH adByteUpda te= false;
  26540                       public  static voi d SaveProg ress(objec t sender,  SaveProgre ssEventArg s e)
  26541                       {
  26542                           if  (e.EventTy pe == ZipP rogressEve ntType.Sav ing_Starte d)
  26543                                Console.W riteLine(" Saving: {0 }", e.Arch iveName);
  26544                      
  26545                           els e if (e.Ev entType ==  ZipProgre ssEventTyp e.Saving_C ompleted)
  26546                           {
  26547                                justHadBy teUpdate=  false;
  26548                                Console.W riteLine() ;
  26549                                Console.W riteLine(" Done: {0}" , e.Archiv eName);
  26550                           }
  26551                      
  26552                           els e if (e.Ev entType ==  ZipProgre ssEventTyp e.Saving_B eforeWrite Entry)
  26553                           {
  26554                                if (justH adByteUpda te)
  26555                                    Conso le.WriteLi ne();
  26556                                Console.W riteLine("   Writing:  {0} ({1}/ {2})",
  26557                                                   e .CurrentEn try.FileNa me, e.Entr iesSaved,  e.EntriesT otal);
  26558                                justHadBy teUpdate=  false;
  26559                           }
  26560                      
  26561                           els e if (e.Ev entType ==  ZipProgre ssEventTyp e.Saving_E ntryBytesR ead)
  26562                           {
  26563                                if (justH adByteUpda te)
  26564                                    Conso le.SetCurs orPosition (0, Consol e.CursorTo p);
  26565                                 Console. Write("      {0}/{1}  ({2:N0}%)" , e.BytesT ransferred , e.TotalB ytesToTran sfer,
  26566                                               e.Byt esTransfer red / (0.0 1 * e.Tota lBytesToTr ansfer ));
  26567                                justHadBy teUpdate=  true;
  26568                           }
  26569                       }
  26570                      
  26571                       public  static Zip Up(string  targetZip,  string di rectory)
  26572                       {
  26573                         using  (var zip  = new ZipF ile()) {
  26574                           zip .SaveProgr ess += Sav eProgress;
  26575                           zip .AddDirect ory(direct ory);
  26576                           zip .Save(targ etZip);
  26577                         }
  26578                       }
  26579                      
  26580                       
  26581        </code>
  26582                     
  26583                      
  26584        <code 
  26585         lang="VB"
  26586        >
  26587                       Public  Sub ZipUp( ByVal targ etZip As S tring, ByV al directo ry As Stri ng)
  26588                           Usi ng zip As  ZipFile =  New ZipFil e
  26589                                AddHandle r zip.Save Progress,  AddressOf  MySaveProg ress
  26590                                zip.AddDi rectory(di rectory)
  26591                                zip.Save( targetZip)
  26592                           End  Using
  26593                       End Sub
  26594                      
  26595                       Private  Shared ju stHadByteU pdate As B oolean = F alse
  26596                      
  26597                       Public  Shared Sub  MySavePro gress(ByVa l sender A s Object,  ByVal e As  SaveProgr essEventAr gs)
  26598                           If  (e.EventTy pe Is ZipP rogressEve ntType.Sav ing_Starte d) Then
  26599                                Console.W riteLine(" Saving: {0 }", e.Arch iveName)
  26600                      
  26601                           Els eIf (e.Eve ntType Is  ZipProgres sEventType .Saving_Co mpleted) T hen
  26602                                justHadBy teUpdate =  False
  26603                                Console.W riteLine
  26604                                Console.W riteLine(" Done: {0}" , e.Archiv eName)
  26605                      
  26606                           Els eIf (e.Eve ntType Is  ZipProgres sEventType .Saving_Be foreWriteE ntry) Then
  26607                                If justHa dByteUpdat e Then
  26608                                    Conso le.WriteLi ne
  26609                                End If
  26610                                Console.W riteLine("   Writing:  {0} ({1}/ {2})", e.C urrentEntr y.FileName , e.Entrie sSaved, e. EntriesTot al)
  26611                                justHadBy teUpdate =  False
  26612                      
  26613                           Els eIf (e.Eve ntType Is  ZipProgres sEventType .Saving_En tryBytesRe ad) Then
  26614                                If justHa dByteUpdat e Then
  26615                                    Conso le.SetCurs orPosition (0, Consol e.CursorTo p)
  26616                                End If
  26617                                Console.W rite("      {0}/{1} ( {2:N0}%)",  e.BytesTr ansferred,  _
  26618                                               e.Tot alBytesToT ransfer, _
  26619                                               (CDbl (e.BytesTr ansferred)  / (0.01 *  e.TotalBy tesToTrans fer)))
  26620                                justHadBy teUpdate =  True
  26621                           End  If
  26622                       End Sub
  26623                       
  26624        </code>
  26625                      
  26626       </example>
  26627                    
  26628                     
  26629       <example>
  26630                     
  26631                      This is  a more co mplete exa mple of us ing the Sa veProgress
  26632                      events  in a Windo ws Forms a pplication , with a
  26633                      Thread  object.
  26634                     
  26635                      
  26636        <code 
  26637         lang="C#"
  26638        >
  26639                       delegat e void Sav eEntryProg ress(SaveP rogressEve ntArgs e);
  26640                       delegat e void But tonClick(o bject send er, EventA rgs e);
  26641                      
  26642                       public  class Work erOptions
  26643                       {
  26644                           pub lic string  ZipName;
  26645                           pub lic string  Folder;
  26646                           pub lic string  Encoding;
  26647                           pub lic string  Comment;
  26648                           pub lic int Zi pFlavor;
  26649                           pub lic Zip64O ption Zip6 4;
  26650                       }
  26651                      
  26652                       private  int _prog ress2MaxFa ctor;
  26653                       private  bool _sav eCanceled;
  26654                       private  long _tot alBytesBef oreCompres s;
  26655                       private  long _tot alBytesAft erCompress ;
  26656                       private  Thread _w orkerThrea d;
  26657                      
  26658                      
  26659                       private  void btnZ ipup_Click (object se nder, Even tArgs e)
  26660                       {
  26661                           Kic koffZipup( );
  26662                       }
  26663                      
  26664                       private  void btnC ancel_Clic k(object s ender, Eve ntArgs e)
  26665                       {
  26666                           if  (this.lblS tatus.Invo keRequired )
  26667                           {
  26668                                this.lblS tatus.Invo ke(new But tonClick(t his.btnCan cel_Click) , new obje ct[] { sen der, e });
  26669                           }
  26670                           els e
  26671                           {
  26672                                _saveCanc eled = tru e;
  26673                                lblStatus .Text = "C anceled... ";
  26674                                ResetStat e();
  26675                           }
  26676                       }
  26677                      
  26678                       private  void Kick offZipup()
  26679                       {
  26680                           _fo lderName =  tbDirName .Text;
  26681                      
  26682                           if  (_folderNa me == null  || _folde rName == " ") return;
  26683                           if  (this.tbZi pName.Text  == null | | this.tbZ ipName.Tex t == "") r eturn;
  26684                      
  26685                           //  check for  existence  of the zip  file:
  26686                           if  (System.IO .File.Exis ts(this.tb ZipName.Te xt))
  26687                           {
  26688                                var dlgRe sult = Mes sageBox.Sh ow(String. Format("Th e file you  have spec ified ({0} ) already  exists." +
  26689                                                                                  "   Do you wan t to overw rite this  file?", th is.tbZipNa me.Text),
  26690                                                                   "Confir mation is  Required",  MessageBo xButtons.Y esNo, Mess ageBoxIcon .Question) ;
  26691                                if (dlgRe sult != Di alogResult .Yes) retu rn;
  26692                                System.IO .File.Dele te(this.tb ZipName.Te xt);
  26693                           }
  26694                      
  26695                            _s aveCancele d = false;
  26696                           _nF ilesComple ted = 0;
  26697                           _to talBytesAf terCompres s = 0;
  26698                           _to talBytesBe foreCompre ss = 0;
  26699                           thi s.btnOk.En abled = fa lse;
  26700                           thi s.btnOk.Te xt = "Zipp ing...";
  26701                           thi s.btnCance l.Enabled  = true;
  26702                           lbl Status.Tex t = "Zippi ng...";
  26703                      
  26704                           var  options =  new Worke rOptions
  26705                           {
  26706                                ZipName =  this.tbZi pName.Text ,
  26707                                Folder =  _folderNam e,
  26708                                Encoding  = "ibm437"
  26709                           };
  26710                      
  26711                           if  (this.comb oBox1.Sele ctedIndex  != 0)
  26712                           {
  26713                                options.E ncoding =  this.combo Box1.Selec tedItem.To String();
  26714                           }
  26715                      
  26716                           if  (this.radi oFlavorSfx Cmd.Checke d)
  26717                                options.Z ipFlavor =  2;
  26718                           els e if (this .radioFlav orSfxGui.C hecked)
  26719                                options.Z ipFlavor =  1;
  26720                           els e options. ZipFlavor  = 0;
  26721                      
  26722                           if  (this.radi oZip64AsNe cessary.Ch ecked)
  26723                                options.Z ip64 = Zip 64Option.A sNecessary ;
  26724                           els e if (this .radioZip6 4Always.Ch ecked)
  26725                                options.Z ip64 = Zip 64Option.A lways;
  26726                           els e options. Zip64 = Zi p64Option. Never;
  26727                      
  26728                           opt ions.Comme nt = Strin g.Format(" Encoding:{ 0} || Flav or:{1} ||  ZIP64:{2}\ r\nCreated  at {3} ||  {4}\r\n",
  26729                                        o ptions.Enc oding,
  26730                                        F lavorToStr ing(option s.ZipFlavo r),
  26731                                        o ptions.Zip 64.ToStrin g(),
  26732                                        S ystem.Date Time.Now.T oString("y yyy-MMM-dd  HH:mm:ss" ),
  26733                                        t his.Text);
  26734                      
  26735                           if  (this.tbCo mment.Text  != TB_COM MENT_NOTE)
  26736                                options.C omment +=  this.tbCom ment.Text;
  26737                      
  26738                           _wo rkerThread  = new Thr ead(this.D oSave);
  26739                           _wo rkerThread .Name = "Z ip Saver t hread";
  26740                           _wo rkerThread .Start(opt ions);
  26741                           thi s.Cursor =  Cursors.W aitCursor;
  26742                        }
  26743                      
  26744                      
  26745                       private  void DoSa ve(Object  p)
  26746                       {
  26747                           Wor kerOptions  options =  p as Work erOptions;
  26748                           try
  26749                           {
  26750                                using (va r zip1 = n ew ZipFile ())
  26751                                {
  26752                                    zip1. Provisiona lAlternate Encoding =  System.Te xt.Encodin g.GetEncod ing(option s.Encoding );
  26753                                    zip1. Comment =  options.Co mment;
  26754                                    zip1. AddDirecto ry(options .Folder);
  26755                                    _entr iesToZip =  zip1.Entr yFileNames .Count;
  26756                                    SetPr ogressBars ();
  26757                                    zip1. SaveProgre ss += this .zip1_Save Progress;
  26758                      
  26759                                    zip1. UseZip64Wh enSaving =  options.Z ip64;
  26760                      
  26761                                    if (o ptions.Zip Flavor ==  1)
  26762                                        z ip1.SaveSe lfExtracto r(options. ZipName, S elfExtract orFlavor.W inFormsApp lication);
  26763                                    else  if (option s.ZipFlavo r == 2)
  26764                                        z ip1.SaveSe lfExtracto r(options. ZipName, S elfExtract orFlavor.C onsoleAppl ication);
  26765                                    else
  26766                                        z ip1.Save(o ptions.Zip Name);
  26767                                }
  26768                           }
  26769                           cat ch (System .Exception  exc1)
  26770                           {
  26771                                MessageBo x.Show(Str ing.Format ("Exceptio n while zi pping: {0} ", exc1.Me ssage));
  26772                                btnCancel _Click(nul l, null);
  26773                           }
  26774                       }
  26775                      
  26776                      
  26777                      
  26778                       void zi p1_SavePro gress(obje ct sender,  SaveProgr essEventAr gs e)
  26779                       {
  26780                           swi tch (e.Eve ntType)
  26781                           {
  26782                                case ZipP rogressEve ntType.Sav ing_AfterW riteEntry:
  26783                                    StepA rchiveProg ress(e);
  26784                                    break ;
  26785                                case ZipP rogressEve ntType.Sav ing_EntryB ytesRead:
  26786                                    StepE ntryProgre ss(e);
  26787                                    break ;
  26788                                case ZipP rogressEve ntType.Sav ing_Comple ted:
  26789                                    SaveC ompleted() ;
  26790                                    break ;
  26791                                case ZipP rogressEve ntType.Sav ing_AfterS aveTempArc hive:
  26792                                    // th is event o nly occurs  when savi ng an SFX  file
  26793                                    TempA rchiveSave d();
  26794                                    break ;
  26795                           }
  26796                           if  (_saveCanc eled)
  26797                                e.Cancel  = true;
  26798                       }
  26799                      
  26800                      
  26801                      
  26802                       private  void Step ArchivePro gress(Save ProgressEv entArgs e)
  26803                       {
  26804                           if  (this.prog ressBar1.I nvokeRequi red)
  26805                           {
  26806                                this.prog ressBar1.I nvoke(new  SaveEntryP rogress(th is.StepArc hiveProgre ss), new o bject[] {  e });
  26807                           }
  26808                           els e
  26809                           {
  26810                                if (!_sav eCanceled)
  26811                                {
  26812                                    _nFil esComplete d++;
  26813                                    this. progressBa r1.Perform Step();
  26814                                    _tota lBytesAfte rCompress  += e.Curre ntEntry.Co mpressedSi ze;
  26815                                    _tota lBytesBefo reCompress  += e.Curr entEntry.U ncompresse dSize;
  26816                      
  26817                                    // re set the pr ogress bar  for the e ntry:
  26818                                    this. progressBa r2.Value =  this.prog ressBar2.M aximum = 1 ;
  26819                      
  26820                                    this. Update();
  26821                                }
  26822                           }
  26823                       }
  26824                      
  26825                      
  26826                       private  void Step EntryProgr ess(SavePr ogressEven tArgs e)
  26827                       {
  26828                           if  (this.prog ressBar2.I nvokeRequi red)
  26829                           {
  26830                                this.prog ressBar2.I nvoke(new  SaveEntryP rogress(th is.StepEnt ryProgress ), new obj ect[] { e  });
  26831                           }
  26832                           els e
  26833                           {
  26834                                if (!_sav eCanceled)
  26835                                {
  26836                                    if (t his.progre ssBar2.Max imum == 1)
  26837                                    {
  26838                                        / / reset
  26839                                        I nt64 max =  e.TotalBy tesToTrans fer;
  26840                                        _ progress2M axFactor =  0;
  26841                                        w hile (max  &gt; Syste m.Int32.Ma xValue)
  26842                                        {
  26843                                             max /=  2;
  26844                                             _progre ss2MaxFact or++;
  26845                                        }
  26846                                        t his.progre ssBar2.Max imum = (in t)max;
  26847                                        l blStatus.T ext = Stri ng.Format( "{0} of {1 } files... ({2})",
  26848                                             _nFiles Completed  + 1, _entr iesToZip,  e.CurrentE ntry.FileN ame);
  26849                                    }
  26850                      
  26851                                     int  xferred =  e.BytesTra nsferred & gt;&gt; _p rogress2Ma xFactor;
  26852                      
  26853                                     this .progressB ar2.Value  = (xferred  &gt;= thi s.progress Bar2.Maxim um)
  26854                                        ?  this.prog ressBar2.M aximum
  26855                                        :  xferred;
  26856                      
  26857                                     this .Update();
  26858                                }
  26859                           }
  26860                       }
  26861                      
  26862                       private  void Save Completed( )
  26863                       {
  26864                           if  (this.lblS tatus.Invo keRequired )
  26865                           {
  26866                                this.lblS tatus.Invo ke(new Met hodInvoker (this.Save Completed) );
  26867                           }
  26868                           els e
  26869                           {
  26870                                lblStatus .Text = St ring.Forma t("Done, C ompressed  {0} files,  {1:N0}% o f original .",
  26871                                    _nFil esComplete d, (100.00  * _totalB ytesAfterC ompress) /  _totalByt esBeforeCo mpress);
  26872                                 ResetSta te();
  26873                           }
  26874                       }
  26875                      
  26876                       private  void Rese tState()
  26877                       {
  26878                           thi s.btnCance l.Enabled  = false;
  26879                           thi s.btnOk.En abled = tr ue;
  26880                           thi s.btnOk.Te xt = "Zip  it!";
  26881                           thi s.progress Bar1.Value  = 0;
  26882                           thi s.progress Bar2.Value  = 0;
  26883                           thi s.Cursor =  Cursors.D efault;
  26884                           if  (!_workerT hread.IsAl ive)
  26885                                _workerTh read.Join( );
  26886                       }
  26887                       
  26888        </code>
  26889                     
  26890                      
  26891       </example>
  26892                    
  26893                     
  26894       <seealso 
  26895        cref="E:Io nic.Zip.Zi pFile.Read Progress"
  26896       />
  26897                     
  26898       <seealso 
  26899        cref="E:Io nic.Zip.Zi pFile.AddP rogress"
  26900       />
  26901                     
  26902       <seealso 
  26903        cref="E:Io nic.Zip.Zi pFile.Extr actProgres s"
  26904       />
  26905               
  26906      </member>
  26907              
  26908      <member 
  26909       name="E:Io nic.Zip.Zi pFile.Read Progress"
  26910      >
  26911                     
  26912       <summary>
  26913                      An even t handler  invoked be fore, duri ng, and af ter the re ading of a  zip archi ve.
  26914                      
  26915       </summary>
  26916                    
  26917                     
  26918       <remarks>
  26919                      
  26920        <para>
  26921                       Dependi ng on the  particular  event bei ng signale d, differe nt propert ies on the
  26922                       
  26923         <see 
  26924          cref="T:Io nic.Zip.Re adProgress EventArgs"
  26925         />
  26926          parameter  are set.   The follo wing table
  26927                       summari zes the av ailable Ev entTypes a nd the con ditions un der which  this
  26928                       event h andler is  invoked wi th a 
  26929         <c>
  26930          ReadProgre ssEventArg s
  26931         </c>
  26932          with the  given Even tType.
  26933                       
  26934        </para>
  26935                     
  26936                      
  26937        <list 
  26938         type="tabl e"
  26939        >
  26940                       
  26941         <listheade r>
  26942                        
  26943          <term>
  26944           value of E ntryType
  26945          </term>
  26946                        
  26947          <descripti on>
  26948           Meaning an d conditio ns
  26949          </descript ion>
  26950                        
  26951         </listhead er>
  26952                      
  26953                       
  26954         <item>
  26955                        
  26956          <term>
  26957           ZipProgres sEventType .Reading_S tarted
  26958          </term>
  26959                        
  26960          <descripti on>
  26961           Fired just  as ZipFil e.Read() b egins. Mea ningful pr operties:  ArchiveNam e.
  26962                         
  26963          </descript ion>
  26964                        
  26965         </item>
  26966                      
  26967                       
  26968         <item>
  26969                        
  26970          <term>
  26971           ZipProgres sEventType .Reading_C ompleted
  26972          </term>
  26973                        
  26974          <descripti on>
  26975           Fired when  ZipFile.R ead() has  completed.  Meaningfu l properti es: Archiv eName.
  26976                         
  26977          </descript ion>
  26978                        
  26979         </item>
  26980                      
  26981                       
  26982         <item>
  26983                        
  26984          <term>
  26985           ZipProgres sEventType .Reading_A rchiveByte sRead
  26986          </term>
  26987                        
  26988          <descripti on>
  26989           Fired whil e reading,  updates t he number  of bytes r ead for th e entire a rchive.
  26990                         Meaning ful proper ties: Arch iveName, C urrentEntr y, BytesTr ansferred,  TotalByte sToTransfe r.
  26991                         
  26992          </descript ion>
  26993                        
  26994         </item>
  26995                      
  26996                       
  26997         <item>
  26998                        
  26999          <term>
  27000           ZipProgres sEventType .Reading_B eforeReadE ntry
  27001          </term>
  27002                        
  27003          <descripti on>
  27004           Indicates  an entry i s about to  be read f rom the ar chive.
  27005                         Meaning ful proper ties: Arch iveName, E ntriesTota l.
  27006                         
  27007          </descript ion>
  27008                        
  27009         </item>
  27010                      
  27011                       
  27012         <item>
  27013                        
  27014          <term>
  27015           ZipProgres sEventType .Reading_A fterReadEn try
  27016          </term>
  27017                        
  27018          <descripti on>
  27019           Indicates  an entry h as just be en read fr om the arc hive.
  27020                         Meaning ful proper ties: Arch iveName, E ntriesTota l, Current Entry.
  27021                         
  27022          </descript ion>
  27023                        
  27024         </item>
  27025                      
  27026                       
  27027        </list>
  27028                      
  27029       </remarks>
  27030                    
  27031                     
  27032       <seealso 
  27033        cref="E:Io nic.Zip.Zi pFile.Save Progress"
  27034       />
  27035                     
  27036       <seealso 
  27037        cref="E:Io nic.Zip.Zi pFile.AddP rogress"
  27038       />
  27039                     
  27040       <seealso 
  27041        cref="E:Io nic.Zip.Zi pFile.Extr actProgres s"
  27042       />
  27043               
  27044      </member>
  27045              
  27046      <member 
  27047       name="E:Io nic.Zip.Zi pFile.Extr actProgres s"
  27048      >
  27049                     
  27050       <summary>
  27051                        An ev ent handle r invoked  before, du ring, and  after extr action of
  27052                        entri es in the  zip archiv e.
  27053                      
  27054       </summary>
  27055                    
  27056                     
  27057       <remarks>
  27058                      
  27059        <para>
  27060                         Depen ding on th e particul ar event,  different  properties  on the 
  27061         <see 
  27062          cref="T:Io nic.Zip.Ex tractProgr essEventAr gs"
  27063         />
  27064          parameter  are set.   The follo wing
  27065                         table  summarize s the avai lable Even tTypes and  the condi tions unde r
  27066                         which  this even t handler  is invoked  with a
  27067                         
  27068         <c>
  27069          ExtractPro gressEvent Args
  27070         </c>
  27071          with the  given Even tType.
  27072                       
  27073        </para>
  27074                     
  27075                      
  27076        <list 
  27077         type="tabl e"
  27078        >
  27079                       
  27080         <listheade r>
  27081                        
  27082          <term>
  27083           value of E ntryType
  27084          </term>
  27085                        
  27086          <descripti on>
  27087           Meaning an d conditio ns
  27088          </descript ion>
  27089                        
  27090         </listhead er>
  27091                      
  27092                       
  27093         <item>
  27094                        
  27095          <term>
  27096           ZipProgres sEventType .Extractin g_BeforeEx tractAll
  27097          </term>
  27098                        
  27099          <descripti on>
  27100                           Set w hen Extrac tAll() beg ins. The A rchiveName , Overwrit e, and
  27101                           Extra ctLocation  propertie s are mean ingful.
  27102          </descript ion>
  27103                        
  27104         </item>
  27105                      
  27106                       
  27107         <item>
  27108                        
  27109          <term>
  27110           ZipProgres sEventType .Extractin g_AfterExt ractAll
  27111          </term>
  27112                        
  27113          <descripti on>
  27114                           Set w hen Extrac tAll() has  completed .  The Arc hiveName,  Overwrite,
  27115                           and E xtractLoca tion prope rties are  meaningful .
  27116                         
  27117          </descript ion>
  27118                        
  27119         </item>
  27120                      
  27121                       
  27122         <item>
  27123                        
  27124          <term>
  27125           ZipProgres sEventType .Extractin g_BeforeEx tractEntry
  27126          </term>
  27127                        
  27128          <descripti on>
  27129                           Set w hen an Ext ract() on  an entry i n the ZipF ile has be gun.
  27130                           Prope rties that  are meani ngful: Arc hiveName,  EntriesTot al,
  27131                           Curre ntEntry, O verwrite,  ExtractLoc ation, Ent riesExtrac ted.
  27132                         
  27133          </descript ion>
  27134                        
  27135         </item>
  27136                      
  27137                       
  27138         <item>
  27139                        
  27140          <term>
  27141           ZipProgres sEventType .Extractin g_AfterExt ractEntry
  27142          </term>
  27143                        
  27144          <descripti on>
  27145                           Set w hen an Ext ract() on  an entry i n the ZipF ile has co mpleted.
  27146                           Prope rties that  are meani ngful: Arc hiveName,  EntriesTot al,
  27147                           Curre ntEntry, O verwrite,  ExtractLoc ation, Ent riesExtrac ted.
  27148                         
  27149          </descript ion>
  27150                        
  27151         </item>
  27152                      
  27153                       
  27154         <item>
  27155                        
  27156          <term>
  27157           ZipProgres sEventType .Extractin g_EntryByt esWritten
  27158          </term>
  27159                        
  27160          <descripti on>
  27161                           Set w ithin a ca ll to Extr act() on a n entry in  the ZipFi le, as dat a
  27162                           is ex tracted fo r the entr y.  Proper ties that  are meanin gful:
  27163                           Archi veName, Cu rrentEntry , BytesTra nsferred,  TotalBytes ToTransfer .
  27164                         
  27165          </descript ion>
  27166                        
  27167         </item>
  27168                      
  27169                       
  27170         <item>
  27171                        
  27172          <term>
  27173           ZipProgres sEventType .Extractin g_ExtractE ntryWouldO verwrite
  27174          </term>
  27175                        
  27176          <descripti on>
  27177                           Set w ithin a ca ll to Extr act() on a n entry in  the ZipFi le, when t he
  27178                           extra ction woul d overwrit e an exist ing file.  This event  type is u sed
  27179                           only  when 
  27180           <c>
  27181            ExtractExi stingFileA ction
  27182           </c>
  27183            on the 
  27184           <c>
  27185            ZipFile
  27186           </c>
  27187            or
  27188                           
  27189           <c>
  27190            ZipEntry
  27191           </c>
  27192            is set to  
  27193           <c>
  27194            InvokeExtr actProgres sEvent
  27195           </c>
  27196           .
  27197                         
  27198          </descript ion>
  27199                        
  27200         </item>
  27201                      
  27202                       
  27203        </list>
  27204                     
  27205                      
  27206       </remarks>
  27207                    
  27208                     
  27209       <example>
  27210                      
  27211        <code>
  27212                       private  static bo ol justHad ByteUpdate  = false;
  27213                       public  static voi d ExtractP rogress(ob ject sende r, Extract ProgressEv entArgs e)
  27214                       {
  27215                         if(e. EventType  == ZipProg ressEventT ype.Extrac ting_Entry BytesWritt en)
  27216                         {
  27217                           if  (justHadBy teUpdate)
  27218                             C onsole.Set CursorPosi tion(0, Co nsole.Curs orTop);
  27219                      
  27220                           Con sole.Write ("   {0}/{ 1} ({2:N0} %)", e.Byt esTransfer red, e.Tot alBytesToT ransfer,
  27221                                           e.BytesTr ansferred  / (0.01 *  e.TotalByt esToTransf er ));
  27222                           jus tHadByteUp date = tru e;
  27223                         }
  27224                         else  if(e.Event Type == Zi pProgressE ventType.E xtracting_ BeforeExtr actEntry)
  27225                         {
  27226                           if  (justHadBy teUpdate)
  27227                             C onsole.Wri teLine();
  27228                           Con sole.Write Line("Extr acting: {0 }", e.Curr entEntry.F ileName);
  27229                           jus tHadByteUp date= fals e;
  27230                         }
  27231                       }
  27232                      
  27233                       public  static Ext ractZip(st ring zipTo Extract, s tring dire ctory)
  27234                       {
  27235                         strin g TargetDi rectory= " extract";
  27236                         using  (var zip  = ZipFile. Read(zipTo Extract))  {
  27237                           zip .ExtractPr ogress +=  ExtractPro gress;
  27238                           for each (var  e in zip1)
  27239                           {
  27240                             e .Extract(T argetDirec tory, true );
  27241                           }
  27242                         }
  27243                       }
  27244                      
  27245                       
  27246        </code>
  27247                      
  27248        <code 
  27249         lang="VB"
  27250        >
  27251                       Public  Shared Sub  Main(ByVa l args As  String())
  27252                           Dim  ZipToUnpa ck As Stri ng = "C1P3 SML.zip"
  27253                           Dim  TargetDir  As String  = "Extrac tTest_Extr act"
  27254                           Con sole.Write Line("Extr acting fil e {0} to { 1}", ZipTo Unpack, Ta rgetDir)
  27255                           Usi ng zip1 As  ZipFile =  ZipFile.R ead(ZipToU npack)
  27256                                AddHandle r zip1.Ext ractProgre ss, Addres sOf MyExtr actProgres s
  27257                                Dim e As  ZipEntry
  27258                                For Each  e In zip1
  27259                                    e.Ext ract(Targe tDir, True )
  27260                                Next
  27261                           End  Using
  27262                       End Sub
  27263                      
  27264                       Private  Shared ju stHadByteU pdate As B oolean = F alse
  27265                      
  27266                       Public  Shared Sub  MyExtract Progress(B yVal sende r As Objec t, ByVal e  As Extrac tProgressE ventArgs)
  27267                           If  (e.EventTy pe = ZipPr ogressEven tType.Extr acting_Ent ryBytesWri tten) Then
  27268                                If Extrac tTest.just HadByteUpd ate Then
  27269                                    Conso le.SetCurs orPosition (0, Consol e.CursorTo p)
  27270                                End If
  27271                                Console.W rite("   { 0}/{1} ({2 :N0}%)", e .BytesTran sferred, e .TotalByte sToTransfe r, (CDbl(e .BytesTran sferred) /  (0.01 * e .TotalByte sToTransfe r)))
  27272                                ExtractTe st.justHad ByteUpdate  = True
  27273                           Els eIf (e.Eve ntType = Z ipProgress EventType. Extracting _BeforeExt ractEntry)  Then
  27274                                If Extrac tTest.just HadByteUpd ate Then
  27275                                    Conso le.WriteLi ne
  27276                                End If
  27277                                Console.W riteLine(" Extracting : {0}", e. CurrentEnt ry.FileNam e)
  27278                                ExtractTe st.justHad ByteUpdate  = False
  27279                           End  If
  27280                       End Sub
  27281                       
  27282        </code>
  27283                      
  27284       </example>
  27285                    
  27286                     
  27287       <seealso 
  27288        cref="E:Io nic.Zip.Zi pFile.Save Progress"
  27289       />
  27290                     
  27291       <seealso 
  27292        cref="E:Io nic.Zip.Zi pFile.Read Progress"
  27293       />
  27294                     
  27295       <seealso 
  27296        cref="E:Io nic.Zip.Zi pFile.AddP rogress"
  27297       />
  27298               
  27299      </member>
  27300              
  27301      <member 
  27302       name="E:Io nic.Zip.Zi pFile.AddP rogress"
  27303      >
  27304                     
  27305       <summary>
  27306                      An even t handler  invoked be fore, duri ng, and af ter Adding  entries t o a zip ar chive.
  27307                      
  27308       </summary>
  27309                    
  27310                     
  27311       <remarks>
  27312                          Add ing a larg e number o f entries  to a zip f ile can ta ke a long
  27313                          tim e.  For ex ample, whe n calling 
  27314        <see 
  27315         cref="M:Io nic.Zip.Zi pFile.AddD irectory(S ystem.Stri ng)"
  27316        />
  27317         on a
  27318                          dir ectory tha t contains  50,000 fi les, it co uld take 3  minutes o r so.
  27319                          Thi s event ha ndler allw s an appli cation to  track the  progress o f the Add
  27320                          ope ration, an d to optio nally canc el a lengt hy Add ope ration.
  27321                      
  27322       </remarks>
  27323                    
  27324                     
  27325       <example>
  27326                      
  27327        <code 
  27328         lang="C#"
  27329        >
  27330                      
  27331                       int _nu mEntriesTo Add= 0;
  27332                       int _nu mEntriesAd ded= 0;
  27333                       void Ad dProgressH andler(obj ect sender , AddProgr essEventAr gs e)
  27334                       {
  27335                           swi tch (e.Eve ntType)
  27336                           {
  27337                                case ZipP rogressEve ntType.Add ing_Starte d:
  27338                                    Conso le.WriteLi ne("Adding  files to  the zip... ");
  27339                                    break ;
  27340                                case ZipP rogressEve ntType.Add ing_AfterA ddEntry:
  27341                                    _numE ntriesAdde d++;
  27342                                    Conso le.WriteLi ne(String. Format("Ad ding file  {0}/{1} ::  {2}",
  27343                                                                _numEntrie sAdded, _n umEntriesT oAdd, e.Cu rrentEntry .FileName) );
  27344                                    break ;
  27345                                case ZipP rogressEve ntType.Add ing_Comple ted:
  27346                                    Conso le.WriteLi ne("Added  all files" );
  27347                                    break ;
  27348                           }
  27349                       }
  27350                      
  27351                       void Cr eateTheZip ()
  27352                       {
  27353                           usi ng (ZipFil e zip = ne w ZipFile( ))
  27354                           {
  27355                                zip.AddPr ogress +=  AddProgres sHandler;
  27356                                zip.AddDi rectory(Sy stem.IO.Pa th.GetFile Name(DirTo Zip));
  27357                                zip.Save( ZipFileToC reate);
  27358                           }
  27359                       }
  27360                      
  27361                       
  27362        </code>
  27363                     
  27364                      
  27365        <code 
  27366         lang="VB"
  27367        >
  27368                      
  27369                       Private  Sub AddPr ogressHand ler(ByVal  sender As  Object, By Val e As A ddProgress EventArgs)
  27370                           Sel ect Case e .EventType
  27371                                Case ZipP rogressEve ntType.Add ing_Starte d
  27372                                    Conso le.WriteLi ne("Adding  files to  the zip... ")
  27373                                    Exit  Select
  27374                                Case ZipP rogressEve ntType.Add ing_AfterA ddEntry
  27375                                    Conso le.WriteLi ne(String. Format("Ad ding file  {0}", e.Cu rrentEntry .FileName) )
  27376                                    Exit  Select
  27377                                Case ZipP rogressEve ntType.Add ing_Comple ted
  27378                                    Conso le.WriteLi ne("Added  all files" )
  27379                                    Exit  Select
  27380                           End  Select
  27381                       End Sub
  27382                      
  27383                       Sub Cre ateTheZip( )
  27384                           Usi ng zip as  ZipFile =  New ZipFil e
  27385                                AddHandle r zip.AddP rogress, A ddressOf A ddProgress Handler
  27386                                zip.AddDi rectory(Sy stem.IO.Pa th.GetFile Name(DirTo Zip))
  27387                                zip.Save( ZipFileToC reate);
  27388                           End  Using
  27389                       End Sub
  27390                      
  27391                       
  27392        </code>
  27393                     
  27394                      
  27395       </example>
  27396                    
  27397                     
  27398       <seealso 
  27399        cref="E:Io nic.Zip.Zi pFile.Save Progress"
  27400       />
  27401                     
  27402       <seealso 
  27403        cref="E:Io nic.Zip.Zi pFile.Read Progress"
  27404       />
  27405                     
  27406       <seealso 
  27407        cref="E:Io nic.Zip.Zi pFile.Extr actProgres s"
  27408       />
  27409               
  27410      </member>
  27411              
  27412      <member 
  27413       name="E:Io nic.Zip.Zi pFile.ZipE rror"
  27414      >
  27415                     
  27416       <summary>
  27417                      An even t that is  raised whe n an error  occurs du ring open  or read of  files
  27418                      while s aving a zi p archive.
  27419                      
  27420       </summary>
  27421                    
  27422                     
  27423       <remarks>
  27424                       
  27425        <para>
  27426                           Err ors can oc cur as a f ile is bei ng saved t o the zip  archive.   For
  27427                           exa mple, the  File.Open  may fail,  or a File. Read may f ail, becau se of
  27428                           loc k conflict s or other  reasons.   If you ad d a handle r to this  event,
  27429                           you  can handl e such err ors in you r own code .  If you  don't add  a
  27430                           han dler, the  library wi ll throw a n exceptio n if it en counters a n I/O
  27431                           err or during  a call to 
  27432         <c>
  27433          Save()
  27434         </c>
  27435         .
  27436                        
  27437        </para>
  27438                     
  27439                       
  27440        <para>
  27441                          Sett ing a hand ler implic itly sets 
  27442         <see 
  27443          cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  27444         />
  27445          to
  27446                          
  27447         <c>
  27448          ZipErrorAc tion.Invok eErrorEven t
  27449         </c>
  27450         .
  27451                        
  27452        </para>
  27453                     
  27454                       
  27455        <para>
  27456                          The  handler yo u add appl ies to all  
  27457         <see 
  27458          cref="T:Io nic.Zip.Zi pEntry"
  27459         />
  27460          items tha t are
  27461                          subs equently a dded to th
  27462         <c>
  27463          ZipFile
  27464         </c>
  27465          instance.  If you se t this
  27466                          prop erty after  you have  added item s to the 
  27467         <c>
  27468          ZipFile
  27469         </c>
  27470         , but befo re you
  27471                          have  called 
  27472         <c>
  27473          Save()
  27474         </c>
  27475         , errors t hat occur  while savi ng those i tems
  27476                          will  not cause  the error  handler t o be invok ed.
  27477                        
  27478        </para>
  27479                     
  27480                       
  27481        <para>
  27482                          If y ou want to  handle an y errors t hat occur  with any e ntry in th e zip
  27483                          file  using the  same erro r handler,  then add  your error  handler o nce,
  27484                          befo re adding  any entrie s to the z ip archive .
  27485                        
  27486        </para>
  27487                     
  27488                       
  27489        <para>
  27490                          In t he error h andler met hod, you n eed to set  the 
  27491         <see 
  27492          cref="P:Io nic.Zip.Zi pEntry.Zip ErrorActio n"
  27493         />
  27494          property  on the
  27495                          
  27496         <c>
  27497          ZipErrorEv entArgs.Cu rrentEntry
  27498         </c>
  27499         .  This co mmunicates  back to
  27500                          DotN etZip what  you would  like to d o with thi s particul ar error.   Within
  27501                          an e rror handl er, if you  set the 
  27502         <c>
  27503          ZipEntry.Z ipErrorAct ion
  27504         </c>
  27505          property
  27506                          on t he 
  27507         <c>
  27508          ZipEntry
  27509         </c>
  27510          to 
  27511         <c>
  27512          ZipErrorAc tion.Invok eErrorEven t
  27513         </c>
  27514          or if
  27515                          you  don't set  it at all,  the libra ry will th row the ex ception. ( It is the
  27516                          same  as if you  had set t he 
  27517         <c>
  27518          ZipEntry.Z ipErrorAct ion
  27519         </c>
  27520          property  on the
  27521                          
  27522         <c>
  27523          ZipEntry
  27524         </c>
  27525          to 
  27526         <c>
  27527          ZipErrorAc tion.Throw
  27528         </c>
  27529         .) If you  set the
  27530                          
  27531         <c>
  27532          ZipErrorEv entArgs.Ca ncel
  27533         </c>
  27534          to true,  the entire  
  27535         <c>
  27536          Save()
  27537         </c>
  27538          will be
  27539                          canc eled.
  27540                        
  27541        </para>
  27542                     
  27543                       
  27544        <para>
  27545                          In t he case th at you use  
  27546         <c>
  27547          ZipErrorAc tion.Skip
  27548         </c>
  27549         , implying  that
  27550                          you  want to sk ip the ent ry for whi ch there's  been an e rror, DotN etZip
  27551                          trie s to seek  backwards  in the out put stream , and trun cate all b ytes
  27552                          writ ten on beh alf of tha t particul ar entry.  This works  only if t he
  27553                          outp ut stream  is seekabl e.  It wil l not work , for exam ple, when  using
  27554                          ASPN ET's Respo nse.Output Stream.
  27555                        
  27556        </para>
  27557                     
  27558                      
  27559       </remarks>
  27560                    
  27561                     
  27562       <example>
  27563                     
  27564                      This ex ample show s how to u se an even t handler  to handle
  27565                      errors  during sav e of the z ip file.
  27566                      
  27567        <code 
  27568         lang="C#"
  27569        >
  27570                      
  27571                       public  static voi d MyZipErr or(object  sender, Zi pErrorEven tArgs e)
  27572                       {
  27573                           Con sole.Write Line("Erro r saving { 0}...", e. FileName);
  27574                           Con sole.Write Line("   E xception:  {0}", e.ex ception);
  27575                           Zip Entry entr y = e.Curr entEntry;
  27576                           str ing respon se = null;
  27577                           //  Ask the us er whether  he wants  to skip th is error o r not
  27578                           do
  27579                           {
  27580                                Console.W rite("Retr y, Skip, T hrow, or C ancel ? (R /S/T/C) ") ;
  27581                                response  = Console. ReadLine() ;
  27582                                Console.W riteLine() ;
  27583                      
  27584                           } w hile (resp onse != nu ll &amp;&a mp;
  27585                                     resp onse[0]!=' S' &amp;&a mp; respon se[0]!='s'  &amp;&amp ;
  27586                                     resp onse[0]!=' R' &amp;&a mp; respon se[0]!='r'  &amp;&amp ;
  27587                                     resp onse[0]!=' T' &amp;&a mp; respon se[0]!='t'  &amp;&amp ;
  27588                                     resp onse[0]!=' C' &amp;&a mp; respon se[0]!='c' );
  27589                      
  27590                           e.C ancel = (r esponse[0] =='C' || r esponse[0] =='c');
  27591                      
  27592                           if  (response[ 0]=='S' ||  response[ 0]=='s')
  27593                                entry.Zip ErrorActio n = ZipErr orAction.S kip;
  27594                           els e if (resp onse[0]==' R' || resp onse[0]==' r')
  27595                                entry.Zip ErrorActio n = ZipErr orAction.R etry;
  27596                           els e if (resp onse[0]==' T' || resp onse[0]==' t')
  27597                                entry.Zip ErrorActio n = ZipErr orAction.T hrow;
  27598                       }
  27599                      
  27600                       public  void SaveT heFile()
  27601                       {
  27602                         strin g director yToZip = " fodder";
  27603                         strin g director yInArchive  = "files" ;
  27604                         strin g zipFileT oCreate =  "Archive.z ip";
  27605                         using  (var zip  = new ZipF ile())
  27606                         {
  27607                           //  set the ev ent handle r before a dding any  entries
  27608                           zip .ZipError  += MyZipEr ror;
  27609                           zip .AddDirect ory(direct oryToZip,  directoryI nArchive);
  27610                           zip .Save(zipF ileToCreat e);
  27611                         }
  27612                       }
  27613                       
  27614        </code>
  27615                     
  27616                      
  27617        <code 
  27618         lang="VB"
  27619        >
  27620                       Private  Sub MyZip Error(ByVa l sender A s Object,  ByVal e As  Ionic.Zip .ZipErrorE ventArgs)
  27621                           ' A t this poi nt, the ap plication  could prom pt the use r for an a ction to t ake.
  27622                           ' B ut in this  case, thi s applicat ion will s imply auto matically  skip the f ile, in ca se of erro r.
  27623                           Con sole.Write Line("Zip  Error,  en try {0}",  e.CurrentE ntry.FileN ame)
  27624                           Con sole.Write Line("   E xception:  {0}", e.ex ception)
  27625                           ' s et the des ired ZipEr rorAction  on the Cur rentEntry  to communi cate that  to DotNetZ ip
  27626                           e.C urrentEntr y.ZipError Action = Z ip.ZipErro rAction.Sk ip
  27627                       End Sub
  27628                      
  27629                       Public  Sub SaveTh eFile()
  27630                           Dim  directory ToZip As S tring = "f odder"
  27631                           Dim  directory InArchive  As String  = "files"
  27632                           Dim  zipFileTo Create as  String = " Archive.zi p"
  27633                           Usi ng zipArch ive As Zip File = New  ZipFile
  27634                                ' set the  event han dler befor e adding a ny entries
  27635                                AddHandle r zipArchi ve.ZipErro r, Address Of MyZipEr ror
  27636                                zipArchiv e.AddDirec tory(direc toryToZip,  directory InArchive)
  27637                                zipArchiv e.Save(zip FileToCrea te)
  27638                           End  Using
  27639                       End Sub
  27640                      
  27641                       
  27642        </code>
  27643                      
  27644       </example>
  27645                    
  27646                     
  27647       <seealso 
  27648        cref="P:Io nic.Zip.Zi pFile.ZipE rrorAction "
  27649       />
  27650               
  27651      </member>
  27652              
  27653      <member 
  27654       name="T:Io nic.Zip.Zi p64Option"
  27655      >
  27656                     
  27657       <summary>
  27658                        Optio ns for usi ng ZIP64 e xtensions  when savin g zip arch ives.
  27659                      
  27660       </summary>
  27661                    
  27662                     
  27663       <remarks>
  27664                     
  27665                      
  27666        <para>
  27667                         Desig ned many y ears ago,  the 
  27668         <see 
  27669          href="http ://www.pkw are.com/do cuments/ca sestudies/ APPNOTE.TX T"
  27670         >
  27671          original z ip
  27672                          speci fication f rom PKWARE
  27673         </see>
  27674          allowed f or 32-bit  quantities  for the
  27675                         compr essed and  uncompress ed sizes o f zip entr ies, as we ll as a 32 -bit quant ity
  27676                         for s pecifying  the length  of the zi p archive  itself, an d a maximu m of 65535
  27677                         entri es.  These  limits ar e now regu larly exce eded in ma ny backup  and archiv al
  27678                         scena rios.  Rec ently, PKW are added  extensions  to the or iginal zip  spec, cal led
  27679                         "ZIP6 4 extensio ns", to ra ise those  limitation s.  This p roperty go verns whet her
  27680                         DotNe tZip will  use those  extensions  when writ ing zip ar chives. Th e use of
  27681                         these  extension s is optio nal and ex plicit in  DotNetZip  because, d espite the
  27682                         statu s of ZIP64  as a bona  fide stan dard, many  other zip  tools and  libraries  do
  27683                         not s upport ZIP 64, and th erefore a  zip file w ith ZIP64  extensions  may be
  27684                         unrea dable by s ome of tho se other t ools.
  27685                       
  27686        </para>
  27687                     
  27688                      
  27689        <para>
  27690                         Set t his proper ty to 
  27691         <see 
  27692          cref="F:Io nic.Zip.Zi p64Option. Always"
  27693         />
  27694          to always  use ZIP64
  27695                         exten sions when  saving, r egardless  of whether  your zip  archive ne eds it.
  27696                         Suppo se you add  5 files,  each under  100k, to  a ZipFile.  If you sp ecify Alwa ys
  27697                         for t his flag,  you will g et a ZIP64  archive,  though the  archive d oes not ne ed
  27698                         to us e ZIP64 be cause none  of the or iginal zip  limits ha d been exc eeded.
  27699                       
  27700        </para>
  27701                     
  27702                      
  27703        <para>
  27704                         Set t his proper ty to 
  27705         <see 
  27706          cref="F:Io nic.Zip.Zi p64Option. Never"
  27707         />
  27708          to tell t he DotNetZ ip
  27709                         libra ry to neve r use ZIP6 4 extensio ns.  This  is useful  for maximu m
  27710                         compa tibility a nd interop erability,  at the ex pense of t he capabil ity of
  27711                         handl ing large  files or l arge archi ves.  NB:  Windows Ex plorer in  Windows XP
  27712                         and W indows Vis ta cannot  currently  extract fi les from a  zip64 arc hive, so i f
  27713                         you w ant to gua rantee tha t a zip ar chive prod uced by th is library  will work  in
  27714                         Windo ws Explore r, use 
  27715         <c>
  27716          Never
  27717         </c>
  27718         . If you s et this pr operty to 
  27719         <see 
  27720          cref="F:Io nic.Zip.Zi p64Option. Never"
  27721         />
  27722         , and your  applicati on creates  a zip tha t would
  27723                         excee d one of t he Zip lim its, the l ibrary wil l throw an  exception  while sav ing
  27724                         the z ip file.
  27725                       
  27726        </para>
  27727                     
  27728                      
  27729        <para>
  27730                         Set t his proper ty to 
  27731         <see 
  27732          cref="F:Io nic.Zip.Zi p64Option. AsNecessar y"
  27733         />
  27734          to tell t he
  27735                         DotNe tZip libra ry to use  the ZIP64  extensions  when requ ired by th e
  27736                         entry . After th e file is  compressed , the orig inal and c ompressed  sizes are
  27737                         check ed, and if  they exce ed the lim its descri bed above,  then zip6 4 can be
  27738                         used.  That is t he general  idea, but  there is  an additio nal wrinkl e when sav ing
  27739                         to a  non-seekab le device,  like the  ASP.NET 
  27740         <c>
  27741          Response.O utputStrea m
  27742         </c>
  27743         , or
  27744                         
  27745         <c>
  27746          Console.Ou t
  27747         </c>
  27748         .  When us ing non-se ekable str eams for o utput, the  entry
  27749                         heade r - which  indicates  whether zi p64 is in  use - is e mitted bef ore it is
  27750                         known  if zip64  is necessa ry.  It is  only afte r all entr ies have b een saved
  27751                         that  it can be  known if Z IP64 will  be require d.  On see kable outp ut streams ,
  27752                         after  saving al l entries,  the libra ry can see k backward  and re-em it the zip
  27753                         file  header to  be consist ent with t he actual  ZIP64 requ irement.   But using  a
  27754                         non-s eekable ou tput strea m, the lib rary canno t seek bac kward, so  the header
  27755                         can n ever be ch anged. In  other word s, the arc hive's use  of ZIP64  extensions  is
  27756                         not a lterable a fter the h eader is e mitted.  T herefore,  when savin g to
  27757                         non-s eekable st reams, usi ng 
  27758         <see 
  27759          cref="F:Io nic.Zip.Zi p64Option. AsNecessar y"
  27760         />
  27761          is the sa me
  27762                         as us ing 
  27763         <see 
  27764          cref="F:Io nic.Zip.Zi p64Option. Always"
  27765         />
  27766         : it will  always pro duce a zip
  27767                         archi ve that us es ZIP64 e xtensions.
  27768                       
  27769        </para>
  27770                     
  27771                      
  27772       </remarks>
  27773               
  27774      </member>
  27775              
  27776      <member 
  27777       name="F:Io nic.Zip.Zi p64Option. Default"
  27778      >
  27779                    
  27780       <summary>
  27781                     The defa ult behavi or, which  is "Never" .
  27782                     (For COM  clients,  this is a  0 (zero).)
  27783                     
  27784       </summary>
  27785               
  27786      </member>
  27787              
  27788      <member 
  27789       name="F:Io nic.Zip.Zi p64Option. Never"
  27790      >
  27791                    
  27792       <summary>
  27793                     Do not u se ZIP64 e xtensions  when writi ng zip arc hives.
  27794                     (For COM  clients,  this is a  0 (zero).)
  27795                     
  27796       </summary>
  27797               
  27798      </member>
  27799              
  27800      <member 
  27801       name="F:Io nic.Zip.Zi p64Option. AsNecessar y"
  27802      >
  27803                    
  27804       <summary>
  27805                     Use ZIP6 4 extensio ns when wr iting zip  archives,  as necessa ry.
  27806                     For exam ple, when  a single e ntry excee ds 0xFFFFF FFF in siz e, or when  the archi ve as a wh ole
  27807                     exceeds  0xFFFFFFFF  in size,  or when th ere are mo re than 65 535 entrie s in an ar chive.
  27808                     (For COM  clients,  this is a  1.)
  27809                     
  27810       </summary>
  27811               
  27812      </member>
  27813              
  27814      <member 
  27815       name="F:Io nic.Zip.Zi p64Option. Always"
  27816      >
  27817                    
  27818       <summary>
  27819                     Always u se ZIP64 e xtensions  when writi ng zip arc hives, eve n when unn ecessary.
  27820                     (For COM  clients,  this is a  2.)
  27821                     
  27822       </summary>
  27823               
  27824      </member>
  27825              
  27826      <member 
  27827       name="T:Io nic.Zip.Zi pOption"
  27828      >
  27829                    
  27830       <summary>
  27831                      An enum  represent ing the va lues on a  three-way  toggle swi tch
  27832                      for var ious optio ns in the  library. T his might  be used to
  27833                      specify  whether t o employ a  particula r text enc oding, or  to use
  27834                      ZIP64 e xtensions,  or some o ther optio n.
  27835                     
  27836       </summary>
  27837               
  27838      </member>
  27839              
  27840      <member 
  27841       name="F:Io nic.Zip.Zi pOption.De fault"
  27842      >
  27843                    
  27844       <summary>
  27845                     The defa ult behavi or. This i s the same  as "Never ".
  27846                     (For COM  clients,  this is a  0 (zero).)
  27847                     
  27848       </summary>
  27849               
  27850      </member>
  27851              
  27852      <member 
  27853       name="F:Io nic.Zip.Zi pOption.Ne ver"
  27854      >
  27855                    
  27856       <summary>
  27857                     Never us e the asso ciated opt ion.
  27858                     (For COM  clients,  this is a  0 (zero).)
  27859                     
  27860       </summary>
  27861               
  27862      </member>
  27863              
  27864      <member 
  27865       name="F:Io nic.Zip.Zi pOption.As Necessary"
  27866      >
  27867                    
  27868       <summary>
  27869                     Use the  associated  behavior  "as necess ary."
  27870                     (For COM  clients,  this is a  1.)
  27871                     
  27872       </summary>
  27873               
  27874      </member>
  27875              
  27876      <member 
  27877       name="F:Io nic.Zip.Zi pOption.Al ways"
  27878      >
  27879                    
  27880       <summary>
  27881                     Use the  associated  behavior  Always, wh ether nece ssary or n ot.
  27882                     (For COM  clients,  this is a  2.)
  27883                     
  27884       </summary>
  27885               
  27886      </member>
  27887              
  27888      <member 
  27889       name="T:Io nic.Zip.Re adOptions"
  27890      >
  27891                     
  27892       <summary>
  27893                        A cla ss for col lecting th e various  options th at can be  used when
  27894                        Readi ng zip fil es for ext raction or  update.
  27895                      
  27896       </summary>
  27897                    
  27898                     
  27899       <remarks>
  27900                        
  27901        <para>
  27902                           Whe n reading  a zip file , there ar e several  options an
  27903                           app lication c an set, to  modify ho w the file  is read,  or what
  27904                           the  library d oes while  reading.   This class  collects  those
  27905                           opt ions into  one contai ner.
  27906                         
  27907        </para>
  27908                     
  27909                        
  27910        <para>
  27911                           Pas s an insta nce of the  
  27912         <c>
  27913          ReadOption s
  27914         </c>
  27915          class int o the
  27916                           
  27917         <c>
  27918          ZipFile.Re ad()
  27919         </c>
  27920          method.
  27921                         
  27922        </para>
  27923                     
  27924                      
  27925        <seealso 
  27926         cref="M:Io nic.Zip.Zi pFile.Read (System.St ring,Ionic .Zip.ReadO ptions)"
  27927        />
  27928        .
  27929                      
  27930        <seealso 
  27931         cref="M:Io nic.Zip.Zi pFile.Read (System.IO .Stream,Io nic.Zip.Re adOptions) "
  27932        />
  27933        .
  27934                      
  27935       </remarks>
  27936               
  27937      </member>
  27938              
  27939      <member 
  27940       name="P:Io nic.Zip.Re adOptions. ReadProgre ss"
  27941      >
  27942                    
  27943       <summary>
  27944                     An event  handler f or Read op erations.   When open ing large  zip
  27945                     archives , you may  want to di splay a pr ogress bar  or other
  27946                     indicato r of statu s progress  while rea ding.  Thi s paramete r
  27947                     allows y ou to spec ify a Read Progress E vent Handl er directl y.
  27948                     When you  call 
  27949        <c>
  27950         Read()
  27951        </c>
  27952        , the prog ress event  is invoke d as
  27953                     necessar y.
  27954                     
  27955       </summary>
  27956               
  27957      </member>
  27958              
  27959      <member 
  27960       name="P:Io nic.Zip.Re adOptions. StatusMess ageWriter"
  27961      >
  27962                    
  27963       <summary>
  27964                     The 
  27965        <c>
  27966         System.IO. TextWriter
  27967        </c>
  27968         to use fo r writing  verbose st atus messa ges
  27969                     during o perations  on the zip  archive.   A console  applicati on may wis h to
  27970                     pass 
  27971        <c>
  27972         System.Con sole.Out
  27973        </c>
  27974         to get me ssages on  the Consol e. A graph ical
  27975                     or headl ess applic ation may  wish to ca pture the  messages i n a differ ent
  27976                     
  27977        <c>
  27978         TextWriter
  27979        </c>
  27980        , such as 
  27981        <c>
  27982         System.IO. StringWrit er
  27983        </c>
  27984        .
  27985                     
  27986       </summary>
  27987               
  27988      </member>
  27989              
  27990      <member 
  27991       name="P:Io nic.Zip.Re adOptions. Encoding"
  27992      >
  27993                     
  27994       <summary>
  27995                      The 
  27996        <c>
  27997         System.Tex t.Encoding
  27998        </c>
  27999         to use wh en reading  in the zi p archive.  Be
  28000                      careful  specifyin g the enco ding.  If  the value  you use he re is not  the same
  28001                      as the  Encoding u sed when t he zip arc hive was c reated (po ssibly by  a
  28002                      differe nt archive r) you wil l get unex pected res ults and p ossibly ex ceptions.
  28003                      
  28004       </summary>
  28005                    
  28006                     
  28007       <seealso 
  28008        cref="P:Io nic.Zip.Zi pFile.Prov isionalAlt ernateEnco ding"
  28009       />
  28010                    
  28011               
  28012      </member>
  28013              
  28014      <member 
  28015       name="T:Io nic.Zip.Se lfExtracto rFlavor"
  28016      >
  28017                    
  28018       <summary>
  28019                     An enum  that provi des the di fferent se lf-extract or flavors
  28020                     
  28021       </summary>
  28022               
  28023      </member>
  28024              
  28025      <member 
  28026       name="F:Io nic.Zip.Se lfExtracto rFlavor.Co nsoleAppli cation"
  28027      >
  28028                    
  28029       <summary>
  28030                     A self-e xtracting  zip archiv e that run s from the  console o r
  28031                     command  line.
  28032                     
  28033       </summary>
  28034               
  28035      </member>
  28036              
  28037      <member 
  28038       name="F:Io nic.Zip.Se lfExtracto rFlavor.Wi nFormsAppl ication"
  28039      >
  28040                    
  28041       <summary>
  28042                     A self-e xtracting  zip archiv e that pre sents a gr aphical us er
  28043                     interfac e when it  is execute d.
  28044                     
  28045       </summary>
  28046               
  28047      </member>
  28048              
  28049      <member 
  28050       name="T:Io nic.Zip.Se lfExtracto rSaveOptio ns"
  28051      >
  28052                    
  28053       <summary>
  28054                     The opti ons for ge nerating a  self-extr acting arc hive.
  28055                     
  28056       </summary>
  28057               
  28058      </member>
  28059              
  28060      <member 
  28061       name="P:Io nic.Zip.Se lfExtracto rSaveOptio ns.Flavor"
  28062      >
  28063                    
  28064       <summary>
  28065                       The ty pe of SFX  to create.
  28066                     
  28067       </summary>
  28068               
  28069      </member>
  28070              
  28071      <member 
  28072       name="P:Io nic.Zip.Se lfExtracto rSaveOptio ns.PostExt ractComman dLine"
  28073      >
  28074                     
  28075       <summary>
  28076                        The c ommand to  run after  extraction .
  28077                      
  28078       </summary>
  28079                    
  28080                     
  28081       <remarks>
  28082                      
  28083        <para>
  28084                         This  is optiona l. Leave i t empty (
  28085         <c>
  28086          null
  28087         </c>
  28088          in C# or 
  28089         <c>
  28090          Nothing
  28091         </c>
  28092          in
  28093                         VB) t o run no c ommand aft er extract ion.
  28094                       
  28095        </para>
  28096                     
  28097                      
  28098        <para>
  28099                         If it  is non-em pty, the S FX will ex ecute the  command sp ecified in  this
  28100                         strin g on the u ser's mach ine, and u sing the e xtract dir ectory as  the
  28101                         worki ng directo ry for the  process,  after unpa cking the  archive. T he
  28102                         progr am to exec ute can in clude a pa th, if you  like. If  you want t o execute
  28103                         a pro gram that  accepts ar guments, s pecify the  program n ame, follo wed by a
  28104                         space , and then  the argum ents for t he program , each sep arated by  a space,
  28105                         just  as you wou ld on a no rmal comma nd line. E xample: 
  28106         <c>
  28107          program.ex e arg1
  28108                          arg2
  28109         </c>
  28110         .  The str ing prior  to the fir st space w ill be tak en as the
  28111                         progr am name, a nd the str ing follow ing the fi rst space  specifies  the
  28112                         argum ents to th e program.
  28113                       
  28114        </para>
  28115                     
  28116                      
  28117        <para>
  28118                         If yo u want to  execute a  program th at has a s pace in th e name or  path of
  28119                         the f ile, surro und the pr ogram name  in double -quotes. T he first c haracter
  28120                         of th e command  line shoul d be a dou ble-quote  character,  and there  must be
  28121                         a mat ching doub le-quote f ollowing t he end of  the progra m file nam e. Any
  28122                         optio nal argume nts to the  program f ollow that , separate d by
  28123                         space s. Example
  28124         <c>
  28125          "c:\projec t files\pr ogram name .exe" arg1  arg2
  28126         </c>
  28127         .
  28128                       
  28129        </para>
  28130                     
  28131                      
  28132        <para>
  28133                         If th e flavor o f the SFX  is 
  28134         <c>
  28135          SelfExtrac torFlavor. ConsoleApp lication
  28136         </c>
  28137         ,
  28138                         then  the SFX st arts a new  process,  using this  string as  the post- extract
  28139                         comma nd line.   The SFX wa its for th e process  to exit.   The exit c ode of
  28140                         the p ost-extrac t command  line is re turned as  the exit c ode of the
  28141                         comma nd-line se lf-extract or exe. A  non-zero e xit code i s typicall y used to
  28142                         indic ated a fai lure by th e program.  In the ca se of an S FX, a non- zero exit
  28143                         code  may indica te a failu re during  extraction , OR, it m ay indicat e a
  28144                         failu re of the  run-after- extract pr ogram if s pecified,  OR, it may  indicate
  28145                         the r un-after-e xtract pro gram could  not be fu ond. There  is no way  to
  28146                         disti nguish the se conditi ons from t he calling  shell, as ide from p arsing
  28147                         the o utput of t he SFX. If  you have  Quiet set  to 
  28148         <c>
  28149          true
  28150         </c>
  28151         , you may  not
  28152                         see e rror messa ges, if a  problem oc curs.
  28153                       
  28154        </para>
  28155                     
  28156                      
  28157        <para>
  28158                         If th e flavor o f the SFX  is
  28159                         
  28160         <c>
  28161          SelfExtrac torFlavor. WinFormsAp plication
  28162         </c>
  28163         , then the  SFX start s a new
  28164                         proce ss, using  this strin g as the p ost-extrac t command  line, and  using the
  28165                         extra ct directo ry as the  working di rectory fo r the proc ess. The S FX does
  28166                         not w ait for th e command  to complet e, and doe s not chec k the exit  code of
  28167                         the p rogram. If  the run-a fter-extra ct program  cannot be  fuond, a  message
  28168                         box i s displaye d indicati ng that fa ct.
  28169                       
  28170        </para>
  28171                     
  28172                      
  28173        <para>
  28174                         You c an specify  environme nt variabl es within  this strin g, with a  format lik e
  28175                         
  28176         <c>
  28177          %NAME%
  28178         </c>
  28179         . The valu e of these  variables  will be e xpanded at  the time
  28180                         the S FX is run.  Example: 
  28181         <c>
  28182          %WINDIR%\s ystem32\xc opy.exe
  28183         </c>
  28184          may expan d at
  28185                         runti me to 
  28186         <c>
  28187          c:\Windows \System32\ xcopy.exe
  28188         </c>
  28189         .
  28190                       
  28191        </para>
  28192                     
  28193                      
  28194        <para>
  28195                         By co mbining th is with th
  28196         <c>
  28197          RemoveUnpa ckedFilesA fterExecut e
  28198         </c>
  28199                         flag,  you can c reate an S FX that ex tracts its elf, runs  a file tha t
  28200                         was e xtracted,  then delet es all the  files tha t were ext racted. If
  28201                         you w ant it to  run "invis ibly" then  set 
  28202         <c>
  28203          Flavor
  28204         </c>
  28205          to
  28206                         
  28207         <c>
  28208          SelfExtrac torFlavor. ConsoleApp lication
  28209         </c>
  28210         , and set 
  28211         <c>
  28212          Quiet
  28213         </c>
  28214                         to tr ue.  The u ser runnin g such an  EXE will s ee a conso le window
  28215                         appea r, then di sappear qu ickly.  Yo u may also  want to s pecify the
  28216                         defau lt extract  location,  with 
  28217         <c>
  28218          DefaultExt ractDirect ory
  28219         </c>
  28220         .
  28221                       
  28222        </para>
  28223                     
  28224                      
  28225        <para>
  28226                         If yo u set 
  28227         <c>
  28228          Flavor
  28229         </c>
  28230          to
  28231                         
  28232         <c>
  28233          SelfExtrac torFlavor. WinFormsAp plication
  28234         </c>
  28235         , and set 
  28236         <c>
  28237          Quiet
  28238         </c>
  28239          to
  28240                         true,  then a GU I with pro gressbars  is display ed, but it  is
  28241                         "non- interactiv e" - it ac cepts no i nput from  the user.   Instead t he SFX
  28242                         just  automatica lly unpack s and exit s.
  28243                       
  28244        </para>
  28245                     
  28246                      
  28247       </remarks>
  28248               
  28249      </member>
  28250              
  28251      <member 
  28252       name="P:Io nic.Zip.Se lfExtracto rSaveOptio ns.Default ExtractDir ectory"
  28253      >
  28254                     
  28255       <summary>
  28256                        The d efault ext ract direc tory the u ser will s ee when
  28257                        runni ng the sel f-extracti ng archive .
  28258                      
  28259       </summary>
  28260                    
  28261                     
  28262       <remarks>
  28263                      
  28264        <para>
  28265                         Passi ng null (o r Nothing  in VB) her e will cau se the Sel f Extracto r to use
  28266                         the t he user's  personal d irectory (
  28267         <see 
  28268          cref="F:Sy stem.Envir onment.Spe cialFolder .Personal"
  28269         />
  28270         ) for the  default ex tract
  28271                         locat ion.
  28272                       
  28273        </para>
  28274                     
  28275                      
  28276        <para>
  28277                         This  is only a  default lo cation.  T he actual  extract lo cation wil l be
  28278                         setta ble on the  command l ine when t he SFX is  executed.
  28279                       
  28280        </para>
  28281                     
  28282                      
  28283        <para>
  28284                         You c an specify  environme nt variabl es within  this strin g,
  28285                         with 
  28286         <c>
  28287          %NAME%
  28288         </c>
  28289         . The valu e of these  variables  will be
  28290                         expan ded at the  time the  SFX is run . Example:
  28291                         
  28292         <c>
  28293          %USERPROFI LE%\Docume nts\unpack
  28294         </c>
  28295          may expan d at runti me to
  28296                         
  28297         <c>
  28298          c:\users\m elvin\Docu ments\unpa ck
  28299         </c>
  28300         .
  28301                       
  28302        </para>
  28303                      
  28304       </remarks>
  28305               
  28306      </member>
  28307              
  28308      <member 
  28309       name="P:Io nic.Zip.Se lfExtracto rSaveOptio ns.IconFil e"
  28310      >
  28311                     
  28312       <summary>
  28313                        The n ame of an  .ico file  in the fil esystem to  use for t he applica tion icon
  28314                        for t he generat ed SFX.
  28315                      
  28316       </summary>
  28317                    
  28318                     
  28319       <remarks>
  28320                      
  28321        <para>
  28322                         Norma lly, DotNe tZip will  embed an " zipped fol der" icon  into the g enerated
  28323                         SFX.   If you pr efer to us e a differ ent icon,  you can sp ecify it h ere. It
  28324                         shoul d be a .ic o file.  T his file i s passed a s the 
  28325         <c>
  28326          /win32icon
  28327         </c>
  28328                         optio n to the c sc.exe com piler when  construct ing the SF X file.
  28329                       
  28330        </para>
  28331                      
  28332       </remarks>
  28333                    
  28334               
  28335      </member>
  28336              
  28337      <member 
  28338       name="P:Io nic.Zip.Se lfExtracto rSaveOptio ns.Quiet"
  28339      >
  28340                     
  28341       <summary>
  28342                        Wheth er the Con soleApplic ation SFX  will be qu iet during  extractio n.
  28343                      
  28344       </summary>
  28345                    
  28346                     
  28347       <remarks>
  28348                      
  28349        <para>
  28350                         This  option aff ects the w ay the gen erated SFX  runs. By  default it  is
  28351                         false .  When yo u set it t o true,...
  28352                       
  28353        </para>
  28354                     
  28355                      
  28356        <list 
  28357         type="tabl e"
  28358        >
  28359                         
  28360         <listheade r>
  28361                            
  28362          <term>
  28363           Flavor
  28364          </term>
  28365                            
  28366          <descripti on>
  28367           Behavior
  28368          </descript ion>
  28369                          
  28370         </listhead er>
  28371                      
  28372                       
  28373         <item>
  28374                          
  28375          <term>
  28376           <c>
  28377            ConsoleApp lication
  28378           </c>
  28379          </term>
  28380                          
  28381          <descripti on>
  28382           <para>
  28383            no message s will be  emitted du ring succe ssful
  28384                              ope ration.
  28385           </para>
  28386            
  28387           <para>
  28388             Double-cl icking the  SFX in Wi ndows
  28389                              Exp lorer or a s an attac hment in a n email wi ll cause a  console
  28390                              win dow to app ear briefl y, before  it disappe ars. If yo u run the
  28391                              Con soleApplic ation SFX  from the c md.exe pro mpt, it ru ns as a
  28392                              nor mal consol e app; by  default, b ecause it  is quiet,  it display s
  28393                              no  messages t o the cons ole.  If y ou pass th e -v+ comm and line
  28394                              arg ument to t he Console  SFX when  you run it , you will  get verbo se
  28395                              mes sages to t he console
  28396           </para>
  28397                           
  28398          </descript ion>
  28399                        
  28400         </item>
  28401                      
  28402                       
  28403         <item>
  28404                          
  28405          <term>
  28406           <c>
  28407            WinFormsAp plication
  28408           </c>
  28409          </term>
  28410                          
  28411          <descripti on>
  28412           the SFX ex tracts aut omatically  when the  applicatio n
  28413                                 is launche d, with no  additiona l user inp ut.
  28414                           
  28415          </descript ion>
  28416                        
  28417         </item>
  28418                      
  28419                       
  28420        </list>
  28421                     
  28422                      
  28423        <para>
  28424                         When  you set it  to false, ...
  28425                       
  28426        </para>
  28427                     
  28428                      
  28429        <list 
  28430         type="tabl e"
  28431        >
  28432                         
  28433         <listheade r>
  28434                            
  28435          <term>
  28436           Flavor
  28437          </term>
  28438                            
  28439          <descripti on>
  28440           Behavior
  28441          </descript ion>
  28442                          
  28443         </listhead er>
  28444                      
  28445                       
  28446         <item>
  28447                          
  28448          <term>
  28449           <c>
  28450            ConsoleApp lication
  28451           </c>
  28452          </term>
  28453                          
  28454          <descripti on>
  28455           <para>
  28456            the extrac tor will e mit a
  28457                              mes sage to th e console  for each e ntry extra cted.
  28458           </para>
  28459                             
  28460           <para>
  28461                                W hen double -clicking  to launch  the SFX, t he console  window wi ll
  28462                                r emain, and  the SFX w ill emit a  message f or each fi le as it
  28463                                e xtracts. T he message s fly by q uickly, th ey won't b e easily
  28464                                r eadable, u nless the  extracted  files are  fairly lar ge.
  28465                              
  28466           </para>
  28467                           
  28468          </descript ion>
  28469                        
  28470         </item>
  28471                      
  28472                       
  28473         <item>
  28474                          
  28475          <term>
  28476           <c>
  28477            WinFormsAp plication
  28478           </c>
  28479          </term>
  28480                          
  28481          <descripti on>
  28482           the SFX pr esents a f orms UI an d allows t he user to  select
  28483                             opt ions befor e extracti ng.
  28484                           
  28485          </descript ion>
  28486                        
  28487         </item>
  28488                      
  28489                       
  28490        </list>
  28491                     
  28492                      
  28493       </remarks>
  28494               
  28495      </member>
  28496              
  28497      <member 
  28498       name="P:Io nic.Zip.Se lfExtracto rSaveOptio ns.Extract ExistingFi le"
  28499      >
  28500                    
  28501       <summary>
  28502                       Specif y what the  self-extr actor will  do when e xtracting  an entry
  28503                       would  overwrite  an existin g file.
  28504                     
  28505       </summary>
  28506                    
  28507       <remarks>
  28508                     
  28509        <para>
  28510                        The de fault beha vvior is t o Throw.
  28511                      
  28512        </para>
  28513                     
  28514       </remarks>
  28515               
  28516      </member>
  28517              
  28518      <member 
  28519       name="P:Io nic.Zip.Se lfExtracto rSaveOptio ns.RemoveU npackedFil esAfterExe cute"
  28520      >
  28521                     
  28522       <summary>
  28523                        Wheth er to remo ve the fil es that ha ve been un packed, af ter execut ing the
  28524                        PostE xtractComm andLine.
  28525                      
  28526       </summary>
  28527                    
  28528                     
  28529       <remarks>
  28530                      
  28531        <para>
  28532                         If tr ue, and if  there is 
  28533         <see 
  28534          cref="P:Io nic.Zip.Se lfExtracto rSaveOptio ns.PostExt ractComman dLine"
  28535         >
  28536                          PostE xtractComm andLine
  28537         </see>
  28538         , and if t he command  runs succ essfully,
  28539                         then  the files  that the S FX unpacke d will be  removed, a fterwards.   If
  28540                         the c ommand doe s not comp lete succe ssfully (n on-zero re turn code) ,
  28541                         that  is interpr eted as a  failure, a nd the ext racted fil es will no t be
  28542                         remov ed.
  28543                       
  28544        </para>
  28545                     
  28546                      
  28547        <para>
  28548                         Setti ng this fl ag, and se tting 
  28549         <c>
  28550          Flavor
  28551         </c>
  28552          to
  28553                         
  28554         <c>
  28555          SelfExtrac torFlavor. ConsoleApp lication
  28556         </c>
  28557         , and sett ing 
  28558         <c>
  28559          Quiet
  28560         </c>
  28561          to
  28562                         true,  results i n an SFX t hat extrac ts itself,  runs a fi le that wa s
  28563                         extra cted, then  deletes a ll the fil es that we re extract ed, with n o
  28564                         inter vention by  the user.   You may  also want  to specify  the defau lt
  28565                         extra ct locatio n, with 
  28566         <c>
  28567          DefaultExt ractDirect ory
  28568         </c>
  28569         .
  28570                       
  28571        </para>
  28572                     
  28573                      
  28574       </remarks>
  28575               
  28576      </member>
  28577              
  28578      <member 
  28579       name="P:Io nic.Zip.Se lfExtracto rSaveOptio ns.FileVer sion"
  28580      >
  28581                     
  28582       <summary>
  28583                        The f ile versio n number t o embed in to the gen erated EXE . It will  show up, f or
  28584                        examp le, during  a mouseov er in Wind ows Explor er.
  28585                      
  28586       </summary>
  28587                    
  28588               
  28589      </member>
  28590              
  28591      <member 
  28592       name="P:Io nic.Zip.Se lfExtracto rSaveOptio ns.Product Version"
  28593      >
  28594                     
  28595       <summary>
  28596                        The p roduct ver sion to em bed into t he generat ed EXE. It  will show  up, for
  28597                        examp le, during  a mouseov er in Wind ows Explor er.
  28598                      
  28599       </summary>
  28600                    
  28601                     
  28602       <remarks>
  28603                        You c an use any  arbitrary  string, b ut a human -readable  version nu mber is
  28604                        recom mended. Fo r example  "v1.2 alph a" or "v4. 2 RC2".  I f you spec ify nothin g,
  28605                        then  there is n o product  version em bedded int o the EXE.
  28606                      
  28607       </remarks>
  28608                    
  28609               
  28610      </member>
  28611              
  28612      <member 
  28613       name="P:Io nic.Zip.Se lfExtracto rSaveOptio ns.Copyrig ht"
  28614      >
  28615                     
  28616       <summary>
  28617                        The c opyright n otice, if  any, to em bed into t he generat ed EXE.
  28618                      
  28619       </summary>
  28620                    
  28621                     
  28622       <remarks>
  28623                        It wi ll show up , for exam ple, while  viewing p roperties  of the fil e in
  28624                        Windo ws Explore r.  You ca n use any  arbitrary  string, bu t typicall y you
  28625                        want  something  like "Copy right Â© D ino Chiesa  2011".
  28626                      
  28627       </remarks>
  28628                    
  28629               
  28630      </member>
  28631              
  28632      <member 
  28633       name="P:Io nic.Zip.Se lfExtracto rSaveOptio ns.Descrip tion"
  28634      >
  28635                     
  28636       <summary>
  28637                        The d escription  to embed  into the g enerated E XE.
  28638                      
  28639       </summary>
  28640                    
  28641                     
  28642       <remarks>
  28643                        Use a ny arbitra ry string.   This tex t will be  displayed  during a
  28644                        mouse over in Wi ndows Expl orer.  If  you specif y nothing,  then the  string
  28645                        "DotN etZip SFX  Archive" i s embedded  into the  EXE as the  descripti on.
  28646                      
  28647       </remarks>
  28648                    
  28649               
  28650      </member>
  28651              
  28652      <member 
  28653       name="P:Io nic.Zip.Se lfExtracto rSaveOptio ns.Product Name"
  28654      >
  28655                     
  28656       <summary>
  28657                        The p roduct nam e to embed  into the  generated  EXE.
  28658                      
  28659       </summary>
  28660                    
  28661                     
  28662       <remarks>
  28663                        Use a ny arbitra ry string.  This text  will be d isplayed
  28664                        while  viewing p roperties  of the EXE  file in
  28665                        Windo ws Explore r.
  28666                      
  28667       </remarks>
  28668                    
  28669               
  28670      </member>
  28671              
  28672      <member 
  28673       name="P:Io nic.Zip.Se lfExtracto rSaveOptio ns.SfxExeW indowTitle "
  28674      >
  28675                     
  28676       <summary>
  28677                        The t itle to di splay in t he Window  of a GUI S FX, while  it extract s.
  28678                      
  28679       </summary>
  28680                    
  28681                     
  28682       <remarks>
  28683                        
  28684        <para>
  28685                           By  default th e title sh ow in the  GUI window  of a self -extractor
  28686                           is  "DotNetZip  Self-extr actor (htt p://DotNet Zip.codepl ex.com/)".
  28687                           You  can chang e that by  setting th is propert y before s aving the  SFX.
  28688                         
  28689        </para>
  28690                     
  28691                        
  28692        <para>
  28693                           Thi s property  has an ef fect only  when produ cing a Sel f-extracto r
  28694                           of  flavor 
  28695         <c>
  28696          SelfExtrac torFlavor. WinFormsAp plication
  28697         </c>
  28698         .
  28699                         
  28700        </para>
  28701                      
  28702       </remarks>
  28703                    
  28704               
  28705      </member>
  28706              
  28707      <member 
  28708       name="P:Io nic.Zip.Se lfExtracto rSaveOptio ns.Additio nalCompile rSwitches"
  28709      >
  28710                    
  28711       <summary>
  28712                       Additi onal optio ns for the  csc.exe c ompiler, w hen produc ing the SF X
  28713                       EXE.
  28714                     
  28715       </summary>
  28716                    
  28717       <exclude/>
  28718               
  28719      </member>
  28720              
  28721      <member 
  28722       name="M:Io nic.BZip2. BitWriter. Reset"
  28723      >
  28724                    
  28725       <summary>
  28726                       Reset  the BitWri ter.
  28727                     
  28728       </summary>
  28729                    
  28730       <remarks>
  28731                       
  28732        <para>
  28733                          This  is useful  when the  BitWriter  writes int o a Memory Stream, an d
  28734                          is u sed by a B Zip2Compre ssor, whic h itself i s re-used  for multip le
  28735                          dist inct data  blocks.
  28736                        
  28737        </para>
  28738                     
  28739       </remarks>
  28740               
  28741      </member>
  28742              
  28743      <member 
  28744       name="M:Io nic.BZip2. BitWriter. WriteBits( System.Int 32,System. UInt32)"
  28745      >
  28746                    
  28747       <summary>
  28748                       Write  some numbe r of bits  from the g iven value , into the  output.
  28749                     
  28750       </summary>
  28751                    
  28752       <remarks>
  28753                       
  28754        <para>
  28755                          The  nbits valu e should b e a max of  25, for s afety. For  performan ce
  28756                          reas ons, this  method doe s not chec k!
  28757                        
  28758        </para>
  28759                     
  28760       </remarks>
  28761               
  28762      </member>
  28763              
  28764      <member 
  28765       name="M:Io nic.BZip2. BitWriter. WriteByte( System.Byt e)"
  28766      >
  28767                    
  28768       <summary>
  28769                       Write  a full 8-b it byte in to the out put.
  28770                     
  28771       </summary>
  28772               
  28773      </member>
  28774              
  28775      <member 
  28776       name="M:Io nic.BZip2. BitWriter. WriteInt(S ystem.UInt 32)"
  28777      >
  28778                    
  28779       <summary>
  28780                       Write  four 8-bit  bytes int o the outp ut.
  28781                     
  28782       </summary>
  28783               
  28784      </member>
  28785              
  28786      <member 
  28787       name="M:Io nic.BZip2. BitWriter. Flush"
  28788      >
  28789                    
  28790       <summary>
  28791                       Write  all availa ble byte-a ligned byt es.
  28792                     
  28793       </summary>
  28794                    
  28795       <remarks>
  28796                       
  28797        <para>
  28798                          This  method wr ites no ne w output,  but flushe s any accu mulated
  28799                          bits . At compl etion, the  accumulat or may con tain up to  7
  28800                          bits .
  28801                        
  28802        </para>
  28803                       
  28804        <para>
  28805                          This  is necess ary when r e-assembli ng output  from N ind ependent
  28806                          comp ressors, o ne for eac h of N blo cks. The o utput of a ny
  28807                          part icular com pressor wi ll in gene ral have s ome fragme nt of a by te
  28808                          rema ining. Thi s fragment  needs to  be accumul ated into  the
  28809                          pare nt BZip2Ou tputStream .
  28810                        
  28811        </para>
  28812                     
  28813       </remarks>
  28814               
  28815      </member>
  28816              
  28817      <member 
  28818       name="M:Io nic.BZip2. BitWriter. FinishAndP ad"
  28819      >
  28820                    
  28821       <summary>
  28822                       Writes  all avail able bytes , and emit s padding  for the fi nal byte a s
  28823                       necess ary. This  must be th e last met hod invoke d on an in stance of
  28824                       BitWri ter.
  28825                     
  28826       </summary>
  28827               
  28828      </member>
  28829              
  28830      <member 
  28831       name="P:Io nic.BZip2. BitWriter. RemainingB its"
  28832      >
  28833                    
  28834       <summary>
  28835                       Delive rs the rem aining bit s, left-al igned, in  a byte.
  28836                     
  28837       </summary>
  28838                    
  28839       <remarks>
  28840                       
  28841        <para>
  28842                          This  is valid  only if Nu mRemaining Bits is le ss than 8;
  28843                          in o ther words  it is val id only af ter a call  to Flush( ).
  28844                        
  28845        </para>
  28846                     
  28847       </remarks>
  28848               
  28849      </member>
  28850              
  28851      <member 
  28852       name="F:Io nic.BZip2. BZip2Compr essor.incr ements"
  28853      >
  28854                    Knuth's  increments  seem to w ork better  than Ince rpi-Sedgew ick here.
  28855                    Possibly  because t he number  of elems t o sort is  usually sm all, typic ally
  28856                    &lt;= 20 .
  28857               
  28858      </member>
  28859              
  28860      <member 
  28861       name="M:Io nic.BZip2. BZip2Compr essor.#cto r(Ionic.BZ ip2.BitWri ter)"
  28862      >
  28863                    
  28864       <summary>
  28865                       BZip2C ompressor  writes its  compresse d data out  via a Bit Writer. Th is
  28866                       is nec essary bec ause BZip2  does byte  shredding .
  28867                     
  28868       </summary>
  28869               
  28870      </member>
  28871              
  28872      <member 
  28873       name="M:Io nic.BZip2. BZip2Compr essor.Fill (System.By te[],Syste m.Int32,Sy stem.Int32 )"
  28874      >
  28875                    
  28876       <summary>
  28877                       Accept  new bytes  into the  compressor  data buff er
  28878                     
  28879       </summary>
  28880                    
  28881       <remarks>
  28882                       
  28883        <para>
  28884                          This  method do es the fir st-level ( cheap) run -length en coding, an d
  28885                          stor es the enc oded data  into the r le block.
  28886                        
  28887        </para>
  28888                     
  28889       </remarks>
  28890               
  28891      </member>
  28892              
  28893      <member 
  28894       name="M:Io nic.BZip2. BZip2Compr essor.writ e0(System. Byte)"
  28895      >
  28896                     
  28897       <summary>
  28898                        Proce ss one inp ut byte in to the blo ck.
  28899                      
  28900       </summary>
  28901                    
  28902                     
  28903       <remarks>
  28904                        
  28905        <para>
  28906                           To  "process"  the byte m eans to do  the run-l ength enco ding.
  28907                           The re are 3 p ossible re turn value s:
  28908                      
  28909                               0 - the by te was not  written,  in other w ords, not
  28910                                   encode d into the  block. Th is happens  when the
  28911                                   byte b  would req uire the s tart of a  new run, a nd
  28912                                   the bl ock has no  more room  for new r uns.
  28913                      
  28914                               1 - the by te was wri tten, and  the block  is not ful l.
  28915                      
  28916                               2 - the by te was wri tten, and  the block  is full.
  28917                      
  28918                         
  28919        </para>
  28920                      
  28921       </remarks>
  28922                     
  28923       <returns>
  28924        0 if the b yte was no t written,  non-zero  if written .
  28925       </returns>
  28926               
  28927      </member>
  28928              
  28929      <member 
  28930       name="M:Io nic.BZip2. BZip2Compr essor.AddR unToOutput Block(Syst em.Boolean )"
  28931      >
  28932                     
  28933       <summary>
  28934                        Appen d one run  to the out put block.
  28935                      
  28936       </summary>
  28937                    
  28938                     
  28939       <remarks>
  28940                        
  28941        <para>
  28942                           Thi s compress or does ru n-length-e ncoding be fore BWT a nd etc. Th is
  28943                           met hod simply  appends a  run to th e output b lock. The  append alw ays
  28944                           suc ceeds. The  return va lue indica tes whethe r the bloc k is full:
  28945                           fal se (not fu ll) implie s that at  least one  additional  run could  be
  28946                           pro cessed.
  28947                         
  28948        </para>
  28949                      
  28950       </remarks>
  28951                     
  28952       <returns>
  28953        true if th e block is  now full;  otherwise  false.
  28954       </returns>
  28955               
  28956      </member>
  28957              
  28958      <member 
  28959       name="M:Io nic.BZip2. BZip2Compr essor.Comp ressAndWri te"
  28960      >
  28961                    
  28962       <summary>
  28963                       Compre ss the dat a that has  been plac ed (Run-le ngth-encod ed) into t he
  28964                       block.  The compr essed data  goes into  the Compr essedBytes  array.
  28965                     
  28966       </summary>
  28967                    
  28968       <remarks>
  28969                       
  28970        <para>
  28971                          Side  effects:  1.  fills  the Compre ssedBytes  array.  2.  sets the
  28972                          Avai lableBytes Out proper ty.
  28973                        
  28974        </para>
  28975                     
  28976       </remarks>
  28977               
  28978      </member>
  28979              
  28980      <member 
  28981       name="M:Io nic.BZip2. BZip2Compr essor.main SimpleSort (Ionic.BZi p2.BZip2Co mpressor.C ompression State,Syst em.Int32,S ystem.Int3 2,System.I nt32)"
  28982      >
  28983                     This is  the most  hammered m ethod of t his class.
  28984                    
  28985                     
  28986       <p>
  28987                      This is  the versi on using u nrolled lo ops.
  28988                      
  28989       </p>
  28990               
  28991      </member>
  28992              
  28993      <member 
  28994       name="M:Io nic.BZip2. BZip2Compr essor.main QSort3(Ion ic.BZip2.B Zip2Compre ssor.Compr essionStat e,System.I nt32,Syste m.Int32,Sy stem.Int32 )"
  28995      >
  28996                    Method " mainQSort3 ", file "b locksort.c ", BZip2 1 .0.2
  28997               
  28998      </member>
  28999              
  29000      <member 
  29001       name="P:Io nic.BZip2. BZip2Compr essor.Unco mpressedBy tes"
  29002      >
  29003                    
  29004       <summary>
  29005                       The nu mber of un compressed  bytes bei ng held in  the buffe r.
  29006                     
  29007       </summary>
  29008                    
  29009       <remarks>
  29010                       
  29011        <para>
  29012                          I am  thinking  this may b e useful i n a Stream  that uses  this
  29013                          comp ressor cla ss. In the  Close() m ethod on t he stream  it could
  29014                          chec k this val ue to see  if anythin g has been  written a t all.  Yo u
  29015                          may  think the  stream cou ld easily  track the  number of  bytes it
  29016                          wrot e, which w ould elimi nate the n eed for th is. But, t here is th e
  29017                          case  where the  stream wr ites a com plete bloc k, and it  is full, a nd
  29018                          then  writes no  more. In  that case  the stream  may want  to check.
  29019                        
  29020        </para>
  29021                     
  29022       </remarks>
  29023               
  29024      </member>
  29025              
  29026      <member 
  29027       name="F:Io nic.BZip2. BZip2Compr essor.Comp ressionSta te.quadran t"
  29028      >
  29029                    Array in stance ide ntical to  sfmap, bot h are used  only
  29030                    temporar ily and in dependentl y, so we d o not need  to alloca te
  29031                    addition al memory.
  29032               
  29033      </member>
  29034              
  29035      <member 
  29036       name="T:Io nic.BZip2. BZip2Input Stream"
  29037      >
  29038                    
  29039       <summary>
  29040                       A read -only deco rator stre am that pe rforms BZi p2 decompr ession on  Read.
  29041                     
  29042       </summary>
  29043               
  29044      </member>
  29045              
  29046      <member 
  29047       name="M:Io nic.BZip2. BZip2Input Stream.#ct or(System. IO.Stream) "
  29048      >
  29049                    
  29050       <summary>
  29051                       Create  a BZip2In putStream,  wrapping  it around  the given  input Stre am.
  29052                     
  29053       </summary>
  29054                    
  29055       <remarks>
  29056                       
  29057        <para>
  29058                          The  input stre am will be  closed wh en the BZi p2InputStr eam is clo sed.
  29059                        
  29060        </para>
  29061                     
  29062       </remarks>
  29063                    
  29064       <param 
  29065        name='inpu t'
  29066       >
  29067        The stream  from whic h to read  compressed  data
  29068       </param>
  29069               
  29070      </member>
  29071              
  29072      <member 
  29073       name="M:Io nic.BZip2. BZip2Input Stream.#ct or(System. IO.Stream, System.Boo lean)"
  29074      >
  29075                     
  29076       <summary>
  29077                        Creat e a BZip2I nputStream  with the  given stre am, and
  29078                        speci fying whet her to lea ve the wra pped strea m open whe n
  29079                        the B Zip2InputS tream is c losed.
  29080                      
  29081       </summary>
  29082                     
  29083       <param 
  29084        name='inpu t'
  29085       >
  29086        The stream  from whic h to read  compressed  data
  29087       </param>
  29088                     
  29089       <param 
  29090        name='leav eOpen'
  29091       >
  29092                        Wheth er to leav e the inpu t stream o pen, when  the BZip2I nputStream  closes.
  29093                      
  29094       </param>
  29095                    
  29096                     
  29097       <example>
  29098                     
  29099                        This  example re ads a bzip 2-compress ed file, d ecompresse s it,
  29100                        and w rites the  decompress ed data in to a newly  created f ile.
  29101                     
  29102                        
  29103        <code>
  29104                         var f name = "lo gfile.log. bz2";
  29105                         using  (var fs =  File.Open Read(fname ))
  29106                         {
  29107                             u sing (var  decompress or = new I onic.BZip2 .BZip2Inpu tStream(fs ))
  29108                             {
  29109                                  var out Fname = fn ame + ".de compressed ";
  29110                                  using ( var output  = File.Cr eate(outFn ame))
  29111                                  {
  29112                                      byt e[] buffer  = new byt e[2048];
  29113                                      int  n;
  29114                                      whi le ((n = d ecompresso r.Read(buf fer, 0, bu ffer.Lengt h)) > 0)
  29115                                      {
  29116                                           output.Wr ite(buffer , 0, n);
  29117                                      }
  29118                                  }
  29119                             }
  29120                         }
  29121                         
  29122        </code>
  29123                      
  29124       </example>
  29125               
  29126      </member>
  29127              
  29128      <member 
  29129       name="M:Io nic.BZip2. BZip2Input Stream.Rea d(System.B yte[],Syst em.Int32,S ystem.Int3 2)"
  29130      >
  29131                     
  29132       <summary>
  29133                        Read  data from  the stream .
  29134                      
  29135       </summary>
  29136                    
  29137                     
  29138       <remarks>
  29139                        
  29140        <para>
  29141                           To  decompress  a BZip2 d ata stream , create a  
  29142         <c>
  29143          BZip2Input Stream
  29144         </c>
  29145         ,
  29146                           pro viding a s tream that  reads com pressed da ta.  Then  call Read( ) on
  29147                           tha
  29148         <c>
  29149          BZip2Input Stream
  29150         </c>
  29151         , and the  data read  will be de compressed
  29152                           as  you read.
  29153                         
  29154        </para>
  29155                     
  29156                        
  29157        <para>
  29158                           A 
  29159         <c>
  29160          BZip2Input Stream
  29161         </c>
  29162          can be us ed only fo
  29163         <c>
  29164          Read()
  29165         </c>
  29166         , not for 
  29167         <c>
  29168          Write()
  29169         </c>
  29170         .
  29171                         
  29172        </para>
  29173                      
  29174       </remarks>
  29175                    
  29176                     
  29177       <param 
  29178        name="buff er"
  29179       >
  29180        The buffer  into whic h the read  data shou ld be plac ed.
  29181       </param>
  29182                     
  29183       <param 
  29184        name="offs et"
  29185       >
  29186        the offset  within th at data ar ray to put  the first  byte read .
  29187       </param>
  29188                     
  29189       <param 
  29190        name="coun t"
  29191       >
  29192        the number  of bytes  to read.
  29193       </param>
  29194                     
  29195       <returns>
  29196        the number  of bytes  actually r ead
  29197       </returns>
  29198               
  29199      </member>
  29200              
  29201      <member 
  29202       name="M:Io nic.BZip2. BZip2Input Stream.Rea dByte"
  29203      >
  29204                    
  29205       <summary>
  29206                       Read a  single by te from th e stream.
  29207                     
  29208       </summary>
  29209                    
  29210       <returns>
  29211        the byte r ead from t he stream,  or -1 if  EOF
  29212       </returns>
  29213               
  29214      </member>
  29215              
  29216      <member 
  29217       name="M:Io nic.BZip2. BZip2Input Stream.Flu sh"
  29218      >
  29219                    
  29220       <summary>
  29221                     Flush th e stream.
  29222                     
  29223       </summary>
  29224               
  29225      </member>
  29226              
  29227      <member 
  29228       name="M:Io nic.BZip2. BZip2Input Stream.See k(System.I nt64,Syste m.IO.SeekO rigin)"
  29229      >
  29230                    
  29231       <summary>
  29232                     Calling  this metho d always t hrows a 
  29233        <see 
  29234         cref="T:Sy stem.NotIm plementedE xception"
  29235        />
  29236        .
  29237                     
  29238       </summary>
  29239                    
  29240       <param 
  29241        name="offs et"
  29242       >
  29243        this is ir relevant,  since it w ill always  throw!
  29244       </param>
  29245                    
  29246       <param 
  29247        name="orig in"
  29248       >
  29249        this is ir relevant,  since it w ill always  throw!
  29250       </param>
  29251                    
  29252       <returns>
  29253        irrelevant !
  29254       </returns>
  29255               
  29256      </member>
  29257              
  29258      <member 
  29259       name="M:Io nic.BZip2. BZip2Input Stream.Set Length(Sys tem.Int64) "
  29260      >
  29261                    
  29262       <summary>
  29263                     Calling  this metho d always t hrows a 
  29264        <see 
  29265         cref="T:Sy stem.NotIm plementedE xception"
  29266        />
  29267        .
  29268                     
  29269       </summary>
  29270                    
  29271       <param 
  29272        name="valu e"
  29273       >
  29274        this is ir relevant,  since it w ill always  throw!
  29275       </param>
  29276               
  29277      </member>
  29278              
  29279      <member 
  29280       name="M:Io nic.BZip2. BZip2Input Stream.Wri te(System. Byte[],Sys tem.Int32, System.Int 32)"
  29281      >
  29282                    
  29283       <summary>
  29284                       Callin g this met hod always  throws a 
  29285        <see 
  29286         cref="T:Sy stem.NotIm plementedE xception"
  29287        />
  29288        .
  29289                     
  29290       </summary>
  29291                    
  29292       <param 
  29293        name="buff er"
  29294       >
  29295        this param eter is ne ver used
  29296       </param>
  29297                    
  29298       <param 
  29299        name="offs et"
  29300       >
  29301        this param eter is ne ver used
  29302       </param>
  29303                    
  29304       <param 
  29305        name="coun t"
  29306       >
  29307        this param eter is ne ver used
  29308       </param>
  29309               
  29310      </member>
  29311              
  29312      <member 
  29313       name="M:Io nic.BZip2. BZip2Input Stream.Dis pose(Syste m.Boolean) "
  29314      >
  29315                    
  29316       <summary>
  29317                       Dispos e the stre am.
  29318                     
  29319       </summary>
  29320                    
  29321       <param 
  29322        name="disp osing"
  29323       >
  29324                       indica tes whethe r the Disp ose method  was invok ed by user  code.
  29325                     
  29326       </param>
  29327               
  29328      </member>
  29329              
  29330      <member 
  29331       name="M:Io nic.BZip2. BZip2Input Stream.Clo se"
  29332      >
  29333                    
  29334       <summary>
  29335                       Close  the stream .
  29336                     
  29337       </summary>
  29338               
  29339      </member>
  29340              
  29341      <member 
  29342       name="M:Io nic.BZip2. BZip2Input Stream.Get Bits(Syste m.Int32)"
  29343      >
  29344                    
  29345       <summary>
  29346                       Read n  bits from  input, ri ght justif ying the r esult.
  29347                     
  29348       </summary>
  29349                    
  29350       <remarks>
  29351                       
  29352        <para>
  29353                          For  example, i f you read  1 bit, th e result i s either 0
  29354                          or 1 .
  29355                        
  29356        </para>
  29357                     
  29358       </remarks>
  29359                    
  29360       <param 
  29361        name ="n"
  29362       >
  29363                       The nu mber of bi ts to read , always b etween 1 a nd 32.
  29364                     
  29365       </param>
  29366               
  29367      </member>
  29368              
  29369      <member 
  29370       name="M:Io nic.BZip2. BZip2Input Stream.hbC reateDecod eTables(Sy stem.Int32 [],System. Int32[],Sy stem.Int32 [],System. Char[],Sys tem.Int32, System.Int 32,System. Int32)"
  29371      >
  29372                    Called b y createHu ffmanDecod ingTables( ) exclusiv ely.
  29373               
  29374      </member>
  29375              
  29376      <member 
  29377       name="M:Io nic.BZip2. BZip2Input Stream.cre ateHuffman DecodingTa bles(Syste m.Int32,Sy stem.Int32 )"
  29378      >
  29379                    Called b y recvDeco dingTables () exclusi vely.
  29380               
  29381      </member>
  29382              
  29383      <member 
  29384       name="P:Io nic.BZip2. BZip2Input Stream.Can Read"
  29385      >
  29386                    
  29387       <summary>
  29388                     Indicate s whether  the stream  can be re ad.
  29389                     
  29390       </summary>
  29391                    
  29392       <remarks>
  29393                     The retu rn value d epends on  whether th e captive  stream sup ports read ing.
  29394                     
  29395       </remarks>
  29396               
  29397      </member>
  29398              
  29399      <member 
  29400       name="P:Io nic.BZip2. BZip2Input Stream.Can Seek"
  29401      >
  29402                    
  29403       <summary>
  29404                     Indicate s whether  the stream  supports  Seek opera tions.
  29405                     
  29406       </summary>
  29407                    
  29408       <remarks>
  29409                     Always r eturns fal se.
  29410                     
  29411       </remarks>
  29412               
  29413      </member>
  29414              
  29415      <member 
  29416       name="P:Io nic.BZip2. BZip2Input Stream.Can Write"
  29417      >
  29418                    
  29419       <summary>
  29420                     Indicate s whether  the stream  can be wr itten.
  29421                     
  29422       </summary>
  29423                    
  29424       <remarks>
  29425                     The retu rn value d epends on  whether th e captive  stream sup ports writ ing.
  29426                     
  29427       </remarks>
  29428               
  29429      </member>
  29430              
  29431      <member 
  29432       name="P:Io nic.BZip2. BZip2Input Stream.Len gth"
  29433      >
  29434                    
  29435       <summary>
  29436                     Reading  this prope rty always  throws a 
  29437        <see 
  29438         cref="T:Sy stem.NotIm plementedE xception"
  29439        />
  29440        .
  29441                     
  29442       </summary>
  29443               
  29444      </member>
  29445              
  29446      <member 
  29447       name="P:Io nic.BZip2. BZip2Input Stream.Pos ition"
  29448      >
  29449                     
  29450       <summary>
  29451                      The pos ition of t he stream  pointer.
  29452                      
  29453       </summary>
  29454                    
  29455                     
  29456       <remarks>
  29457                        Setti ng this pr operty alw ays throws  a 
  29458        <see 
  29459         cref="T:Sy stem.NotIm plementedE xception"
  29460        />
  29461        . Reading  will retur n the
  29462                        total  number of  uncompres sed bytes  read in.
  29463                      
  29464       </remarks>
  29465               
  29466      </member>
  29467              
  29468      <member 
  29469       name="T:Io nic.BZip2. BZip2Input Stream.CSt ate"
  29470      >
  29471                    
  29472       <summary>
  29473                       Compre ssor State
  29474                     
  29475       </summary>
  29476               
  29477      </member>
  29478              
  29479      <member 
  29480       name="F:Io nic.BZip2. BZip2Input Stream.Dec ompression State.unzf tab"
  29481      >
  29482                    Freq tab le collect ed to save  a pass ov er the dat a during
  29483                    decompre ssion.
  29484               
  29485      </member>
  29486              
  29487      <member 
  29488       name="M:Io nic.BZip2. BZip2Input Stream.Dec ompression State.init TT(System. Int32)"
  29489      >
  29490                     Initial izes the t t array.
  29491                    
  29492                     This me thod is ca lled when  the requir ed length  of the arr ay is know n.
  29493                     I don't  initializ e it at co nstruction  time to a void unnec cessary
  29494                     memory  allocation  when comp ressing sm all files.
  29495               
  29496      </member>
  29497              
  29498      <member 
  29499       name="T:Io nic.BZip2. BZip2Outpu tStream"
  29500      >
  29501                    
  29502       <summary>
  29503                       A writ e-only dec orator str eam that c ompresses  data as it  is
  29504                       writte n using th e BZip2 al gorithm.
  29505                     
  29506       </summary>
  29507               
  29508      </member>
  29509              
  29510      <member 
  29511       name="M:Io nic.BZip2. BZip2Outpu tStream.#c tor(System .IO.Stream )"
  29512      >
  29513                     
  29514       <summary>
  29515                        Const ructs a ne
  29516        <c>
  29517         BZip2Outpu tStream
  29518        </c>
  29519        , that sen ds its
  29520                        compr essed outp ut to the  given outp ut stream.
  29521                      
  29522       </summary>
  29523                    
  29524                     
  29525       <param 
  29526        name='outp ut'
  29527       >
  29528                        The d estination  stream, t o which co mpressed o utput will  be sent.
  29529                      
  29530       </param>
  29531                    
  29532                     
  29533       <example>
  29534                     
  29535                        This  example re ads a file , then com presses it  with bzip 2 file,
  29536                        and w rites the  compressed  data into  a newly c reated fil e.
  29537                     
  29538                        
  29539        <code>
  29540                         var f name = "lo gfile.log" ;
  29541                         using  (var fs =  File.Open Read(fname ))
  29542                         {
  29543                             v ar outFnam e = fname  + ".bz2";
  29544                             u sing (var  output = F ile.Create (outFname) )
  29545                             {
  29546                                  using ( var compre ssor = new  Ionic.BZi p2.BZip2Ou tputStream (output))
  29547                                  {
  29548                                      byt e[] buffer  = new byt e[2048];
  29549                                      int  n;
  29550                                      whi le ((n = f s.Read(buf fer, 0, bu ffer.Lengt h)) > 0)
  29551                                      {
  29552                                           compresso r.Write(bu ffer, 0, n );
  29553                                      }
  29554                                  }
  29555                             }
  29556                         }
  29557                         
  29558        </code>
  29559                      
  29560       </example>
  29561               
  29562      </member>
  29563              
  29564      <member 
  29565       name="M:Io nic.BZip2. BZip2Outpu tStream.#c tor(System .IO.Stream ,System.In t32)"
  29566      >
  29567                    
  29568       <summary>
  29569                       Constr ucts a new  
  29570        <c>
  29571         BZip2Outpu tStream
  29572        </c>
  29573         with spec ified bloc ksize.
  29574                     
  29575       </summary>
  29576                    
  29577       <param 
  29578        name = "ou tput"
  29579       >
  29580        the destin ation stre am.
  29581       </param>
  29582                    
  29583       <param 
  29584        name = "bl ockSize"
  29585       >
  29586                       The bl ockSize in  units of  100000 byt es.
  29587                       The va lid range  is 1..9.
  29588                     
  29589       </param>
  29590               
  29591      </member>
  29592              
  29593      <member 
  29594       name="M:Io nic.BZip2. BZip2Outpu tStream.#c tor(System .IO.Stream ,System.Bo olean)"
  29595      >
  29596                    
  29597       <summary>
  29598                       Constr ucts a new  
  29599        <c>
  29600         BZip2Outpu tStream
  29601        </c>
  29602        .
  29603                     
  29604       </summary>
  29605                      
  29606       <param 
  29607        name = "ou tput"
  29608       >
  29609        the destin ation stre am.
  29610       </param>
  29611                    
  29612       <param 
  29613        name = "le aveOpen"
  29614       >
  29615                       whethe r to leave  the capti ve stream  open upon  closing th is stream.
  29616                     
  29617       </param>
  29618               
  29619      </member>
  29620              
  29621      <member 
  29622       name="M:Io nic.BZip2. BZip2Outpu tStream.#c tor(System .IO.Stream ,System.In t32,System .Boolean)"
  29623      >
  29624                     
  29625       <summary>
  29626                        Const ructs a ne
  29627        <c>
  29628         BZip2Outpu tStream
  29629        </c>
  29630         with spec ified bloc ksize,
  29631                        and e xplicitly  specifies  whether to  leave the  wrapped s tream open .
  29632                      
  29633       </summary>
  29634                    
  29635                     
  29636       <param 
  29637        name = "ou tput"
  29638       >
  29639        the destin ation stre am.
  29640       </param>
  29641                     
  29642       <param 
  29643        name = "bl ockSize"
  29644       >
  29645                        The b lockSize i n units of  100000 by tes.
  29646                        The v alid range  is 1..9.
  29647                      
  29648       </param>
  29649                     
  29650       <param 
  29651        name = "le aveOpen"
  29652       >
  29653                        wheth er to leav e the capt ive stream  open upon  closing t his stream .
  29654                      
  29655       </param>
  29656               
  29657      </member>
  29658              
  29659      <member 
  29660       name="M:Io nic.BZip2. BZip2Outpu tStream.Cl ose"
  29661      >
  29662                    
  29663       <summary>
  29664                       Close  the stream .
  29665                     
  29666       </summary>
  29667                    
  29668       <remarks>
  29669                       
  29670        <para>
  29671                          This  may or ma y not clos e the unde rlying str eam.  Chec k the
  29672                          cons tructors t hat accept  a bool va lue.
  29673                        
  29674        </para>
  29675                     
  29676       </remarks>
  29677               
  29678      </member>
  29679              
  29680      <member 
  29681       name="M:Io nic.BZip2. BZip2Outpu tStream.Fl ush"
  29682      >
  29683                    
  29684       <summary>
  29685                       Flush  the stream .
  29686                     
  29687       </summary>
  29688               
  29689      </member>
  29690              
  29691      <member 
  29692       name="M:Io nic.BZip2. BZip2Outpu tStream.Wr ite(System .Byte[],Sy stem.Int32 ,System.In t32)"
  29693      >
  29694                     
  29695       <summary>
  29696                        Write  data to t he stream.
  29697                      
  29698       </summary>
  29699                     
  29700       <remarks>
  29701                     
  29702                      
  29703        <para>
  29704                         Use t he 
  29705         <c>
  29706          BZip2Outpu tStream
  29707         </c>
  29708          to compre ss data wh ile writin g:
  29709                         creat e a 
  29710         <c>
  29711          BZip2Outpu tStream
  29712         </c>
  29713          with a wr itable out put stream .
  29714                         Then  call 
  29715         <c>
  29716          Write()
  29717         </c>
  29718          on that 
  29719         <c>
  29720          BZip2Outpu tStream
  29721         </c>
  29722         , providin g
  29723                         uncom pressed da ta as inpu t.  The da ta sent to  the outpu t stream w ill
  29724                         be th e compress ed form of  the input  data.
  29725                       
  29726        </para>
  29727                     
  29728                      
  29729        <para>
  29730                         A 
  29731         <c>
  29732          BZip2Outpu tStream
  29733         </c>
  29734          can be us ed only fo
  29735         <c>
  29736          Write()
  29737         </c>
  29738          not for 
  29739         <c>
  29740          Read()
  29741         </c>
  29742         .
  29743                       
  29744        </para>
  29745                     
  29746                      
  29747       </remarks>
  29748                    
  29749                     
  29750       <param 
  29751        name="buff er"
  29752       >
  29753        The buffer  holding d ata to wri te to the  stream.
  29754       </param>
  29755                     
  29756       <param 
  29757        name="offs et"
  29758       >
  29759        the offset  within th at data ar ray to fin d the firs t byte to  write.
  29760       </param>
  29761                     
  29762       <param 
  29763        name="coun t"
  29764       >
  29765        the number  of bytes  to write.
  29766       </param>
  29767               
  29768      </member>
  29769              
  29770      <member 
  29771       name="M:Io nic.BZip2. BZip2Outpu tStream.Se ek(System. Int64,Syst em.IO.Seek Origin)"
  29772      >
  29773                    
  29774       <summary>
  29775                     Calling  this metho d always t hrows a 
  29776        <see 
  29777         cref="T:Sy stem.NotIm plementedE xception"
  29778        />
  29779        .
  29780                     
  29781       </summary>
  29782                    
  29783       <param 
  29784        name="offs et"
  29785       >
  29786        this is ir relevant,  since it w ill always  throw!
  29787       </param>
  29788                    
  29789       <param 
  29790        name="orig in"
  29791       >
  29792        this is ir relevant,  since it w ill always  throw!
  29793       </param>
  29794                    
  29795       <returns>
  29796        irrelevant !
  29797       </returns>
  29798               
  29799      </member>
  29800              
  29801      <member 
  29802       name="M:Io nic.BZip2. BZip2Outpu tStream.Se tLength(Sy stem.Int64 )"
  29803      >
  29804                    
  29805       <summary>
  29806                     Calling  this metho d always t hrows a 
  29807        <see 
  29808         cref="T:Sy stem.NotIm plementedE xception"
  29809        />
  29810        .
  29811                     
  29812       </summary>
  29813                    
  29814       <param 
  29815        name="valu e"
  29816       >
  29817        this is ir relevant,  since it w ill always  throw!
  29818       </param>
  29819               
  29820      </member>
  29821              
  29822      <member 
  29823       name="M:Io nic.BZip2. BZip2Outpu tStream.Re ad(System. Byte[],Sys tem.Int32, System.Int 32)"
  29824      >
  29825                    
  29826       <summary>
  29827                       Callin g this met hod always  throws a 
  29828        <see 
  29829         cref="T:Sy stem.NotIm plementedE xception"
  29830        />
  29831        .
  29832                     
  29833       </summary>
  29834                    
  29835       <param 
  29836        name="buff er"
  29837       >
  29838        this param eter is ne ver used
  29839       </param>
  29840                    
  29841       <param 
  29842        name="offs et"
  29843       >
  29844        this param eter is ne ver used
  29845       </param>
  29846                    
  29847       <param 
  29848        name="coun t"
  29849       >
  29850        this param eter is ne ver used
  29851       </param>
  29852                    
  29853       <returns>
  29854        never retu rns anythi ng; always  throws
  29855       </returns>
  29856               
  29857      </member>
  29858              
  29859      <member 
  29860       name="P:Io nic.BZip2. BZip2Outpu tStream.Bl ockSize"
  29861      >
  29862                    
  29863       <summary>
  29864                       The bl ocksize pa rameter sp ecified at  construct ion time.
  29865                     
  29866       </summary>
  29867               
  29868      </member>
  29869              
  29870      <member 
  29871       name="P:Io nic.BZip2. BZip2Outpu tStream.Ca nRead"
  29872      >
  29873                    
  29874       <summary>
  29875                     Indicate s whether  the stream  can be re ad.
  29876                     
  29877       </summary>
  29878                    
  29879       <remarks>
  29880                     The retu rn value i s always f alse.
  29881                     
  29882       </remarks>
  29883               
  29884      </member>
  29885              
  29886      <member 
  29887       name="P:Io nic.BZip2. BZip2Outpu tStream.Ca nSeek"
  29888      >
  29889                    
  29890       <summary>
  29891                     Indicate s whether  the stream  supports  Seek opera tions.
  29892                     
  29893       </summary>
  29894                    
  29895       <remarks>
  29896                     Always r eturns fal se.
  29897                     
  29898       </remarks>
  29899               
  29900      </member>
  29901              
  29902      <member 
  29903       name="P:Io nic.BZip2. BZip2Outpu tStream.Ca nWrite"
  29904      >
  29905                    
  29906       <summary>
  29907                     Indicate s whether  the stream  can be wr itten.
  29908                     
  29909       </summary>
  29910                    
  29911       <remarks>
  29912                     The retu rn value s hould alwa ys be true , unless a nd until t he
  29913                     object i s disposed  and close d.
  29914                     
  29915       </remarks>
  29916               
  29917      </member>
  29918              
  29919      <member 
  29920       name="P:Io nic.BZip2. BZip2Outpu tStream.Le ngth"
  29921      >
  29922                    
  29923       <summary>
  29924                     Reading  this prope rty always  throws a 
  29925        <see 
  29926         cref="T:Sy stem.NotIm plementedE xception"
  29927        />
  29928        .
  29929                     
  29930       </summary>
  29931               
  29932      </member>
  29933              
  29934      <member 
  29935       name="P:Io nic.BZip2. BZip2Outpu tStream.Po sition"
  29936      >
  29937                     
  29938       <summary>
  29939                      The pos ition of t he stream  pointer.
  29940                      
  29941       </summary>
  29942                    
  29943                     
  29944       <remarks>
  29945                        Setti ng this pr operty alw ays throws  a 
  29946        <see 
  29947         cref="T:Sy stem.NotIm plementedE xception"
  29948        />
  29949        . Reading  will retur n the
  29950                        total  number of  uncompres sed bytes  written th rough.
  29951                      
  29952       </remarks>
  29953               
  29954      </member>
  29955              
  29956      <member 
  29957       name="T:Io nic.BZip2. ParallelBZ ip2OutputS tream"
  29958      >
  29959                     
  29960       <summary>
  29961                        A wri te-only de corator st ream that  compresses  data as i t is
  29962                        writt en using t he BZip2 a lgorithm.  This strea m compress es by
  29963                        block  using mul tiple thre ads.
  29964                      
  29965       </summary>
  29966                     
  29967       <para>
  29968                        This  class perf orms BZIP2  compressi on through  writing.   For
  29969                        more  informatio n on the B ZIP2 algor ithm, see
  29970                        
  29971        <see 
  29972         href="http ://en.wiki pedia.org/ wiki/BZIP2 "
  29973        />
  29974        .
  29975                      
  29976       </para>
  29977                    
  29978                     
  29979       <para>
  29980                        This  class is s imilar to 
  29981        <see 
  29982         cref="T:Io nic.BZip2. BZip2Outpu tStream"
  29983        />
  29984        ,
  29985                        excep t that thi s implemen tation use s an appro ach that e mploys mul tiple
  29986                        worke r threads  to perform  the compr ession.  O n a multi- cpu or mul ti-core
  29987                        compu ter, the p erformance  of this c lass can b e signific antly high er than
  29988                        the s ingle-thre aded BZip2 OutputStre am, partic ularly for  larger st reams.
  29989                        How l arge?  Any thing over  10mb is a  good cand idate for  parallel
  29990                        compr ession.
  29991                      
  29992       </para>
  29993                    
  29994                     
  29995       <para>
  29996                        The t radeoff is  that this  class use s more mem ory and mo re CPU tha n the
  29997                        vanil la 
  29998        <c>
  29999         BZip2Outpu tStream
  30000        </c>
  30001        . Also, fo r small fi les, the
  30002                        
  30003        <c>
  30004         ParallelBZ ip2OutputS tream
  30005        </c>
  30006         can be mu ch slower  than the v anilla
  30007                        
  30008        <c>
  30009         BZip2Outpu tStream
  30010        </c>
  30011        , because  of the ove rhead asso ciated to  using the
  30012                        threa d pool.
  30013                      
  30014       </para>
  30015                    
  30016                     
  30017       <seealso 
  30018        cref="T:Io nic.BZip2. BZip2Outpu tStream"
  30019       />
  30020               
  30021      </member>
  30022              
  30023      <member 
  30024       name="M:Io nic.BZip2. ParallelBZ ip2OutputS tream.#cto r(System.I O.Stream)"
  30025      >
  30026                     
  30027       <summary>
  30028                        Const ructs a ne
  30029        <c>
  30030         ParallelBZ ip2OutputS tream
  30031        </c>
  30032        , that sen ds its
  30033                        compr essed outp ut to the  given outp ut stream.
  30034                      
  30035       </summary>
  30036                    
  30037                     
  30038       <param 
  30039        name='outp ut'
  30040       >
  30041                        The d estination  stream, t o which co mpressed o utput will  be sent.
  30042                      
  30043       </param>
  30044                    
  30045                     
  30046       <example>
  30047                     
  30048                        This  example re ads a file , then com presses it  with bzip 2 file,
  30049                        and w rites the  compressed  data into  a newly c reated fil e.
  30050                     
  30051                        
  30052        <code>
  30053                         var f name = "lo gfile.log" ;
  30054                         using  (var fs =  File.Open Read(fname ))
  30055                         {
  30056                             v ar outFnam e = fname  + ".bz2";
  30057                             u sing (var  output = F ile.Create (outFname) )
  30058                             {
  30059                                  using ( var compre ssor = new  Ionic.BZi p2.Paralle lBZip2Outp utStream(o utput))
  30060                                  {
  30061                                      byt e[] buffer  = new byt e[2048];
  30062                                      int  n;
  30063                                      whi le ((n = f s.Read(buf fer, 0, bu ffer.Lengt h)) > 0)
  30064                                      {
  30065                                           compresso r.Write(bu ffer, 0, n );
  30066                                      }
  30067                                  }
  30068                             }
  30069                         }
  30070                         
  30071        </code>
  30072                      
  30073       </example>
  30074               
  30075      </member>
  30076              
  30077      <member 
  30078       name="M:Io nic.BZip2. ParallelBZ ip2OutputS tream.#cto r(System.I O.Stream,S ystem.Int3 2)"
  30079      >
  30080                    
  30081       <summary>
  30082                       Constr ucts a new  
  30083        <c>
  30084         ParallelBZ ip2OutputS tream
  30085        </c>
  30086         with spec ified bloc ksize.
  30087                     
  30088       </summary>
  30089                    
  30090       <param 
  30091        name = "ou tput"
  30092       >
  30093        the destin ation stre am.
  30094       </param>
  30095                    
  30096       <param 
  30097        name = "bl ockSize"
  30098       >
  30099                       The bl ockSize in  units of  100000 byt es.
  30100                       The va lid range  is 1..9.
  30101                     
  30102       </param>
  30103               
  30104      </member>
  30105              
  30106      <member 
  30107       name="M:Io nic.BZip2. ParallelBZ ip2OutputS tream.#cto r(System.I O.Stream,S ystem.Bool ean)"
  30108      >
  30109                    
  30110       <summary>
  30111                       Constr ucts a new  
  30112        <c>
  30113         ParallelBZ ip2OutputS tream
  30114        </c>
  30115        .
  30116                     
  30117       </summary>
  30118                      
  30119       <param 
  30120        name = "ou tput"
  30121       >
  30122        the destin ation stre am.
  30123       </param>
  30124                    
  30125       <param 
  30126        name = "le aveOpen"
  30127       >
  30128                       whethe r to leave  the capti ve stream  open upon  closing th is stream.
  30129                     
  30130       </param>
  30131               
  30132      </member>
  30133              
  30134      <member 
  30135       name="M:Io nic.BZip2. ParallelBZ ip2OutputS tream.#cto r(System.I O.Stream,S ystem.Int3 2,System.B oolean)"
  30136      >
  30137                     
  30138       <summary>
  30139                        Const ructs a ne
  30140        <c>
  30141         ParallelBZ ip2OutputS tream
  30142        </c>
  30143         with spec ified bloc ksize,
  30144                        and e xplicitly  specifies  whether to  leave the  wrapped s tream open .
  30145                      
  30146       </summary>
  30147                    
  30148                     
  30149       <param 
  30150        name = "ou tput"
  30151       >
  30152        the destin ation stre am.
  30153       </param>
  30154                     
  30155       <param 
  30156        name = "bl ockSize"
  30157       >
  30158                        The b lockSize i n units of  100000 by tes.
  30159                        The v alid range  is 1..9.
  30160                      
  30161       </param>
  30162                     
  30163       <param 
  30164        name = "le aveOpen"
  30165       >
  30166                        wheth er to leav e the capt ive stream  open upon  closing t his stream .
  30167                      
  30168       </param>
  30169               
  30170      </member>
  30171              
  30172      <member 
  30173       name="M:Io nic.BZip2. ParallelBZ ip2OutputS tream.Clos e"
  30174      >
  30175                    
  30176       <summary>
  30177                       Close  the stream .
  30178                     
  30179       </summary>
  30180                    
  30181       <remarks>
  30182                       
  30183        <para>
  30184                          This  may or ma y not clos e the unde rlying str eam.  Chec k the
  30185                          cons tructors t hat accept  a bool va lue.
  30186                        
  30187        </para>
  30188                     
  30189       </remarks>
  30190               
  30191      </member>
  30192              
  30193      <member 
  30194       name="M:Io nic.BZip2. ParallelBZ ip2OutputS tream.Flus h"
  30195      >
  30196                    
  30197       <summary>
  30198                       Flush  the stream .
  30199                     
  30200       </summary>
  30201               
  30202      </member>
  30203              
  30204      <member 
  30205       name="M:Io nic.BZip2. ParallelBZ ip2OutputS tream.Writ e(System.B yte[],Syst em.Int32,S ystem.Int3 2)"
  30206      >
  30207                     
  30208       <summary>
  30209                        Write  data to t he stream.
  30210                      
  30211       </summary>
  30212                     
  30213       <remarks>
  30214                     
  30215                      
  30216        <para>
  30217                         Use t he 
  30218         <c>
  30219          ParallelBZ ip2OutputS tream
  30220         </c>
  30221          to compre ss data wh ile
  30222                         writi ng: create  a 
  30223         <c>
  30224          ParallelBZ ip2OutputS tream
  30225         </c>
  30226          with a wr itable
  30227                         outpu t stream.   Then call  
  30228         <c>
  30229          Write()
  30230         </c>
  30231          on that
  30232                         
  30233         <c>
  30234          ParallelBZ ip2OutputS tream
  30235         </c>
  30236         , providin g uncompre ssed data  as
  30237                         input .  The dat a sent to  the output  stream wi ll be the  compressed
  30238                         form  of the inp ut data.
  30239                       
  30240        </para>
  30241                     
  30242                      
  30243        <para>
  30244                         A 
  30245         <c>
  30246          ParallelBZ ip2OutputS tream
  30247         </c>
  30248          can be us ed only fo r
  30249                         
  30250         <c>
  30251          Write()
  30252         </c>
  30253          not for 
  30254         <c>
  30255          Read()
  30256         </c>
  30257         .
  30258                       
  30259        </para>
  30260                     
  30261                      
  30262       </remarks>
  30263                    
  30264                     
  30265       <param 
  30266        name="buff er"
  30267       >
  30268        The buffer  holding d ata to wri te to the  stream.
  30269       </param>
  30270                     
  30271       <param 
  30272        name="offs et"
  30273       >
  30274        the offset  within th at data ar ray to fin d the firs t byte to  write.
  30275       </param>
  30276                     
  30277       <param 
  30278        name="coun t"
  30279       >
  30280        the number  of bytes  to write.
  30281       </param>
  30282               
  30283      </member>
  30284              
  30285      <member 
  30286       name="M:Io nic.BZip2. ParallelBZ ip2OutputS tream.Seek (System.In t64,System .IO.SeekOr igin)"
  30287      >
  30288                    
  30289       <summary>
  30290                     Calling  this metho d always t hrows a 
  30291        <see 
  30292         cref="T:Sy stem.NotIm plementedE xception"
  30293        />
  30294        .
  30295                     
  30296       </summary>
  30297                    
  30298       <param 
  30299        name="offs et"
  30300       >
  30301        this is ir relevant,  since it w ill always  throw!
  30302       </param>
  30303                    
  30304       <param 
  30305        name="orig in"
  30306       >
  30307        this is ir relevant,  since it w ill always  throw!
  30308       </param>
  30309                    
  30310       <returns>
  30311        irrelevant !
  30312       </returns>
  30313               
  30314      </member>
  30315              
  30316      <member 
  30317       name="M:Io nic.BZip2. ParallelBZ ip2OutputS tream.SetL ength(Syst em.Int64)"
  30318      >
  30319                    
  30320       <summary>
  30321                     Calling  this metho d always t hrows a 
  30322        <see 
  30323         cref="T:Sy stem.NotIm plementedE xception"
  30324        />
  30325        .
  30326                     
  30327       </summary>
  30328                    
  30329       <param 
  30330        name="valu e"
  30331       >
  30332        this is ir relevant,  since it w ill always  throw!
  30333       </param>
  30334               
  30335      </member>
  30336              
  30337      <member 
  30338       name="M:Io nic.BZip2. ParallelBZ ip2OutputS tream.Read (System.By te[],Syste m.Int32,Sy stem.Int32 )"
  30339      >
  30340                    
  30341       <summary>
  30342                     Calling  this metho d always t hrows a 
  30343        <see 
  30344         cref="T:Sy stem.NotIm plementedE xception"
  30345        />
  30346        .
  30347                     
  30348       </summary>
  30349                    
  30350       <param 
  30351        name="buff er"
  30352       >
  30353        this param eter is ne ver used
  30354       </param>
  30355                    
  30356       <param 
  30357        name="offs et"
  30358       >
  30359        this param eter is ne ver used
  30360       </param>
  30361                    
  30362       <param 
  30363        name="coun t"
  30364       >
  30365        this param eter is ne ver used
  30366       </param>
  30367                    
  30368       <returns>
  30369        never retu rns anythi ng; always  throws
  30370       </returns>
  30371               
  30372      </member>
  30373              
  30374      <member 
  30375       name="P:Io nic.BZip2. ParallelBZ ip2OutputS tream.MaxW orkers"
  30376      >
  30377                     
  30378       <summary>
  30379                        The m aximum num ber of con current co mpression  worker thr eads to us e.
  30380                      
  30381       </summary>
  30382                    
  30383                     
  30384       <remarks>
  30385                      
  30386        <para>
  30387                         This  property s ets an upp er limit o n the numb er of conc urrent wor ker
  30388                         threa ds to empl oy for com pression.  The implem entation o f this str eam
  30389                         emplo ys multipl e threads  from the . NET thread  pool, via  
  30390         <see 
  30391          cref="M:Sy stem.Threa ding.Threa dPool.Queu eUserWorkI tem(System .Threading .WaitCallb ack)"
  30392         >
  30393                          Threa dPool.Queu eUserWorkI tem()
  30394         </see>
  30395         , to compr ess the in coming dat a by
  30396                         block .  As each  block of  data is co mpressed,  this strea m re-order s the
  30397                         compr essed bloc ks and wri tes them t o the outp ut stream.
  30398                       
  30399        </para>
  30400                     
  30401                      
  30402        <para>
  30403                         A hig her number  of worker s enables  a higher d egree of
  30404                         paral lelism, wh ich tends  to increas e the spee d of compr ession on
  30405                         multi -cpu compu ters.  On  the other  hand, a hi gher numbe r of buffe r
  30406                         pairs  also impl ies a larg er memory  consumptio n, more ac tive worke r
  30407                         threa ds, and a  higher cpu  utilizati on for any  compressi on. This
  30408                         prope rty enable s the appl ication to  limit its  memory co nsumption  and
  30409                         CPU u tilization  behavior  depending  on require ments.
  30410                       
  30411        </para>
  30412                     
  30413                      
  30414        <para>
  30415                         By de fault, Dot NetZip all ocates 4 w orkers per  CPU core,  subject t o the
  30416                         upper  limit spe cified in  this prope rty. For e xample, su ppose the
  30417                         appli cation set s this pro perty to 1 6.  Then,  on a machi ne with 2
  30418                         cores , DotNetZi p will use  8 workers ; that num ber does n ot exceed  the
  30419                         upper  limit spe cified by  this prope rty, so th e actual n umber of
  30420                         worke rs used wi ll be 4 *  2 = 8.  On  a machine  with 4 co res, DotNe tZip
  30421                         will  use 16 wor kers; agai n, the lim it does no t apply. O n a machin e
  30422                         with  8 cores, D otNetZip w ill use 16  workers,  because of  the limit .
  30423                       
  30424        </para>
  30425                     
  30426                      
  30427        <para>
  30428                         For e ach compre ssion "wor ker thread " that occ urs in par allel, the re is
  30429                         up to  2mb of me mory alloc ated, for  buffering  and proces sing. The
  30430                         actua l number d epends on  the 
  30431         <see 
  30432          cref="P:Io nic.BZip2. ParallelBZ ip2OutputS tream.Bloc kSize"
  30433         />
  30434          property.
  30435                       
  30436        </para>
  30437                     
  30438                      
  30439        <para>
  30440                         CPU u tilization  will also  go up wit h addition al workers , because  a
  30441                         large r number o f buffer p airs allow s a larger  number of  backgroun d
  30442                         threa ds to comp ress in pa rallel. If  you find  that paral lel
  30443                         compr ession is  consuming  too much m emory or C PU, you ca n adjust t his
  30444                         value  downward.
  30445                       
  30446        </para>
  30447                     
  30448                      
  30449        <para>
  30450                         The d efault val ue is 16.  Different  values may  deliver b etter or
  30451                         worse  results,  depending  on your pr iorities a nd the dyn amic
  30452                         perfo rmance cha racteristi cs of your  storage a nd compute  resources .
  30453                       
  30454        </para>
  30455                     
  30456                      
  30457        <para>
  30458                         The a pplication  can set t his value  at any tim e, but it  is effecti ve
  30459                         only  before the  first cal l to Write (), which  is when th e buffers  are
  30460                         alloc ated.
  30461                       
  30462        </para>
  30463                      
  30464       </remarks>
  30465               
  30466      </member>
  30467              
  30468      <member 
  30469       name="P:Io nic.BZip2. ParallelBZ ip2OutputS tream.Bloc kSize"
  30470      >
  30471                    
  30472       <summary>
  30473                       The bl ocksize pa rameter sp ecified at  construct ion time.
  30474                     
  30475       </summary>
  30476               
  30477      </member>
  30478              
  30479      <member 
  30480       name="P:Io nic.BZip2. ParallelBZ ip2OutputS tream.CanR ead"
  30481      >
  30482                    
  30483       <summary>
  30484                     Indicate s whether  the stream  can be re ad.
  30485                     
  30486       </summary>
  30487                    
  30488       <remarks>
  30489                     The retu rn value i s always f alse.
  30490                     
  30491       </remarks>
  30492               
  30493      </member>
  30494              
  30495      <member 
  30496       name="P:Io nic.BZip2. ParallelBZ ip2OutputS tream.CanS eek"
  30497      >
  30498                    
  30499       <summary>
  30500                     Indicate s whether  the stream  supports  Seek opera tions.
  30501                     
  30502       </summary>
  30503                    
  30504       <remarks>
  30505                     Always r eturns fal se.
  30506                     
  30507       </remarks>
  30508               
  30509      </member>
  30510              
  30511      <member 
  30512       name="P:Io nic.BZip2. ParallelBZ ip2OutputS tream.CanW rite"
  30513      >
  30514                    
  30515       <summary>
  30516                     Indicate s whether  the stream  can be wr itten.
  30517                     
  30518       </summary>
  30519                    
  30520       <remarks>
  30521                     The retu rn value d epends on  whether th e captive  stream sup ports writ ing.
  30522                     
  30523       </remarks>
  30524               
  30525      </member>
  30526              
  30527      <member 
  30528       name="P:Io nic.BZip2. ParallelBZ ip2OutputS tream.Leng th"
  30529      >
  30530                    
  30531       <summary>
  30532                     Reading  this prope rty always  throws a 
  30533        <see 
  30534         cref="T:Sy stem.NotIm plementedE xception"
  30535        />
  30536        .
  30537                     
  30538       </summary>
  30539               
  30540      </member>
  30541              
  30542      <member 
  30543       name="P:Io nic.BZip2. ParallelBZ ip2OutputS tream.Posi tion"
  30544      >
  30545                     
  30546       <summary>
  30547                      The pos ition of t he stream  pointer.
  30548                      
  30549       </summary>
  30550                    
  30551                     
  30552       <remarks>
  30553                        Setti ng this pr operty alw ays throws  a 
  30554        <see 
  30555         cref="T:Sy stem.NotIm plementedE xception"
  30556        />
  30557        . Reading  will retur n the
  30558                        total  number of  uncompres sed bytes  written th rough.
  30559                      
  30560       </remarks>
  30561               
  30562      </member>
  30563              
  30564      <member 
  30565       name="P:Io nic.BZip2. ParallelBZ ip2OutputS tream.Byte sWrittenOu t"
  30566      >
  30567                    
  30568       <summary>
  30569                     The tota l number o f bytes wr itten out  by the str eam.
  30570                     
  30571       </summary>
  30572                    
  30573       <remarks>
  30574                     This val ue is mean ingful onl y after a  call to Cl ose().
  30575                     
  30576       </remarks>
  30577               
  30578      </member>
  30579              
  30580      <member 
  30581       name="M:Io nic.BZip2. Rand.Rnums (System.In t32)"
  30582      >
  30583                    
  30584       <summary>
  30585                       Return s the "ran dom" numbe r at a spe cific inde x.
  30586                     
  30587       </summary>
  30588                    
  30589       <param 
  30590        name='i'
  30591       >
  30592        the index
  30593       </param>
  30594                    
  30595       <returns>
  30596        the random  number
  30597       </returns>
  30598               
  30599      </member>
  30600              
  30601      <member 
  30602       name="T:Io nic.Zlib.D eflateStre am"
  30603      >
  30604                     
  30605       <summary>
  30606                      A class  for compr essing and  decompres sing strea ms using t he Deflate  algorithm .
  30607                      
  30608       </summary>
  30609                    
  30610                     
  30611       <remarks>
  30612                     
  30613                      
  30614        <para>
  30615                         The D eflateStre am is a 
  30616         <see 
  30617          href="http ://en.wiki pedia.org/ wiki/Decor ator_patte rn"
  30618         >
  30619          Decorator
  30620         </see>
  30621          on a 
  30622         <see 
  30623          cref="T:Sy stem.IO.St ream"
  30624         />
  30625         .  It adds  DEFLATE c ompression  or decomp ression to  any
  30626                         strea m.
  30627                       
  30628        </para>
  30629                     
  30630                      
  30631        <para>
  30632                         Using  this stre am, applic ations can  compress  or decompr ess data v ia stream
  30633                         
  30634         <c>
  30635          Read
  30636         </c>
  30637          and 
  30638         <c>
  30639          Write
  30640         </c>
  30641          operation s.  Either  compresss ion or dec ompression
  30642                         can o ccur throu gh either  reading or  writing.  The compre ssion form at used is
  30643                         DEFLA TE, which  is documen ted in 
  30644         <see 
  30645          href="http ://www.iet f.org/rfc/ rfc1951.tx t"
  30646         >
  30647          IETF RFC 1 951
  30648         </see>
  30649         , "DEFLATE
  30650                         Compr essed Data  Format Sp ecificatio n version  1.3.".
  30651                       
  30652        </para>
  30653                     
  30654                      
  30655        <para>
  30656                         This  class is s imilar to 
  30657         <see 
  30658          cref="T:Io nic.Zlib.Z libStream"
  30659         />
  30660         , except t hat
  30661                         
  30662         <c>
  30663          ZlibStream
  30664         </c>
  30665          adds the 
  30666         <see 
  30667          href="http ://www.iet f.org/rfc/ rfc1950.tx t"
  30668         >
  30669          RFC
  30670                          1950  - ZLIB
  30671         </see>
  30672          framing b ytes to a  compressed  stream wh en compres sing, or
  30673                         expec ts the RFC 1950 frami ng bytes w hen decomp ressing. T he 
  30674         <c>
  30675          DeflateStr eam
  30676         </c>
  30677                         does  not.
  30678                       
  30679        </para>
  30680                     
  30681                      
  30682       </remarks>
  30683                    
  30684                     
  30685       <seealso 
  30686        cref="T:Io nic.Zlib.Z libStream"
  30687       />
  30688                     
  30689       <seealso 
  30690        cref="T:Io nic.Zlib.G ZipStream"
  30691       />
  30692               
  30693      </member>
  30694              
  30695      <member 
  30696       name="M:Io nic.Zlib.D eflateStre am.#ctor(S ystem.IO.S tream,Ioni c.Zlib.Com pressionMo de)"
  30697      >
  30698                     
  30699       <summary>
  30700                        Creat e a Deflat eStream us ing the sp ecified Co mpressionM ode.
  30701                      
  30702       </summary>
  30703                    
  30704                     
  30705       <remarks>
  30706                        When  mode is 
  30707        <c>
  30708         Compressio nMode.Comp ress
  30709        </c>
  30710        , the Defl ateStream  will use
  30711                        the d efault com pression l evel. The  "captive"  stream wil l be close d when
  30712                        the D eflateStre am is clos ed.
  30713                      
  30714       </remarks>
  30715                    
  30716                     
  30717       <example>
  30718                      This ex ample uses  a Deflate Stream to  compress d ata from a  file, and  writes
  30719                      the com pressed da ta to anot her file.
  30720                      
  30721        <code>
  30722                       using ( System.IO. Stream inp ut = Syste m.IO.File. OpenRead(f ileToCompr ess))
  30723                       {
  30724                           usi ng (var ra w = System .IO.File.C reate(file ToCompress  + ".defla ted"))
  30725                           {
  30726                                using (St ream compr essor = ne w DeflateS tream(raw,  Compressi onMode.Com press))
  30727                                {
  30728                                    byte[ ] buffer =  new byte[ WORKING_BU FFER_SIZE] ;
  30729                                    int n ;
  30730                                    while  ((n= inpu t.Read(buf fer, 0, bu ffer.Lengt h)) != 0)
  30731                                    {
  30732                                        c ompressor. Write(buff er, 0, n);
  30733                                    }
  30734                                }
  30735                           }
  30736                       }
  30737                       
  30738        </code>
  30739                     
  30740                      
  30741        <code 
  30742         lang="VB"
  30743        >
  30744                       Using i nput As St ream = Fil e.OpenRead (fileToCom press)
  30745                           Usi ng raw As  FileStream  = File.Cr eate(fileT oCompress  &amp; ".de flated")
  30746                                Using com pressor As  Stream =  New Deflat eStream(ra w, Compres sionMode.C ompress)
  30747                                    Dim b uffer As B yte() = Ne w Byte(409 6) {}
  30748                                    Dim n  As Intege r = -1
  30749                                    Do Wh ile (n &lt ;&gt; 0)
  30750                                        I f (n &gt;  0) Then
  30751                                             compres sor.Write( buffer, 0,  n)
  30752                                        E nd If
  30753                                        n  = input.R ead(buffer , 0, buffe r.Length)
  30754                                    Loop
  30755                                End Using
  30756                           End  Using
  30757                       End Usi ng
  30758                       
  30759        </code>
  30760                      
  30761       </example>
  30762                     
  30763       <param 
  30764        name="stre am"
  30765       >
  30766        The stream  which wil l be read  or written .
  30767       </param>
  30768                     
  30769       <param 
  30770        name="mode "
  30771       >
  30772        Indicates  whether th e DeflateS tream will  compress  or decompr ess.
  30773       </param>
  30774               
  30775      </member>
  30776              
  30777      <member 
  30778       name="M:Io nic.Zlib.D eflateStre am.#ctor(S ystem.IO.S tream,Ioni c.Zlib.Com pressionMo de,Ionic.Z lib.Compre ssionLevel )"
  30779      >
  30780                     
  30781       <summary>
  30782                      Create  a DeflateS tream usin g the spec ified Comp ressionMod e and the  specified  Compressio nLevel.
  30783                      
  30784       </summary>
  30785                    
  30786                     
  30787       <remarks>
  30788                     
  30789                      
  30790        <para>
  30791                         When  mode is 
  30792         <c>
  30793          Compressio nMode.Deco mpress
  30794         </c>
  30795         , the leve l paramete r is
  30796                         ignor ed.  The " captive" s tream will  be closed  when the  DeflateStr eam is
  30797                         close d.
  30798                       
  30799        </para>
  30800                     
  30801                      
  30802       </remarks>
  30803                    
  30804                     
  30805       <example>
  30806                     
  30807                        This  example us es a Defla teStream t o compress  data from  a file, a nd writes
  30808                        the c ompressed  data to an other file .
  30809                     
  30810                      
  30811        <code>
  30812                       using ( System.IO. Stream inp ut = Syste m.IO.File. OpenRead(f ileToCompr ess))
  30813                       {
  30814                           usi ng (var ra w = System .IO.File.C reate(file ToCompress  + ".defla ted"))
  30815                           {
  30816                                using (St ream compr essor = ne w DeflateS tream(raw,
  30817                                                                                 Comp ressionMod e.Compress ,
  30818                                                                                 Comp ressionLev el.BestCom pression))
  30819                                {
  30820                                    byte[ ] buffer =  new byte[ WORKING_BU FFER_SIZE] ;
  30821                                    int n = -1;
  30822                                    while  (n != 0)
  30823                                    {
  30824                                        i f (n &gt;  0)
  30825                                             compres sor.Write( buffer, 0,  n);
  30826                                        n = input.Re ad(buffer,  0, buffer .Length);
  30827                                    }
  30828                                }
  30829                           }
  30830                       }
  30831                       
  30832        </code>
  30833                     
  30834                      
  30835        <code 
  30836         lang="VB"
  30837        >
  30838                       Using i nput As St ream = Fil e.OpenRead (fileToCom press)
  30839                           Usi ng raw As  FileStream  = File.Cr eate(fileT oCompress  &amp; ".de flated")
  30840                                Using com pressor As  Stream =  New Deflat eStream(ra w, Compres sionMode.C ompress, C ompression Level.Best Compressio n)
  30841                                    Dim b uffer As B yte() = Ne w Byte(409 6) {}
  30842                                    Dim n  As Intege r = -1
  30843                                    Do Wh ile (n &lt ;&gt; 0)
  30844                                        I f (n &gt;  0) Then
  30845                                             compres sor.Write( buffer, 0,  n)
  30846                                        E nd If
  30847                                        n  = input.R ead(buffer , 0, buffe r.Length)
  30848                                    Loop
  30849                                End Using
  30850                           End  Using
  30851                       End Usi ng
  30852                       
  30853        </code>
  30854                      
  30855       </example>
  30856                     
  30857       <param 
  30858        name="stre am"
  30859       >
  30860        The stream  to be rea d or writt en while d eflating o r inflatin g.
  30861       </param>
  30862                     
  30863       <param 
  30864        name="mode "
  30865       >
  30866        Indicates  whether th
  30867        <c>
  30868         DeflateStr eam
  30869        </c>
  30870         will comp ress or de compress.
  30871       </param>
  30872                     
  30873       <param 
  30874        name="leve l"
  30875       >
  30876        A tuning k nob to tra de speed f or effecti veness.
  30877       </param>
  30878               
  30879      </member>
  30880              
  30881      <member 
  30882       name="M:Io nic.Zlib.D eflateStre am.#ctor(S ystem.IO.S tream,Ioni c.Zlib.Com pressionMo de,System. Boolean)"
  30883      >
  30884                     
  30885       <summary>
  30886                        Creat e a 
  30887        <c>
  30888         DeflateStr eam
  30889        </c>
  30890         using the  specified
  30891                        
  30892        <c>
  30893         Compressio nMode
  30894        </c>
  30895        , and expl icitly spe cify wheth er the
  30896                        strea m should b e left ope n after De flation or  Inflation .
  30897                      
  30898       </summary>
  30899                    
  30900                     
  30901       <remarks>
  30902                     
  30903                      
  30904        <para>
  30905                         This  constructo r allows t he applica tion to re quest that  the capti ve stream
  30906                         remai n open aft er the def lation or  inflation  occurs.  B y default,  after
  30907                         
  30908         <c>
  30909          Close()
  30910         </c>
  30911          is called  on the st ream, the  captive st ream is al so
  30912                         close d. In some  cases thi s is not d esired, fo r example  if the str eam is a
  30913                         memor y stream t hat will b e re-read  after comp ression.   Specify tr ue for
  30914                         the 
  30915         <paramref 
  30916          name="leav eOpen"
  30917         />
  30918          parameter  to leave  the stream  open.
  30919                       
  30920        </para>
  30921                     
  30922                      
  30923        <para>
  30924                         The 
  30925         <c>
  30926          DeflateStr eam
  30927         </c>
  30928          will use  the defaul t compress ion level.
  30929                       
  30930        </para>
  30931                     
  30932                      
  30933        <para>
  30934                         See t he other o verloads o f this con structor f or example  code.
  30935                       
  30936        </para>
  30937                      
  30938       </remarks>
  30939                    
  30940                     
  30941       <param 
  30942        name="stre am"
  30943       >
  30944                        The s tream whic h will be  read or wr itten. Thi s is calle d the
  30945                        "capt ive" strea m in other  places in  this docu mentation.
  30946                      
  30947       </param>
  30948                    
  30949                     
  30950       <param 
  30951        name="mode "
  30952       >
  30953                        Indic ates wheth er the 
  30954        <c>
  30955         DeflateStr eam
  30956        </c>
  30957         will comp ress or de compress.
  30958                      
  30959       </param>
  30960                    
  30961                     
  30962       <param 
  30963        name="leav eOpen"
  30964       >
  30965        true if th e applicat ion would  like the s tream to
  30966                      remain  open after  inflation /deflation .
  30967       </param>
  30968               
  30969      </member>
  30970              
  30971      <member 
  30972       name="M:Io nic.Zlib.D eflateStre am.#ctor(S ystem.IO.S tream,Ioni c.Zlib.Com pressionMo de,Ionic.Z lib.Compre ssionLevel ,System.Bo olean)"
  30973      >
  30974                     
  30975       <summary>
  30976                        Creat e a 
  30977        <c>
  30978         DeflateStr eam
  30979        </c>
  30980         using the  specified  
  30981        <c>
  30982         Compressio nMode
  30983        </c>
  30984                        and t he specifi ed 
  30985        <c>
  30986         Compressio nLevel
  30987        </c>
  30988        , and expl icitly spe cify wheth er
  30989                        the s tream shou ld be left  open afte r Deflatio n or Infla tion.
  30990                      
  30991       </summary>
  30992                    
  30993                     
  30994       <remarks>
  30995                     
  30996                      
  30997        <para>
  30998                         When  mode is 
  30999         <c>
  31000          Compressio nMode.Deco mpress
  31001         </c>
  31002         , the leve l paramete r is ignor ed.
  31003                       
  31004        </para>
  31005                     
  31006                      
  31007        <para>
  31008                         This  constructo r allows t he applica tion to re quest that  the capti ve stream
  31009                         remai n open aft er the def lation or  inflation  occurs.  B y default,  after
  31010                         
  31011         <c>
  31012          Close()
  31013         </c>
  31014          is called  on the st ream, the  captive st ream is al so
  31015                         close d. In some  cases thi s is not d esired, fo r example  if the str eam is a
  31016                         
  31017         <see 
  31018          cref="T:Sy stem.IO.Me moryStream "
  31019         />
  31020          that will  be re-rea d after
  31021                         compr ession.  S pecify tru e for the 
  31022         <paramref 
  31023          name="leav eOpen"
  31024         />
  31025          parameter
  31026                         to le ave the st ream open.
  31027                       
  31028        </para>
  31029                     
  31030                      
  31031       </remarks>
  31032                    
  31033                     
  31034       <example>
  31035                     
  31036                        This  example sh ows how to  use a 
  31037        <c>
  31038         DeflateStr eam
  31039        </c>
  31040         to compre ss data fr om
  31041                        a fil e, and sto re the com pressed da ta into an other file .
  31042                     
  31043                      
  31044        <code>
  31045                       using ( var output  = System. IO.File.Cr eate(fileT oCompress  + ".deflat ed"))
  31046                       {
  31047                           usi ng (System .IO.Stream  input = S ystem.IO.F ile.OpenRe ad(fileToC ompress))
  31048                           {
  31049                                using (St ream compr essor = ne w DeflateS tream(outp ut, Compre ssionMode. Compress,  Compressio nLevel.Bes tCompressi on, true))
  31050                                {
  31051                                    byte[ ] buffer =  new byte[ WORKING_BU FFER_SIZE] ;
  31052                                    int n = -1;
  31053                                    while  (n != 0)
  31054                                    {
  31055                                        i f (n &gt;  0)
  31056                                             compres sor.Write( buffer, 0,  n);
  31057                                        n = input.Re ad(buffer,  0, buffer .Length);
  31058                                    }
  31059                                }
  31060                           }
  31061                           //  can write  additional  data to t he output  stream her e
  31062                       }
  31063                       
  31064        </code>
  31065                     
  31066                      
  31067        <code 
  31068         lang="VB"
  31069        >
  31070                       Using o utput As F ileStream  = File.Cre ate(fileTo Compress & amp; ".def lated")
  31071                           Usi ng input A s Stream =  File.Open Read(fileT oCompress)
  31072                                Using com pressor As  Stream =  New Deflat eStream(ou tput, Comp ressionMod e.Compress , Compress ionLevel.B estCompres sion, True )
  31073                                    Dim b uffer As B yte() = Ne w Byte(409 6) {}
  31074                                    Dim n  As Intege r = -1
  31075                                    Do Wh ile (n &lt ;&gt; 0)
  31076                                        I f (n &gt;  0) Then
  31077                                             compres sor.Write( buffer, 0,  n)
  31078                                        E nd If
  31079                                        n  = input.R ead(buffer , 0, buffe r.Length)
  31080                                    Loop
  31081                                End Using
  31082                           End  Using
  31083                           ' c an write a dditional  data to th e output s tream here .
  31084                       End Usi ng
  31085                       
  31086        </code>
  31087                      
  31088       </example>
  31089                     
  31090       <param 
  31091        name="stre am"
  31092       >
  31093        The stream  which wil l be read  or written .
  31094       </param>
  31095                     
  31096       <param 
  31097        name="mode "
  31098       >
  31099        Indicates  whether th e DeflateS tream will  compress  or decompr ess.
  31100       </param>
  31101                     
  31102       <param 
  31103        name="leav eOpen"
  31104       >
  31105        true if th e applicat ion would  like the s tream to r emain open  after inf lation/def lation.
  31106       </param>
  31107                     
  31108       <param 
  31109        name="leve l"
  31110       >
  31111        A tuning k nob to tra de speed f or effecti veness.
  31112       </param>
  31113               
  31114      </member>
  31115              
  31116      <member 
  31117       name="M:Io nic.Zlib.D eflateStre am.Dispose (System.Bo olean)"
  31118      >
  31119                    
  31120       <summary>
  31121                       Dispos e the stre am.
  31122                     
  31123       </summary>
  31124                    
  31125       <remarks>
  31126                       
  31127        <para>
  31128                          This  may or ma y not resu lt in a 
  31129         <c>
  31130          Close()
  31131         </c>
  31132          call on t he captive
  31133                          stre am.  See t he constru ctors that  have a 
  31134         <c>
  31135          leaveOpen
  31136         </c>
  31137          parameter
  31138                          for  more infor mation.
  31139                        
  31140        </para>
  31141                       
  31142        <para>
  31143                          Appl ication co de won't c all this c ode direct ly.  This  method may  be
  31144                          invo ked in two  distinct  scenarios.   If dispo sing == tr ue, the me thod
  31145                          has  been calle d directly  or indire ctly by a  user's cod e, for exa mple
  31146                          via  the public  Dispose()  method. I n this cas e, both ma naged and
  31147                          unma naged reso urces can  be referen ced and di sposed.  I f disposin g ==
  31148                          fals e, the met hod has be en called  by the run time from  inside the
  31149                          obje ct finaliz er and thi s method s hould not  reference  other obje cts;
  31150                          in t hat case o nly unmana ged resour ces must b e referenc ed or
  31151                          disp osed.
  31152                        
  31153        </para>
  31154                     
  31155       </remarks>
  31156                    
  31157       <param 
  31158        name="disp osing"
  31159       >
  31160                       true i f the Disp ose method  was invok ed by user  code.
  31161                     
  31162       </param>
  31163               
  31164      </member>
  31165              
  31166      <member 
  31167       name="M:Io nic.Zlib.D eflateStre am.Flush"
  31168      >
  31169                    
  31170       <summary>
  31171                     Flush th e stream.
  31172                     
  31173       </summary>
  31174               
  31175      </member>
  31176              
  31177      <member 
  31178       name="M:Io nic.Zlib.D eflateStre am.Read(Sy stem.Byte[ ],System.I nt32,Syste m.Int32)"
  31179      >
  31180                     
  31181       <summary>
  31182                      Read da ta from th e stream.
  31183                      
  31184       </summary>
  31185                     
  31186       <remarks>
  31187                     
  31188                      
  31189        <para>
  31190                         If yo u wish to  use the 
  31191         <c>
  31192          DeflateStr eam
  31193         </c>
  31194          to compre ss data wh ile
  31195                         readi ng, you ca n create a  
  31196         <c>
  31197          DeflateStr eam
  31198         </c>
  31199          with
  31200                         
  31201         <c>
  31202          Compressio nMode.Comp ress
  31203         </c>
  31204         , providin g an uncom pressed da ta stream.
  31205                         Then  call Read( ) on that 
  31206         <c>
  31207          DeflateStr eam
  31208         </c>
  31209         , and the  data read  will be
  31210                         compr essed as y ou read.   If you wis h to use t he 
  31211         <c>
  31212          DeflateStr eam
  31213         </c>
  31214          to
  31215                         decom press data  while rea ding, you  can create  a 
  31216         <c>
  31217          DeflateStr eam
  31218         </c>
  31219          with
  31220                         
  31221         <c>
  31222          Compressio nMode.Deco mpress
  31223         </c>
  31224         , providin g a readab le compres sed data
  31225                         strea m.  Then c all Read()  on that 
  31226         <c>
  31227          DeflateStr eam
  31228         </c>
  31229         , and the  data read
  31230                         will  be decompr essed as y ou read.
  31231                       
  31232        </para>
  31233                     
  31234                      
  31235        <para>
  31236                         A 
  31237         <c>
  31238          DeflateStr eam
  31239         </c>
  31240          can be us ed for 
  31241         <c>
  31242          Read()
  31243         </c>
  31244          or 
  31245         <c>
  31246          Write()
  31247         </c>
  31248         , but not  both.
  31249                       
  31250        </para>
  31251                     
  31252                      
  31253       </remarks>
  31254                     
  31255       <param 
  31256        name="buff er"
  31257       >
  31258        The buffer  into whic h the read  data shou ld be plac ed.
  31259       </param>
  31260                     
  31261       <param 
  31262        name="offs et"
  31263       >
  31264        the offset  within th at data ar ray to put  the first  byte read .
  31265       </param>
  31266                     
  31267       <param 
  31268        name="coun t"
  31269       >
  31270        the number  of bytes  to read.
  31271       </param>
  31272                     
  31273       <returns>
  31274        the number  of bytes  actually r ead
  31275       </returns>
  31276               
  31277      </member>
  31278              
  31279      <member 
  31280       name="M:Io nic.Zlib.D eflateStre am.Seek(Sy stem.Int64 ,System.IO .SeekOrigi n)"
  31281      >
  31282                    
  31283       <summary>
  31284                     Calling  this metho d always t hrows a 
  31285        <see 
  31286         cref="T:Sy stem.NotIm plementedE xception"
  31287        />
  31288        .
  31289                     
  31290       </summary>
  31291                    
  31292       <param 
  31293        name="offs et"
  31294       >
  31295        this is ir relevant,  since it w ill always  throw!
  31296       </param>
  31297                    
  31298       <param 
  31299        name="orig in"
  31300       >
  31301        this is ir relevant,  since it w ill always  throw!
  31302       </param>
  31303                    
  31304       <returns>
  31305        irrelevant !
  31306       </returns>
  31307               
  31308      </member>
  31309              
  31310      <member 
  31311       name="M:Io nic.Zlib.D eflateStre am.SetLeng th(System. Int64)"
  31312      >
  31313                    
  31314       <summary>
  31315                     Calling  this metho d always t hrows a 
  31316        <see 
  31317         cref="T:Sy stem.NotIm plementedE xception"
  31318        />
  31319        .
  31320                     
  31321       </summary>
  31322                    
  31323       <param 
  31324        name="valu e"
  31325       >
  31326        this is ir relevant,  since it w ill always  throw!
  31327       </param>
  31328               
  31329      </member>
  31330              
  31331      <member 
  31332       name="M:Io nic.Zlib.D eflateStre am.Write(S ystem.Byte [],System. Int32,Syst em.Int32)"
  31333      >
  31334                     
  31335       <summary>
  31336                        Write  data to t he stream.
  31337                      
  31338       </summary>
  31339                     
  31340       <remarks>
  31341                     
  31342                      
  31343        <para>
  31344                         If yo u wish to  use the 
  31345         <c>
  31346          DeflateStr eam
  31347         </c>
  31348          to compre ss data wh ile
  31349                         writi ng, you ca n create a  
  31350         <c>
  31351          DeflateStr eam
  31352         </c>
  31353          with
  31354                         
  31355         <c>
  31356          Compressio nMode.Comp ress
  31357         </c>
  31358         , and a wr itable out put stream .  Then ca ll
  31359                         
  31360         <c>
  31361          Write()
  31362         </c>
  31363          on that 
  31364         <c>
  31365          DeflateStr eam
  31366         </c>
  31367         , providin g uncompre ssed data
  31368                         as in put.  The  data sent  to the out put stream  will be t he compres sed form
  31369                         of th e data wri tten.  If  you wish t o use the 
  31370         <c>
  31371          DeflateStr eam
  31372         </c>
  31373          to
  31374                         decom press data  while wri ting, you  can create  a 
  31375         <c>
  31376          DeflateStr eam
  31377         </c>
  31378          with
  31379                         
  31380         <c>
  31381          Compressio nMode.Deco mpress
  31382         </c>
  31383         , and a wr itable out put stream .  Then
  31384                         call 
  31385         <c>
  31386          Write()
  31387         </c>
  31388          on that s tream, pro viding pre viously co mpressed
  31389                         data.  The data  sent to th e output s tream will  be the de compressed  form of
  31390                         the d ata writte n.
  31391                       
  31392        </para>
  31393                     
  31394                      
  31395        <para>
  31396                         A 
  31397         <c>
  31398          DeflateStr eam
  31399         </c>
  31400          can be us ed for 
  31401         <c>
  31402          Read()
  31403         </c>
  31404          or 
  31405         <c>
  31406          Write()
  31407         </c>
  31408         ,
  31409                         but n ot both.
  31410                       
  31411        </para>
  31412                     
  31413                      
  31414       </remarks>
  31415                    
  31416                     
  31417       <param 
  31418        name="buff er"
  31419       >
  31420        The buffer  holding d ata to wri te to the  stream.
  31421       </param>
  31422                     
  31423       <param 
  31424        name="offs et"
  31425       >
  31426        the offset  within th at data ar ray to fin d the firs t byte to  write.
  31427       </param>
  31428                     
  31429       <param 
  31430        name="coun t"
  31431       >
  31432        the number  of bytes  to write.
  31433       </param>
  31434               
  31435      </member>
  31436              
  31437      <member 
  31438       name="M:Io nic.Zlib.D eflateStre am.Compres sString(Sy stem.Strin g)"
  31439      >
  31440                     
  31441       <summary>
  31442                        Compr ess a stri ng into a  byte array  using DEF LATE (RFC  1951).
  31443                      
  31444       </summary>
  31445                    
  31446                     
  31447       <remarks>
  31448                        Uncom press it w ith 
  31449        <see 
  31450         cref="M:Io nic.Zlib.D eflateStre am.Uncompr essString( System.Byt e[])"
  31451        />
  31452        .
  31453                      
  31454       </remarks>
  31455                    
  31456                     
  31457       <seealso 
  31458        cref="M:Io nic.Zlib.D eflateStre am.Uncompr essString( System.Byt e[])"
  31459       >
  31460        DeflateStr eam.Uncomp ressString (byte[])
  31461       </seealso>
  31462                     
  31463       <seealso 
  31464        cref="M:Io nic.Zlib.D eflateStre am.Compres sBuffer(Sy stem.Byte[ ])"
  31465       >
  31466        DeflateStr eam.Compre ssBuffer(b yte[])
  31467       </seealso>
  31468                     
  31469       <seealso 
  31470        cref="M:Io nic.Zlib.G ZipStream. CompressSt ring(Syste m.String)"
  31471       >
  31472        GZipStream .CompressS tring(stri ng)
  31473       </seealso>
  31474                     
  31475       <seealso 
  31476        cref="M:Io nic.Zlib.Z libStream. CompressSt ring(Syste m.String)"
  31477       >
  31478        ZlibStream .CompressS tring(stri ng)
  31479       </seealso>
  31480                    
  31481                     
  31482       <param 
  31483        name="s"
  31484       >
  31485                        A str ing to com press. The  string wi ll first b e encoded
  31486                        using  UTF8, the n compress ed.
  31487                      
  31488       </param>
  31489                    
  31490                     
  31491       <returns>
  31492        The string  in compre ssed form
  31493       </returns>
  31494               
  31495      </member>
  31496              
  31497      <member 
  31498       name="M:Io nic.Zlib.D eflateStre am.Compres sBuffer(Sy stem.Byte[ ])"
  31499      >
  31500                     
  31501       <summary>
  31502                        Compr ess a byte  array int o a new by te array u sing DEFLA TE.
  31503                      
  31504       </summary>
  31505                    
  31506                     
  31507       <remarks>
  31508                        Uncom press it w ith 
  31509        <see 
  31510         cref="M:Io nic.Zlib.D eflateStre am.Uncompr essBuffer( System.Byt e[])"
  31511        />
  31512        .
  31513                      
  31514       </remarks>
  31515                    
  31516                     
  31517       <seealso 
  31518        cref="M:Io nic.Zlib.D eflateStre am.Compres sString(Sy stem.Strin g)"
  31519       >
  31520        DeflateStr eam.Compre ssString(s tring)
  31521       </seealso>
  31522                     
  31523       <seealso 
  31524        cref="M:Io nic.Zlib.D eflateStre am.Uncompr essBuffer( System.Byt e[])"
  31525       >
  31526        DeflateStr eam.Uncomp ressBuffer (byte[])
  31527       </seealso>
  31528                     
  31529       <seealso 
  31530        cref="M:Io nic.Zlib.G ZipStream. CompressBu ffer(Syste m.Byte[])"
  31531       >
  31532        GZipStream .CompressB uffer(byte [])
  31533       </seealso>
  31534                     
  31535       <seealso 
  31536        cref="M:Io nic.Zlib.Z libStream. CompressBu ffer(Syste m.Byte[])"
  31537       >
  31538        ZlibStream .CompressB uffer(byte [])
  31539       </seealso>
  31540                    
  31541                     
  31542       <param 
  31543        name="b"
  31544       >
  31545                        A buf fer to com press.
  31546                      
  31547       </param>
  31548                    
  31549                     
  31550       <returns>
  31551        The data i n compress ed form
  31552       </returns>
  31553               
  31554      </member>
  31555              
  31556      <member 
  31557       name="M:Io nic.Zlib.D eflateStre am.Uncompr essString( System.Byt e[])"
  31558      >
  31559                     
  31560       <summary>
  31561                        Uncom press a DE FLATE'd by te array i nto a sing le string.
  31562                      
  31563       </summary>
  31564                    
  31565                     
  31566       <seealso 
  31567        cref="M:Io nic.Zlib.D eflateStre am.Compres sString(Sy stem.Strin g)"
  31568       >
  31569        DeflateStr eam.Compre ssString(S tring)
  31570       </seealso>
  31571                     
  31572       <seealso 
  31573        cref="M:Io nic.Zlib.D eflateStre am.Uncompr essBuffer( System.Byt e[])"
  31574       >
  31575        DeflateStr eam.Uncomp ressBuffer (byte[])
  31576       </seealso>
  31577                     
  31578       <seealso 
  31579        cref="M:Io nic.Zlib.G ZipStream. Uncompress String(Sys tem.Byte[] )"
  31580       >
  31581        GZipStream .Uncompres sString(by te[])
  31582       </seealso>
  31583                     
  31584       <seealso 
  31585        cref="M:Io nic.Zlib.Z libStream. Uncompress String(Sys tem.Byte[] )"
  31586       >
  31587        ZlibStream .Uncompres sString(by te[])
  31588       </seealso>
  31589                    
  31590                     
  31591       <param 
  31592        name="comp ressed"
  31593       >
  31594                        A buf fer contai ning DEFLA TE-compres sed data.
  31595                      
  31596       </param>
  31597                    
  31598                     
  31599       <returns>
  31600        The uncomp ressed str ing
  31601       </returns>
  31602               
  31603      </member>
  31604              
  31605      <member 
  31606       name="M:Io nic.Zlib.D eflateStre am.Uncompr essBuffer( System.Byt e[])"
  31607      >
  31608                     
  31609       <summary>
  31610                        Uncom press a DE FLATE'd by te array i nto a byte  array.
  31611                      
  31612       </summary>
  31613                    
  31614                     
  31615       <seealso 
  31616        cref="M:Io nic.Zlib.D eflateStre am.Compres sBuffer(Sy stem.Byte[ ])"
  31617       >
  31618        DeflateStr eam.Compre ssBuffer(b yte[])
  31619       </seealso>
  31620                     
  31621       <seealso 
  31622        cref="M:Io nic.Zlib.D eflateStre am.Uncompr essString( System.Byt e[])"
  31623       >
  31624        DeflateStr eam.Uncomp ressString (byte[])
  31625       </seealso>
  31626                     
  31627       <seealso 
  31628        cref="M:Io nic.Zlib.G ZipStream. Uncompress Buffer(Sys tem.Byte[] )"
  31629       >
  31630        GZipStream .Uncompres sBuffer(by te[])
  31631       </seealso>
  31632                     
  31633       <seealso 
  31634        cref="M:Io nic.Zlib.Z libStream. Uncompress Buffer(Sys tem.Byte[] )"
  31635       >
  31636        ZlibStream .Uncompres sBuffer(by te[])
  31637       </seealso>
  31638                    
  31639                     
  31640       <param 
  31641        name="comp ressed"
  31642       >
  31643                        A buf fer contai ning data  that has b een compre ssed with  DEFLATE.
  31644                      
  31645       </param>
  31646                    
  31647                     
  31648       <returns>
  31649        The data i n uncompre ssed form
  31650       </returns>
  31651               
  31652      </member>
  31653              
  31654      <member 
  31655       name="P:Io nic.Zlib.D eflateStre am.FlushMo de"
  31656      >
  31657                    
  31658       <summary>
  31659                     This pro perty sets  the flush  behavior  on the str eam.
  31660                     
  31661       </summary>
  31662                    
  31663       <remarks>
  31664         See the Z LIB docume ntation fo r the mean ing of the  flush beh avior.
  31665                     
  31666       </remarks>
  31667               
  31668      </member>
  31669              
  31670      <member 
  31671       name="P:Io nic.Zlib.D eflateStre am.BufferS ize"
  31672      >
  31673                     
  31674       <summary>
  31675                        The s ize of the  working b uffer for  the compre ssion code c.
  31676                      
  31677       </summary>
  31678                    
  31679                     
  31680       <remarks>
  31681                      
  31682        <para>
  31683                         The w orking buf fer is use d for all  stream ope rations.   The defaul t size is
  31684                         1024  bytes.  Th e minimum  size is 12 8 bytes. Y ou may get  better pe rformance
  31685                         with  a larger b uffer.  Th en again,  you might  not.  You  would have  to test
  31686                         it.
  31687                       
  31688        </para>
  31689                     
  31690                      
  31691        <para>
  31692                         Set t his before  the first  call to 
  31693         <c>
  31694          Read()
  31695         </c>
  31696          or 
  31697         <c>
  31698          Write()
  31699         </c>
  31700          on the
  31701                         strea m. If you  try to set  it afterw ards, it w ill throw.
  31702                       
  31703        </para>
  31704                      
  31705       </remarks>
  31706               
  31707      </member>
  31708              
  31709      <member 
  31710       name="P:Io nic.Zlib.D eflateStre am.Strateg y"
  31711      >
  31712                     
  31713       <summary>
  31714                        The Z LIB strate gy to be u sed during  compressi on.
  31715                      
  31716       </summary>
  31717                    
  31718                     
  31719       <remarks>
  31720                        By tw eaking thi s paramete r, you may  be able t o optimize  the compr ession for
  31721                        data  with parti cular char acteristic s.
  31722                      
  31723       </remarks>
  31724               
  31725      </member>
  31726              
  31727      <member 
  31728       name="P:Io nic.Zlib.D eflateStre am.TotalIn "
  31729      >
  31730                    
  31731       <summary>
  31732         Returns t he total n umber of b ytes input  so far.
  31733       </summary>
  31734               
  31735      </member>
  31736              
  31737      <member 
  31738       name="P:Io nic.Zlib.D eflateStre am.TotalOu t"
  31739      >
  31740                    
  31741       <summary>
  31742         Returns t he total n umber of b ytes outpu t so far.
  31743       </summary>
  31744               
  31745      </member>
  31746              
  31747      <member 
  31748       name="P:Io nic.Zlib.D eflateStre am.CanRead "
  31749      >
  31750                    
  31751       <summary>
  31752                     Indicate s whether  the stream  can be re ad.
  31753                     
  31754       </summary>
  31755                    
  31756       <remarks>
  31757                     The retu rn value d epends on  whether th e captive  stream sup ports read ing.
  31758                     
  31759       </remarks>
  31760               
  31761      </member>
  31762              
  31763      <member 
  31764       name="P:Io nic.Zlib.D eflateStre am.CanSeek "
  31765      >
  31766                    
  31767       <summary>
  31768                     Indicate s whether  the stream  supports  Seek opera tions.
  31769                     
  31770       </summary>
  31771                    
  31772       <remarks>
  31773                     Always r eturns fal se.
  31774                     
  31775       </remarks>
  31776               
  31777      </member>
  31778              
  31779      <member 
  31780       name="P:Io nic.Zlib.D eflateStre am.CanWrit e"
  31781      >
  31782                    
  31783       <summary>
  31784                     Indicate s whether  the stream  can be wr itten.
  31785                     
  31786       </summary>
  31787                    
  31788       <remarks>
  31789                     The retu rn value d epends on  whether th e captive  stream sup ports writ ing.
  31790                     
  31791       </remarks>
  31792               
  31793      </member>
  31794              
  31795      <member 
  31796       name="P:Io nic.Zlib.D eflateStre am.Length"
  31797      >
  31798                    
  31799       <summary>
  31800                     Reading  this prope rty always  throws a 
  31801        <see 
  31802         cref="T:Sy stem.NotIm plementedE xception"
  31803        />
  31804        .
  31805                     
  31806       </summary>
  31807               
  31808      </member>
  31809              
  31810      <member 
  31811       name="P:Io nic.Zlib.D eflateStre am.Positio n"
  31812      >
  31813                     
  31814       <summary>
  31815                      The pos ition of t he stream  pointer.
  31816                      
  31817       </summary>
  31818                    
  31819                     
  31820       <remarks>
  31821                        Setti ng this pr operty alw ays throws  a 
  31822        <see 
  31823         cref="T:Sy stem.NotIm plementedE xception"
  31824        />
  31825        . Reading  will retur n the tota l bytes
  31826                        writt en out, if  used in w riting, or  the total  bytes rea d in, if u sed in
  31827                        readi ng.  The c ount may r efer to co mpressed b ytes or un compressed  bytes,
  31828                        depen ding on ho w you've u sed the st ream.
  31829                      
  31830       </remarks>
  31831               
  31832      </member>
  31833              
  31834      <member 
  31835       name="T:Io nic.Zlib.G ZipStream"
  31836      >
  31837                     
  31838       <summary>
  31839                        A cla ss for com pressing a nd decompr essing GZI P streams.
  31840                      
  31841       </summary>
  31842                     
  31843       <remarks>
  31844                     
  31845                      
  31846        <para>
  31847                         The 
  31848         <c>
  31849          GZipStream
  31850         </c>
  31851          is a 
  31852         <see 
  31853          href="http ://en.wiki pedia.org/ wiki/Decor ator_patte rn"
  31854         >
  31855          Decorator
  31856         </see>
  31857          on a
  31858                         
  31859         <see 
  31860          cref="T:Sy stem.IO.St ream"
  31861         />
  31862         . It adds  GZIP compr ession or  decompress ion to any
  31863                         strea m.
  31864                       
  31865        </para>
  31866                     
  31867                      
  31868        <para>
  31869                         Like  the 
  31870         <c>
  31871          System.IO. Compressio n.GZipStre am
  31872         </c>
  31873          in the .N ET Base Cl ass Librar y, the
  31874                         
  31875         <c>
  31876          Ionic.Zlib .GZipStrea m
  31877         </c>
  31878          can compr ess while  writing, o r decompre ss while
  31879                         readi ng, but no t vice ver sa.  The c ompression  method us ed is GZIP , which is
  31880                         docum ented in 
  31881         <see 
  31882          href="http ://www.iet f.org/rfc/ rfc1952.tx t"
  31883         >
  31884          IETF RFC
  31885                          1952
  31886         </see>
  31887         , "GZIP fi le format  specificat ion versio n 4.3".
  31888        </para>
  31889                     
  31890                      
  31891        <para>
  31892                         A 
  31893         <c>
  31894          GZipStream
  31895         </c>
  31896          can be us ed to deco mpress dat a (through  
  31897         <c>
  31898          Read()
  31899         </c>
  31900         ) or
  31901                         to co mpress dat a (through  
  31902         <c>
  31903          Write()
  31904         </c>
  31905         ), but not  both.
  31906                       
  31907        </para>
  31908                     
  31909                      
  31910        <para>
  31911                         If yo u wish to  use the 
  31912         <c>
  31913          GZipStream
  31914         </c>
  31915          to compre ss data, y ou must wr ap it
  31916                         aroun d a write- able strea m. As you  call 
  31917         <c>
  31918          Write()
  31919         </c>
  31920          on the 
  31921         <c>
  31922          GZipStream
  31923         </c>
  31924         , the
  31925                         data  will be co mpressed i nto the GZ IP format.   If you w ant to dec ompress da ta,
  31926                         you m ust wrap t he 
  31927         <c>
  31928          GZipStream
  31929         </c>
  31930          around a  readable s tream that  contains  an
  31931                         IETF  RFC 1952-c ompliant s tream.  Th e data wil l be decom pressed as  you call
  31932                         
  31933         <c>
  31934          Read()
  31935         </c>
  31936          on the 
  31937         <c>
  31938          GZipStream
  31939         </c>
  31940         .
  31941                       
  31942        </para>
  31943                     
  31944                      
  31945        <para>
  31946                         Thoug h the GZIP  format al lows data  from multi ple files  to be conc atenated
  31947                         toget her, this  stream han dles only  a single s egment of  GZIP forma t, typical ly
  31948                         repre senting a  single fil e.
  31949                       
  31950        </para>
  31951                     
  31952                      
  31953        <para>
  31954                         This  class is s imilar to 
  31955         <see 
  31956          cref="T:Io nic.Zlib.Z libStream"
  31957         />
  31958          and 
  31959         <see 
  31960          cref="T:Io nic.Zlib.D eflateStre am"
  31961         />
  31962         .
  31963                         
  31964         <c>
  31965          ZlibStream
  31966         </c>
  31967          handles R FC1950-com pliant str eams.  
  31968         <see 
  31969          cref="T:Io nic.Zlib.D eflateStre am"
  31970         />
  31971                         handl es RFC1951 -compliant  streams.  This class  handles R FC1952-com pliant str eams.
  31972                       
  31973        </para>
  31974                     
  31975                      
  31976       </remarks>
  31977                    
  31978                     
  31979       <seealso 
  31980        cref="T:Io nic.Zlib.D eflateStre am"
  31981       />
  31982                     
  31983       <seealso 
  31984        cref="T:Io nic.Zlib.Z libStream"
  31985       />
  31986               
  31987      </member>
  31988              
  31989      <member 
  31990       name="F:Io nic.Zlib.G ZipStream. LastModifi ed"
  31991      >
  31992                     
  31993       <summary>
  31994                        The l ast modifi ed time fo r the GZIP  stream.
  31995                      
  31996       </summary>
  31997                    
  31998                     
  31999       <remarks>
  32000                        GZIP  allows the  storage o f a last m odified ti me with ea ch GZIP en try.
  32001                        When  compressin g data, yo u can set  this befor e the firs t call to
  32002                        
  32003        <c>
  32004         Write()
  32005        </c>
  32006        .  When de compressin g, you can  retrieve  this value  any time
  32007                        after  the first  call to 
  32008        <c>
  32009         Read()
  32010        </c>
  32011        .
  32012                      
  32013       </remarks>
  32014               
  32015      </member>
  32016              
  32017      <member 
  32018       name="M:Io nic.Zlib.G ZipStream. #ctor(Syst em.IO.Stre am,Ionic.Z lib.Compre ssionMode) "
  32019      >
  32020                     
  32021       <summary>
  32022                        Creat e a 
  32023        <c>
  32024         GZipStream
  32025        </c>
  32026         using the  specified  
  32027        <c>
  32028         Compressio nMode
  32029        </c>
  32030        .
  32031                      
  32032       </summary>
  32033                     
  32034       <remarks>
  32035                     
  32036                      
  32037        <para>
  32038                         When  mode is 
  32039         <c>
  32040          Compressio nMode.Comp ress
  32041         </c>
  32042         , the 
  32043         <c>
  32044          GZipStream
  32045         </c>
  32046          will use  the
  32047                         defau lt compres sion level .
  32048                       
  32049        </para>
  32050                     
  32051                      
  32052        <para>
  32053                         As no ted in the  class doc umentation , the 
  32054         <c>
  32055          Compressio nMode
  32056         </c>
  32057          (Compress
  32058                         or De compress)  also estab lishes the  "directio n" of the  stream.  A
  32059                         
  32060         <c>
  32061          GZipStream
  32062         </c>
  32063          with 
  32064         <c>
  32065          Compressio nMode.Comp ress
  32066         </c>
  32067          works onl y through
  32068                         
  32069         <c>
  32070          Write()
  32071         </c>
  32072         .  A 
  32073         <c>
  32074          GZipStream
  32075         </c>
  32076          with
  32077                         
  32078         <c>
  32079          Compressio nMode.Deco mpress
  32080         </c>
  32081          works onl y through 
  32082         <c>
  32083          Read()
  32084         </c>
  32085         .
  32086                       
  32087        </para>
  32088                     
  32089                      
  32090       </remarks>
  32091                    
  32092                     
  32093       <example>
  32094                        This  example sh ows how to  use a GZi pStream to  compress  data.
  32095                      
  32096        <code>
  32097                       using ( System.IO. Stream inp ut = Syste m.IO.File. OpenRead(f ileToCompr ess))
  32098                       {
  32099                           usi ng (var ra w = System .IO.File.C reate(outp utFile))
  32100                           {
  32101                                using (St ream compr essor = ne w GZipStre am(raw, Co mpressionM ode.Compre ss))
  32102                                {
  32103                                    byte[ ] buffer =  new byte[ WORKING_BU FFER_SIZE] ;
  32104                                    int n ;
  32105                                    while  ((n= inpu t.Read(buf fer, 0, bu ffer.Lengt h)) != 0)
  32106                                    {
  32107                                        c ompressor. Write(buff er, 0, n);
  32108                                    }
  32109                                }
  32110                           }
  32111                       }
  32112                       
  32113        </code>
  32114                      
  32115        <code 
  32116         lang="VB"
  32117        >
  32118                       Dim out putFile As  String =  (fileToCom press &amp ; ".compre ssed")
  32119                       Using i nput As St ream = Fil e.OpenRead (fileToCom press)
  32120                           Usi ng raw As  FileStream  = File.Cr eate(outpu tFile)
  32121                           Usi ng compres sor As Str eam = New  GZipStream (raw, Comp ressionMod e.Compress )
  32122                                Dim buffe r As Byte( ) = New By te(4096) { }
  32123                                Dim n As  Integer =  -1
  32124                                Do While  (n &lt;&gt ; 0)
  32125                                    If (n  &gt; 0) T hen
  32126                                        c ompressor. Write(buff er, 0, n)
  32127                                    End I f
  32128                                    n = i nput.Read( buffer, 0,  buffer.Le ngth)
  32129                                Loop
  32130                           End  Using
  32131                           End  Using
  32132                       End Usi ng
  32133                       
  32134        </code>
  32135                      
  32136       </example>
  32137                    
  32138                     
  32139       <example>
  32140                      This ex ample show s how to u se a GZipS tream to u ncompress  a file.
  32141                      
  32142        <code>
  32143                       private  void GunZ ipFile(str ing filena me)
  32144                       {
  32145                           if  (!filename .EndsWith( ".gz))
  32146                                throw new  ArgumentE xception(" filename") ;
  32147                           var  Decompres sedFile =  filename.S ubstring(0 ,filename. Length-3);
  32148                           byt e[] workin g = new by te[WORKING _BUFFER_SI ZE];
  32149                           int  n= 1;
  32150                           usi ng (System .IO.Stream  input = S ystem.IO.F ile.OpenRe ad(filenam e))
  32151                           {
  32152                                using (St ream decom pressor= n ew Ionic.Z lib.GZipSt ream(input , Compress ionMode.De compress,  true))
  32153                                {
  32154                                    using  (var outp ut = Syste m.IO.File. Create(Dec ompressedF ile))
  32155                                    {
  32156                                        w hile (n != 0)
  32157                                        {
  32158                                             n= deco mpressor.R ead(workin g, 0, work ing.Length );
  32159                                             if (n >  0)
  32160                                             {
  32161                                                 out put.Write( working, 0 , n);
  32162                                             }
  32163                                        }
  32164                                    }
  32165                                }
  32166                           }
  32167                       }
  32168                       
  32169        </code>
  32170                     
  32171                      
  32172        <code 
  32173         lang="VB"
  32174        >
  32175                       Private  Sub GunZi pFile(ByVa l filename  as String )
  32176                           If  Not (filen ame.EndsWi th(".gz))  Then
  32177                                Throw New  ArgumentE xception(" filename")
  32178                           End  If
  32179                           Dim  Decompres sedFile as  String =  filename.S ubstring(0 ,filename. Length-3)
  32180                           Dim  working(W ORKING_BUF FER_SIZE)  as Byte
  32181                           Dim  n As Inte ger = 1
  32182                           Usi ng input A s Stream =  File.Open Read(filen ame)
  32183                                Using dec ompressor  As Stream  = new Ioni c.Zlib.GZi pStream(in put, Compr essionMode .Decompres s, True)
  32184                                    Using  output As  Stream =  File.Creat e(Uncompre ssedFile)
  32185                                        D o
  32186                                             n= deco mpressor.R ead(workin g, 0, work ing.Length )
  32187                                             If n >  0 Then
  32188                                                 out put.Write( working, 0 , n)
  32189                                             End IF
  32190                                        L oop While  (n  > 0)
  32191                                    End U sing
  32192                                End Using
  32193                           End  Using
  32194                       End Sub
  32195                       
  32196        </code>
  32197                      
  32198       </example>
  32199                    
  32200                     
  32201       <param 
  32202        name="stre am"
  32203       >
  32204        The stream  which wil l be read  or written .
  32205       </param>
  32206                     
  32207       <param 
  32208        name="mode "
  32209       >
  32210        Indicates  whether th e GZipStre am will co mpress or  decompress .
  32211       </param>
  32212               
  32213      </member>
  32214              
  32215      <member 
  32216       name="M:Io nic.Zlib.G ZipStream. #ctor(Syst em.IO.Stre am,Ionic.Z lib.Compre ssionMode, Ionic.Zlib .Compressi onLevel)"
  32217      >
  32218                     
  32219       <summary>
  32220                        Creat e a 
  32221        <c>
  32222         GZipStream
  32223        </c>
  32224         using the  specified  
  32225        <c>
  32226         Compressio nMode
  32227        </c>
  32228         and
  32229                        the s pecified 
  32230        <c>
  32231         Compressio nLevel
  32232        </c>
  32233        .
  32234                      
  32235       </summary>
  32236                     
  32237       <remarks>
  32238                     
  32239                      
  32240        <para>
  32241                         The 
  32242         <c>
  32243          Compressio nMode
  32244         </c>
  32245          (Compress  or Decomp ress) also  establish es the
  32246                         "dire ction" of  the stream .  A 
  32247         <c>
  32248          GZipStream
  32249         </c>
  32250          with
  32251                         
  32252         <c>
  32253          Compressio nMode.Comp ress
  32254         </c>
  32255          works onl y through 
  32256         <c>
  32257          Write()
  32258         </c>
  32259         .  A
  32260                         
  32261         <c>
  32262          GZipStream
  32263         </c>
  32264          with 
  32265         <c>
  32266          Compressio nMode.Deco mpress
  32267         </c>
  32268          works onl y
  32269                         throu gh 
  32270         <c>
  32271          Read()
  32272         </c>
  32273         .
  32274                       
  32275        </para>
  32276                     
  32277                      
  32278       </remarks>
  32279                    
  32280                     
  32281       <example>
  32282                     
  32283                      This ex ample show s how to u se a 
  32284        <c>
  32285         GZipStream
  32286        </c>
  32287         to compre ss a file  into a .gz  file.
  32288                     
  32289                      
  32290        <code>
  32291                       using ( System.IO. Stream inp ut = Syste m.IO.File. OpenRead(f ileToCompr ess))
  32292                       {
  32293                           usi ng (var ra w = System .IO.File.C reate(file ToCompress  + ".gz"))
  32294                           {
  32295                                using (St ream compr essor = ne w GZipStre am(raw,
  32296                                                                              Compres sionMode.C ompress,
  32297                                                                              Compres sionLevel. BestCompre ssion))
  32298                                {
  32299                                    byte[ ] buffer =  new byte[ WORKING_BU FFER_SIZE] ;
  32300                                    int n ;
  32301                                    while  ((n= inpu t.Read(buf fer, 0, bu ffer.Lengt h)) != 0)
  32302                                    {
  32303                                        c ompressor. Write(buff er, 0, n);
  32304                                    }
  32305                                }
  32306                           }
  32307                       }
  32308                       
  32309        </code>
  32310                     
  32311                      
  32312        <code 
  32313         lang="VB"
  32314        >
  32315                       Using i nput As St ream = Fil e.OpenRead (fileToCom press)
  32316                           Usi ng raw As  FileStream  = File.Cr eate(fileT oCompress  &amp; ".gz ")
  32317                                Using com pressor As  Stream =  New GZipSt ream(raw,  Compressio nMode.Comp ress, Comp ressionLev el.BestCom pression)
  32318                                    Dim b uffer As B yte() = Ne w Byte(409 6) {}
  32319                                    Dim n  As Intege r = -1
  32320                                    Do Wh ile (n &lt ;&gt; 0)
  32321                                        I f (n &gt;  0) Then
  32322                                             compres sor.Write( buffer, 0,  n)
  32323                                        E nd If
  32324                                        n  = input.R ead(buffer , 0, buffe r.Length)
  32325                                    Loop
  32326                                End Using
  32327                           End  Using
  32328                       End Usi ng
  32329                       
  32330        </code>
  32331                      
  32332       </example>
  32333                     
  32334       <param 
  32335        name="stre am"
  32336       >
  32337        The stream  to be rea d or writt en while d eflating o r inflatin g.
  32338       </param>
  32339                     
  32340       <param 
  32341        name="mode "
  32342       >
  32343        Indicates  whether th
  32344        <c>
  32345         GZipStream
  32346        </c>
  32347         will comp ress or de compress.
  32348       </param>
  32349                     
  32350       <param 
  32351        name="leve l"
  32352       >
  32353        A tuning k nob to tra de speed f or effecti veness.
  32354       </param>
  32355               
  32356      </member>
  32357              
  32358      <member 
  32359       name="M:Io nic.Zlib.G ZipStream. #ctor(Syst em.IO.Stre am,Ionic.Z lib.Compre ssionMode, System.Boo lean)"
  32360      >
  32361                     
  32362       <summary>
  32363                        Creat e a 
  32364        <c>
  32365         GZipStream
  32366        </c>
  32367         using the  specified  
  32368        <c>
  32369         Compressio nMode
  32370        </c>
  32371        , and
  32372                        expli citly spec ify whethe r the stre am should  be left op en after D eflation
  32373                        or In flation.
  32374                      
  32375       </summary>
  32376                    
  32377                     
  32378       <remarks>
  32379                      
  32380        <para>
  32381                         This  constructo r allows t he applica tion to re quest that  the capti ve stream
  32382                         remai n open aft er the def lation or  inflation  occurs.  B y default,  after
  32383                         
  32384         <c>
  32385          Close()
  32386         </c>
  32387          is called  on the st ream, the  captive st ream is al so
  32388                         close d. In some  cases thi s is not d esired, fo r example  if the str eam is a
  32389                         memor y stream t hat will b e re-read  after comp ressed dat a has been  written
  32390                         to it .  Specify  true for  the 
  32391         <paramref 
  32392          name="leav eOpen"
  32393         />
  32394          parameter  to leave
  32395                         the s tream open .
  32396                       
  32397        </para>
  32398                     
  32399                      
  32400        <para>
  32401                         The 
  32402         <see 
  32403          cref="T:Io nic.Zlib.C ompression Mode"
  32404         />
  32405          (Compress  or Decomp ress) also
  32406                         estab lishes the  "directio n" of the  stream.  A  
  32407         <c>
  32408          GZipStream
  32409         </c>
  32410          with
  32411                         
  32412         <c>
  32413          Compressio nMode.Comp ress
  32414         </c>
  32415          works onl y through 
  32416         <c>
  32417          Write()
  32418         </c>
  32419         .  A 
  32420         <c>
  32421          GZipStream
  32422         </c>
  32423                         with 
  32424         <c>
  32425          Compressio nMode.Deco mpress
  32426         </c>
  32427          works onl y through 
  32428         <c>
  32429          Read()
  32430         </c>
  32431         .
  32432                       
  32433        </para>
  32434                     
  32435                      
  32436        <para>
  32437                         The 
  32438         <c>
  32439          GZipStream
  32440         </c>
  32441          will use  the defaul t compress ion level.  If you wa nt
  32442                         to sp ecify the  compressio n level, s ee 
  32443         <see 
  32444          cref="M:Io nic.Zlib.G ZipStream. #ctor(Syst em.IO.Stre am,Ionic.Z lib.Compre ssionMode, Ionic.Zlib .Compressi onLevel,Sy stem.Boole an)"
  32445         />
  32446         .
  32447                       
  32448        </para>
  32449                     
  32450                      
  32451        <para>
  32452                         See t he other o verloads o f this con structor f or example  code.
  32453                       
  32454        </para>
  32455                     
  32456                      
  32457       </remarks>
  32458                    
  32459                     
  32460       <param 
  32461        name="stre am"
  32462       >
  32463                        The s tream whic h will be  read or wr itten. Thi s is calle d the "cap tive"
  32464                        strea m in other  places in  this docu mentation.
  32465                      
  32466       </param>
  32467                    
  32468                     
  32469       <param 
  32470        name="mode "
  32471       >
  32472        Indicates  whether th e GZipStre am will co mpress or  decompress .
  32473                      
  32474       </param>
  32475                    
  32476                     
  32477       <param 
  32478        name="leav eOpen"
  32479       >
  32480                        true  if the app lication w ould like  the base s tream to r emain open  after
  32481                        infla tion/defla tion.
  32482                      
  32483       </param>
  32484               
  32485      </member>
  32486              
  32487      <member 
  32488       name="M:Io nic.Zlib.G ZipStream. #ctor(Syst em.IO.Stre am,Ionic.Z lib.Compre ssionMode, Ionic.Zlib .Compressi onLevel,Sy stem.Boole an)"
  32489      >
  32490                     
  32491       <summary>
  32492                        Creat e a 
  32493        <c>
  32494         GZipStream
  32495        </c>
  32496         using the  specified  
  32497        <c>
  32498         Compressio nMode
  32499        </c>
  32500         and the
  32501                        speci fied 
  32502        <c>
  32503         Compressio nLevel
  32504        </c>
  32505        , and expl icitly spe cify wheth er the
  32506                        strea m should b e left ope n after De flation or  Inflation .
  32507                      
  32508       </summary>
  32509                    
  32510                     
  32511       <remarks>
  32512                     
  32513                      
  32514        <para>
  32515                         This  constructo r allows t he applica tion to re quest that  the capti ve stream
  32516                         remai n open aft er the def lation or  inflation  occurs.  B y default,  after
  32517                         
  32518         <c>
  32519          Close()
  32520         </c>
  32521          is called  on the st ream, the  captive st ream is al so
  32522                         close d. In some  cases thi s is not d esired, fo r example  if the str eam is a
  32523                         memor y stream t hat will b e re-read  after comp ressed dat a has been  written
  32524                         to it .  Specify  true for  the 
  32525         <paramref 
  32526          name="leav eOpen"
  32527         />
  32528          parameter  to
  32529                         leave  the strea m open.
  32530                       
  32531        </para>
  32532                     
  32533                      
  32534        <para>
  32535                         As no ted in the  class doc umentation , the 
  32536         <c>
  32537          Compressio nMode
  32538         </c>
  32539          (Compress
  32540                         or De compress)  also estab lishes the  "directio n" of the  stream.  A
  32541                         
  32542         <c>
  32543          GZipStream
  32544         </c>
  32545          with 
  32546         <c>
  32547          Compressio nMode.Comp ress
  32548         </c>
  32549          works onl y through
  32550                         
  32551         <c>
  32552          Write()
  32553         </c>
  32554         .  A 
  32555         <c>
  32556          GZipStream
  32557         </c>
  32558          with 
  32559         <c>
  32560          Compressio nMode.Deco mpress
  32561         </c>
  32562          works onl y
  32563                         throu gh 
  32564         <c>
  32565          Read()
  32566         </c>
  32567         .
  32568                       
  32569        </para>
  32570                     
  32571                      
  32572       </remarks>
  32573                    
  32574                     
  32575       <example>
  32576                        This  example sh ows how to  use a 
  32577        <c>
  32578         GZipStream
  32579        </c>
  32580         to compre ss data.
  32581                      
  32582        <code>
  32583                       using ( System.IO. Stream inp ut = Syste m.IO.File. OpenRead(f ileToCompr ess))
  32584                       {
  32585                           usi ng (var ra w = System .IO.File.C reate(outp utFile))
  32586                           {
  32587                                using (St ream compr essor = ne w GZipStre am(raw, Co mpressionM ode.Compre ss, Compre ssionLevel .BestCompr ession, tr ue))
  32588                                {
  32589                                    byte[ ] buffer =  new byte[ WORKING_BU FFER_SIZE] ;
  32590                                    int n ;
  32591                                    while  ((n= inpu t.Read(buf fer, 0, bu ffer.Lengt h)) != 0)
  32592                                    {
  32593                                        c ompressor. Write(buff er, 0, n);
  32594                                    }
  32595                                }
  32596                           }
  32597                       }
  32598                       
  32599        </code>
  32600                      
  32601        <code 
  32602         lang="VB"
  32603        >
  32604                       Dim out putFile As  String =  (fileToCom press &amp ; ".compre ssed")
  32605                       Using i nput As St ream = Fil e.OpenRead (fileToCom press)
  32606                           Usi ng raw As  FileStream  = File.Cr eate(outpu tFile)
  32607                           Usi ng compres sor As Str eam = New  GZipStream (raw, Comp ressionMod e.Compress , Compress ionLevel.B estCompres sion, True )
  32608                                Dim buffe r As Byte( ) = New By te(4096) { }
  32609                                Dim n As  Integer =  -1
  32610                                Do While  (n &lt;&gt ; 0)
  32611                                    If (n  &gt; 0) T hen
  32612                                        c ompressor. Write(buff er, 0, n)
  32613                                    End I f
  32614                                    n = i nput.Read( buffer, 0,  buffer.Le ngth)
  32615                                Loop
  32616                           End  Using
  32617                           End  Using
  32618                       End Usi ng
  32619                       
  32620        </code>
  32621                      
  32622       </example>
  32623                     
  32624       <param 
  32625        name="stre am"
  32626       >
  32627        The stream  which wil l be read  or written .
  32628       </param>
  32629                     
  32630       <param 
  32631        name="mode "
  32632       >
  32633        Indicates  whether th e GZipStre am will co mpress or  decompress .
  32634       </param>
  32635                     
  32636       <param 
  32637        name="leav eOpen"
  32638       >
  32639        true if th e applicat ion would  like the s tream to r emain open  after inf lation/def lation.
  32640       </param>
  32641                     
  32642       <param 
  32643        name="leve l"
  32644       >
  32645        A tuning k nob to tra de speed f or effecti veness.
  32646       </param>
  32647               
  32648      </member>
  32649              
  32650      <member 
  32651       name="M:Io nic.Zlib.G ZipStream. Dispose(Sy stem.Boole an)"
  32652      >
  32653                    
  32654       <summary>
  32655                       Dispos e the stre am.
  32656                     
  32657       </summary>
  32658                    
  32659       <remarks>
  32660                       
  32661        <para>
  32662                          This  may or ma y not resu lt in a 
  32663         <c>
  32664          Close()
  32665         </c>
  32666          call on t he captive
  32667                          stre am.  See t he constru ctors that  have a 
  32668         <c>
  32669          leaveOpen
  32670         </c>
  32671          parameter
  32672                          for  more infor mation.
  32673                        
  32674        </para>
  32675                       
  32676        <para>
  32677                          This  method ma y be invok ed in two  distinct s cenarios.   If dispos ing
  32678                          == t rue, the m ethod has  been calle d directly  or indire ctly by a
  32679                          user 's code, f or example  via the p ublic Disp ose() meth od. In thi s
  32680                          case , both man aged and u nmanaged r esources c an be refe renced and
  32681                          disp osed.  If  disposing  == false,  the method  has been  called by  the
  32682                          runt ime from i nside the  object fin alizer and  this meth od should  not
  32683                          refe rence othe r objects;  in that c ase only u nmanaged r esources m ust
  32684                          be r eferenced  or dispose d.
  32685                        
  32686        </para>
  32687                     
  32688       </remarks>
  32689                    
  32690       <param 
  32691        name="disp osing"
  32692       >
  32693                       indica tes whethe r the Disp ose method  was invok ed by user  code.
  32694                     
  32695       </param>
  32696               
  32697      </member>
  32698              
  32699      <member 
  32700       name="M:Io nic.Zlib.G ZipStream. Flush"
  32701      >
  32702                    
  32703       <summary>
  32704                     Flush th e stream.
  32705                     
  32706       </summary>
  32707               
  32708      </member>
  32709              
  32710      <member 
  32711       name="M:Io nic.Zlib.G ZipStream. Read(Syste m.Byte[],S ystem.Int3 2,System.I nt32)"
  32712      >
  32713                     
  32714       <summary>
  32715                        Read  and decomp ress data  from the s ource stre am.
  32716                      
  32717       </summary>
  32718                    
  32719                     
  32720       <remarks>
  32721                        With 
  32722        <c>
  32723         GZipStream
  32724        </c>
  32725        , decompre ssion is d one throug h reading.
  32726                      
  32727       </remarks>
  32728                    
  32729                     
  32730       <example>
  32731                      
  32732        <code>
  32733                       byte[]  working =  new byte[W ORKING_BUF FER_SIZE];
  32734                       using ( System.IO. Stream inp ut = Syste m.IO.File. OpenRead(_ Compressed File))
  32735                       {
  32736                           usi ng (Stream  decompres sor= new I onic.Zlib. GZipStream (input, Co mpressionM ode.Decomp ress, true ))
  32737                           {
  32738                                using (va r output =  System.IO .File.Crea te(_Decomp ressedFile ))
  32739                                {
  32740                                    int n ;
  32741                                    while  ((n= deco mpressor.R ead(workin g, 0, work ing.Length )) !=0)
  32742                                    {
  32743                                        o utput.Writ e(working,  0, n);
  32744                                    }
  32745                                }
  32746                           }
  32747                       }
  32748                       
  32749        </code>
  32750                      
  32751       </example>
  32752                     
  32753       <param 
  32754        name="buff er"
  32755       >
  32756        The buffer  into whic h the deco mpressed d ata should  be placed .
  32757       </param>
  32758                     
  32759       <param 
  32760        name="offs et"
  32761       >
  32762        the offset  within th at data ar ray to put  the first  byte read .
  32763       </param>
  32764                     
  32765       <param 
  32766        name="coun t"
  32767       >
  32768        the number  of bytes  to read.
  32769       </param>
  32770                     
  32771       <returns>
  32772        the number  of bytes  actually r ead
  32773       </returns>
  32774               
  32775      </member>
  32776              
  32777      <member 
  32778       name="M:Io nic.Zlib.G ZipStream. Seek(Syste m.Int64,Sy stem.IO.Se ekOrigin)"
  32779      >
  32780                    
  32781       <summary>
  32782                       Callin g this met hod always  throws a 
  32783        <see 
  32784         cref="T:Sy stem.NotIm plementedE xception"
  32785        />
  32786        .
  32787                     
  32788       </summary>
  32789                    
  32790       <param 
  32791        name="offs et"
  32792       >
  32793        irrelevant ; it will  always thr ow!
  32794       </param>
  32795                    
  32796       <param 
  32797        name="orig in"
  32798       >
  32799        irrelevant ; it will  always thr ow!
  32800       </param>
  32801                    
  32802       <returns>
  32803        irrelevant !
  32804       </returns>
  32805               
  32806      </member>
  32807              
  32808      <member 
  32809       name="M:Io nic.Zlib.G ZipStream. SetLength( System.Int 64)"
  32810      >
  32811                    
  32812       <summary>
  32813                       Callin g this met hod always  throws a 
  32814        <see 
  32815         cref="T:Sy stem.NotIm plementedE xception"
  32816        />
  32817        .
  32818                     
  32819       </summary>
  32820                    
  32821       <param 
  32822        name="valu e"
  32823       >
  32824        irrelevant ; this met hod will a lways thro w!
  32825       </param>
  32826               
  32827      </member>
  32828              
  32829      <member 
  32830       name="M:Io nic.Zlib.G ZipStream. Write(Syst em.Byte[], System.Int 32,System. Int32)"
  32831      >
  32832                     
  32833       <summary>
  32834                        Write  data to t he stream.
  32835                      
  32836       </summary>
  32837                    
  32838                     
  32839       <remarks>
  32840                      
  32841        <para>
  32842                         If yo u wish to  use the 
  32843         <c>
  32844          GZipStream
  32845         </c>
  32846          to compre ss data wh ile writin g,
  32847                         you c an create 
  32848         <c>
  32849          GZipStream
  32850         </c>
  32851          with 
  32852         <c>
  32853          Compressio nMode.Comp ress
  32854         </c>
  32855         , and a
  32856                         writa ble output  stream.   Then call 
  32857         <c>
  32858          Write()
  32859         </c>
  32860          on that 
  32861         <c>
  32862          GZipStream
  32863         </c>
  32864         ,
  32865                         provi ding uncom pressed da ta as inpu t.  The da ta sent to  the outpu t stream
  32866                         will  be the com pressed fo rm of the  data writt en.
  32867                       
  32868        </para>
  32869                     
  32870                      
  32871        <para>
  32872                         A 
  32873         <c>
  32874          GZipStream
  32875         </c>
  32876          can be us ed for 
  32877         <c>
  32878          Read()
  32879         </c>
  32880          or 
  32881         <c>
  32882          Write()
  32883         </c>
  32884         , but not
  32885                         both.  Writing i mplies com pression.   Reading i mplies dec ompression .
  32886                       
  32887        </para>
  32888                     
  32889                      
  32890       </remarks>
  32891                     
  32892       <param 
  32893        name="buff er"
  32894       >
  32895        The buffer  holding d ata to wri te to the  stream.
  32896       </param>
  32897                     
  32898       <param 
  32899        name="offs et"
  32900       >
  32901        the offset  within th at data ar ray to fin d the firs t byte to  write.
  32902       </param>
  32903                     
  32904       <param 
  32905        name="coun t"
  32906       >
  32907        the number  of bytes  to write.
  32908       </param>
  32909               
  32910      </member>
  32911              
  32912      <member 
  32913       name="M:Io nic.Zlib.G ZipStream. CompressSt ring(Syste m.String)"
  32914      >
  32915                     
  32916       <summary>
  32917                        Compr ess a stri ng into a  byte array  using GZi p.
  32918                      
  32919       </summary>
  32920                    
  32921                     
  32922       <remarks>
  32923                        Uncom press it w ith 
  32924        <see 
  32925         cref="M:Io nic.Zlib.G ZipStream. Uncompress String(Sys tem.Byte[] )"
  32926        />
  32927        .
  32928                      
  32929       </remarks>
  32930                    
  32931                     
  32932       <seealso 
  32933        cref="M:Io nic.Zlib.G ZipStream. Uncompress String(Sys tem.Byte[] )"
  32934       />
  32935                     
  32936       <seealso 
  32937        cref="M:Io nic.Zlib.G ZipStream. CompressBu ffer(Syste m.Byte[])"
  32938       />
  32939                    
  32940                     
  32941       <param 
  32942        name="s"
  32943       >
  32944                        A str ing to com press. The  string wi ll first b e encoded
  32945                        using  UTF8, the n compress ed.
  32946                      
  32947       </param>
  32948                    
  32949                     
  32950       <returns>
  32951        The string  in compre ssed form
  32952       </returns>
  32953               
  32954      </member>
  32955              
  32956      <member 
  32957       name="M:Io nic.Zlib.G ZipStream. CompressBu ffer(Syste m.Byte[])"
  32958      >
  32959                     
  32960       <summary>
  32961                        Compr ess a byte  array int o a new by te array u sing GZip.
  32962                      
  32963       </summary>
  32964                    
  32965                     
  32966       <remarks>
  32967                        Uncom press it w ith 
  32968        <see 
  32969         cref="M:Io nic.Zlib.G ZipStream. Uncompress Buffer(Sys tem.Byte[] )"
  32970        />
  32971        .
  32972                      
  32973       </remarks>
  32974                    
  32975                     
  32976       <seealso 
  32977        cref="M:Io nic.Zlib.G ZipStream. CompressSt ring(Syste m.String)"
  32978       />
  32979                     
  32980       <seealso 
  32981        cref="M:Io nic.Zlib.G ZipStream. Uncompress Buffer(Sys tem.Byte[] )"
  32982       />
  32983                    
  32984                     
  32985       <param 
  32986        name="b"
  32987       >
  32988                        A buf fer to com press.
  32989                      
  32990       </param>
  32991                    
  32992                     
  32993       <returns>
  32994        The data i n compress ed form
  32995       </returns>
  32996               
  32997      </member>
  32998              
  32999      <member 
  33000       name="M:Io nic.Zlib.G ZipStream. Uncompress String(Sys tem.Byte[] )"
  33001      >
  33002                     
  33003       <summary>
  33004                        Uncom press a GZ ip'ed byte  array int o a single  string.
  33005                      
  33006       </summary>
  33007                    
  33008                     
  33009       <seealso 
  33010        cref="M:Io nic.Zlib.G ZipStream. CompressSt ring(Syste m.String)"
  33011       />
  33012                     
  33013       <seealso 
  33014        cref="M:Io nic.Zlib.G ZipStream. Uncompress Buffer(Sys tem.Byte[] )"
  33015       />
  33016                    
  33017                     
  33018       <param 
  33019        name="comp ressed"
  33020       >
  33021                        A buf fer contai ning GZIP- compressed  data.
  33022                      
  33023       </param>
  33024                    
  33025                     
  33026       <returns>
  33027        The uncomp ressed str ing
  33028       </returns>
  33029               
  33030      </member>
  33031              
  33032      <member 
  33033       name="M:Io nic.Zlib.G ZipStream. Uncompress Buffer(Sys tem.Byte[] )"
  33034      >
  33035                     
  33036       <summary>
  33037                        Uncom press a GZ ip'ed byte  array int o a byte a rray.
  33038                      
  33039       </summary>
  33040                    
  33041                     
  33042       <seealso 
  33043        cref="M:Io nic.Zlib.G ZipStream. CompressBu ffer(Syste m.Byte[])"
  33044       />
  33045                     
  33046       <seealso 
  33047        cref="M:Io nic.Zlib.G ZipStream. Uncompress String(Sys tem.Byte[] )"
  33048       />
  33049                    
  33050                     
  33051       <param 
  33052        name="comp ressed"
  33053       >
  33054                        A buf fer contai ning data  that has b een compre ssed with  GZip.
  33055                      
  33056       </param>
  33057                    
  33058                     
  33059       <returns>
  33060        The data i n uncompre ssed form
  33061       </returns>
  33062               
  33063      </member>
  33064              
  33065      <member 
  33066       name="P:Io nic.Zlib.G ZipStream. Comment"
  33067      >
  33068                     
  33069       <summary>
  33070                        The c omment on  the GZIP s tream.
  33071                      
  33072       </summary>
  33073                    
  33074                     
  33075       <remarks>
  33076                      
  33077        <para>
  33078                         The G ZIP format  allows fo r each fil e to optio nally have  an associ ated
  33079                         comme nt stored  with the f ile.  The  comment is  encoded w ith the IS O-8859-1
  33080                         code  page.  To  include a  comment in  a GZIP st ream you c reate, set  this
  33081                         prope rty before  calling 
  33082         <c>
  33083          Write()
  33084         </c>
  33085          for the f irst time  on the
  33086                         
  33087         <c>
  33088          GZipStream
  33089         </c>
  33090         .
  33091                       
  33092        </para>
  33093                     
  33094                      
  33095        <para>
  33096                         When  using 
  33097         <c>
  33098          GZipStream
  33099         </c>
  33100          to decomp ress, you  can retrie ve this pr operty
  33101                         after  the first  call to 
  33102         <c>
  33103          Read()
  33104         </c>
  33105         .  If no c omment has  been set  in the
  33106                         GZIP  bytestream , the Comm ent proper ty will re turn 
  33107         <c>
  33108          null
  33109         </c>
  33110                         (
  33111         <c>
  33112          Nothing
  33113         </c>
  33114          in VB).
  33115                       
  33116        </para>
  33117                      
  33118       </remarks>
  33119               
  33120      </member>
  33121              
  33122      <member 
  33123       name="P:Io nic.Zlib.G ZipStream. FileName"
  33124      >
  33125                     
  33126       <summary>
  33127                        The F ileName fo r the GZIP  stream.
  33128                      
  33129       </summary>
  33130                    
  33131                     
  33132       <remarks>
  33133                     
  33134                      
  33135        <para>
  33136                         The G ZIP format  optionall y allows e ach file t o have an  associated
  33137                         filen ame.  When  compressi ng data (t hrough 
  33138         <c>
  33139          Write()
  33140         </c>
  33141         ), set thi s
  33142                         FileN ame before  calling 
  33143         <c>
  33144          Write()
  33145         </c>
  33146          the first  time on t he 
  33147         <c>
  33148          GZipStream
  33149         </c>
  33150         .
  33151                         The a ctual file name is en coded into  the GZIP  bytestream  with the
  33152                         ISO-8 859-1 code  page, acc ording to  RFC 1952.  It is the  applicatio n's
  33153                         respo nsibility  to insure  that the F ileName ca n be encod ed and dec oded
  33154                         corre ctly with  this code  page.
  33155                       
  33156        </para>
  33157                     
  33158                      
  33159        <para>
  33160                         When  decompress ing (throu gh 
  33161         <c>
  33162          Read()
  33163         </c>
  33164         ), you can  retrieve  this value
  33165                         any t ime after  the first 
  33166         <c>
  33167          Read()
  33168         </c>
  33169         .  In the  case where  there was  no filena me
  33170                         encod ed into th e GZIP byt estream, t he propert y will ret urn 
  33171         <c>
  33172          null
  33173         </c>
  33174          (
  33175         <c>
  33176          Nothing
  33177         </c>
  33178                         in VB ).
  33179                       
  33180        </para>
  33181                      
  33182       </remarks>
  33183               
  33184      </member>
  33185              
  33186      <member 
  33187       name="P:Io nic.Zlib.G ZipStream. Crc32"
  33188      >
  33189                    
  33190       <summary>
  33191                     The CRC  on the GZI P stream.
  33192                     
  33193       </summary>
  33194                    
  33195       <remarks>
  33196                     This is  used for i nternal er ror checki ng. You pr obably don 't need to  look at t his proper ty.
  33197                     
  33198       </remarks>
  33199               
  33200      </member>
  33201              
  33202      <member 
  33203       name="P:Io nic.Zlib.G ZipStream. FlushMode"
  33204      >
  33205                    
  33206       <summary>
  33207                     This pro perty sets  the flush  behavior  on the str eam.
  33208                     
  33209       </summary>
  33210               
  33211      </member>
  33212              
  33213      <member 
  33214       name="P:Io nic.Zlib.G ZipStream. BufferSize "
  33215      >
  33216                     
  33217       <summary>
  33218                        The s ize of the  working b uffer for  the compre ssion code c.
  33219                      
  33220       </summary>
  33221                    
  33222                     
  33223       <remarks>
  33224                      
  33225        <para>
  33226                         The w orking buf fer is use d for all  stream ope rations.   The defaul t size is
  33227                         1024  bytes.  Th e minimum  size is 12 8 bytes. Y ou may get  better pe rformance
  33228                         with  a larger b uffer.  Th en again,  you might  not.  You  would have  to test
  33229                         it.
  33230                       
  33231        </para>
  33232                     
  33233                      
  33234        <para>
  33235                         Set t his before  the first  call to 
  33236         <c>
  33237          Read()
  33238         </c>
  33239          or 
  33240         <c>
  33241          Write()
  33242         </c>
  33243          on the
  33244                         strea m. If you  try to set  it afterw ards, it w ill throw.
  33245                       
  33246        </para>
  33247                      
  33248       </remarks>
  33249               
  33250      </member>
  33251              
  33252      <member 
  33253       name="P:Io nic.Zlib.G ZipStream. TotalIn"
  33254      >
  33255                    
  33256       <summary>
  33257         Returns t he total n umber of b ytes input  so far.
  33258       </summary>
  33259               
  33260      </member>
  33261              
  33262      <member 
  33263       name="P:Io nic.Zlib.G ZipStream. TotalOut"
  33264      >
  33265                    
  33266       <summary>
  33267         Returns t he total n umber of b ytes outpu t so far.
  33268       </summary>
  33269               
  33270      </member>
  33271              
  33272      <member 
  33273       name="P:Io nic.Zlib.G ZipStream. CanRead"
  33274      >
  33275                    
  33276       <summary>
  33277                     Indicate s whether  the stream  can be re ad.
  33278                     
  33279       </summary>
  33280                    
  33281       <remarks>
  33282                     The retu rn value d epends on  whether th e captive  stream sup ports read ing.
  33283                     
  33284       </remarks>
  33285               
  33286      </member>
  33287              
  33288      <member 
  33289       name="P:Io nic.Zlib.G ZipStream. CanSeek"
  33290      >
  33291                    
  33292       <summary>
  33293                     Indicate s whether  the stream  supports  Seek opera tions.
  33294                     
  33295       </summary>
  33296                    
  33297       <remarks>
  33298                     Always r eturns fal se.
  33299                     
  33300       </remarks>
  33301               
  33302      </member>
  33303              
  33304      <member 
  33305       name="P:Io nic.Zlib.G ZipStream. CanWrite"
  33306      >
  33307                    
  33308       <summary>
  33309                     Indicate s whether  the stream  can be wr itten.
  33310                     
  33311       </summary>
  33312                    
  33313       <remarks>
  33314                     The retu rn value d epends on  whether th e captive  stream sup ports writ ing.
  33315                     
  33316       </remarks>
  33317               
  33318      </member>
  33319              
  33320      <member 
  33321       name="P:Io nic.Zlib.G ZipStream. Length"
  33322      >
  33323                    
  33324       <summary>
  33325                     Reading  this prope rty always  throws a 
  33326        <see 
  33327         cref="T:Sy stem.NotIm plementedE xception"
  33328        />
  33329        .
  33330                     
  33331       </summary>
  33332               
  33333      </member>
  33334              
  33335      <member 
  33336       name="P:Io nic.Zlib.G ZipStream. Position"
  33337      >
  33338                     
  33339       <summary>
  33340                        The p osition of  the strea m pointer.
  33341                      
  33342       </summary>
  33343                    
  33344                     
  33345       <remarks>
  33346                        Setti ng this pr operty alw ays throws  a 
  33347        <see 
  33348         cref="T:Sy stem.NotIm plementedE xception"
  33349        />
  33350        . Reading  will retur n the tota l bytes
  33351                        writt en out, if  used in w riting, or  the total  bytes rea d in, if u sed in
  33352                        readi ng.  The c ount may r efer to co mpressed b ytes or un compressed  bytes,
  33353                        depen ding on ho w you've u sed the st ream.
  33354                      
  33355       </remarks>
  33356               
  33357      </member>
  33358              
  33359      <member 
  33360       name="T:Io nic.Zlib.P arallelDef lateOutput Stream"
  33361      >
  33362                     
  33363       <summary>
  33364                        A cla ss for com pressing s treams usi ng the
  33365                        Defla te algorit hm with mu ltiple thr eads.
  33366                      
  33367       </summary>
  33368                    
  33369                     
  33370       <remarks>
  33371                      
  33372        <para>
  33373                         This  class perf orms DEFLA TE compres sion throu gh writing .  For
  33374                         more  informatio n on the D eflate alg orithm, se e IETF RFC  1951,
  33375                         "DEFL ATE Compre ssed Data  Format Spe cification  version 1 .3."
  33376                       
  33377        </para>
  33378                     
  33379                      
  33380        <para>
  33381                         This  class is s imilar to 
  33382         <see 
  33383          cref="T:Io nic.Zlib.D eflateStre am"
  33384         />
  33385         , except
  33386                         that  this class  is for co mpression  only, and  this imple mentation  uses an
  33387                         appro ach that e mploys mul tiple work er threads  to perfor m the DEFL ATE.  On
  33388                         a mul ti-cpu or  multi-core  computer,  the perfo rmance of  this class  can be
  33389                         signi ficantly h igher than  the singl e-threaded  DeflateSt ream, part icularly
  33390                         for l arger stre ams.  How  large?  An ything ove r 10mb is  a good can didate
  33391                         for p arallel co mpression.
  33392                       
  33393        </para>
  33394                     
  33395                      
  33396        <para>
  33397                         The t radeoff is  that this  class use s more mem ory and mo re CPU tha n the
  33398                         vanil la Deflate Stream, an d also is  less effic ient as a  compressor . For
  33399                         large  files the  size of t he compres sed data s tream can  be less th an 1%
  33400                         large r than the  size of a  compresse d data str eam from t he vaniall a
  33401                         Defla teStream.   For small er files t he differe nce can be  larger.   The
  33402                         diffe rence will  also be l arger if y ou set the  BufferSiz e to be lo wer than
  33403                         the d efault val ue.  Your  mileage ma y vary. Fi nally, for  small fil es, the
  33404                         Paral lelDeflate OutputStre am can be  much slowe r than the  vanilla
  33405                         Defla teStream,  because of  the overh ead associ ated to us ing the th read
  33406                         pool.
  33407                       
  33408        </para>
  33409                     
  33410                      
  33411       </remarks>
  33412                     
  33413       <seealso 
  33414        cref="T:Io nic.Zlib.D eflateStre am"
  33415       />
  33416               
  33417      </member>
  33418              
  33419      <member 
  33420       name="M:Io nic.Zlib.P arallelDef lateOutput Stream.#ct or(System. IO.Stream) "
  33421      >
  33422                     
  33423       <summary>
  33424                      Create  a Parallel DeflateOut putStream.
  33425                      
  33426       </summary>
  33427                     
  33428       <remarks>
  33429                     
  33430                      
  33431        <para>
  33432                         This  stream com presses da ta written  into it v ia the DEF LATE
  33433                         algor ithm (see  RFC 1951),  and write s out the  compressed  byte stre am.
  33434                       
  33435        </para>
  33436                     
  33437                      
  33438        <para>
  33439                         The i nstance wi ll use the  default c ompression  level, th e default
  33440                         buffe r sizes an d the defa ult number  of thread s and buff ers per
  33441                         threa d.
  33442                       
  33443        </para>
  33444                     
  33445                      
  33446        <para>
  33447                         This  class is s imilar to 
  33448         <see 
  33449          cref="T:Io nic.Zlib.D eflateStre am"
  33450         />
  33451         ,
  33452                         excep t that thi s implemen tation use s an appro ach that e mploys
  33453                         multi ple worker  threads t o perform  the DEFLAT E.  On a m ulti-cpu o r
  33454                         multi -core comp uter, the  performanc e of this  class can  be
  33455                         signi ficantly h igher than  the singl e-threaded  DeflateSt ream,
  33456                         parti cularly fo r larger s treams.  H ow large?   Anything  over 10mb  is
  33457                         a goo d candidat e for para llel compr ession.
  33458                       
  33459        </para>
  33460                     
  33461                      
  33462       </remarks>
  33463                    
  33464                     
  33465       <example>
  33466                     
  33467                      This ex ample show s how to u se a Paral lelDeflate OutputStre am to comp ress
  33468                      data.   It reads a  file, com presses it , and writ es the com pressed da ta to
  33469                      a secon d, output  file.
  33470                     
  33471                      
  33472        <code>
  33473                       byte[]  buffer = n ew byte[WO RKING_BUFF ER_SIZE];
  33474                       int n=  -1;
  33475                       String  outputFile  = fileToC ompress +  ".compress ed";
  33476                       using ( System.IO. Stream inp ut = Syste m.IO.File. OpenRead(f ileToCompr ess))
  33477                       {
  33478                           usi ng (var ra w = System .IO.File.C reate(outp utFile))
  33479                           {
  33480                                using (St ream compr essor = ne w Parallel DeflateOut putStream( raw))
  33481                                {
  33482                                    while  ((n= inpu t.Read(buf fer, 0, bu ffer.Lengt h)) != 0)
  33483                                    {
  33484                                        c ompressor. Write(buff er, 0, n);
  33485                                    }
  33486                                }
  33487                           }
  33488                       }
  33489                       
  33490        </code>
  33491                      
  33492        <code 
  33493         lang="VB"
  33494        >
  33495                       Dim buf fer As Byt e() = New  Byte(4096)  {}
  33496                       Dim n A s Integer  = -1
  33497                       Dim out putFile As  String =  (fileToCom press &amp ; ".compre ssed")
  33498                       Using i nput As St ream = Fil e.OpenRead (fileToCom press)
  33499                           Usi ng raw As  FileStream  = File.Cr eate(outpu tFile)
  33500                                Using com pressor As  Stream =  New Parall elDeflateO utputStrea m(raw)
  33501                                    Do Wh ile (n &lt ;&gt; 0)
  33502                                        I f (n &gt;  0) Then
  33503                                             compres sor.Write( buffer, 0,  n)
  33504                                        E nd If
  33505                                        n  = input.R ead(buffer , 0, buffe r.Length)
  33506                                    Loop
  33507                                End Using
  33508                           End  Using
  33509                       End Usi ng
  33510                       
  33511        </code>
  33512                      
  33513       </example>
  33514                     
  33515       <param 
  33516        name="stre am"
  33517       >
  33518        The stream  to which  compressed  data will  be writte n.
  33519       </param>
  33520               
  33521      </member>
  33522              
  33523      <member 
  33524       name="M:Io nic.Zlib.P arallelDef lateOutput Stream.#ct or(System. IO.Stream, Ionic.Zlib .Compressi onLevel)"
  33525      >
  33526                    
  33527       <summary>
  33528                       Create  a Paralle lDeflateOu tputStream  using the  specified  Compressi onLevel.
  33529                     
  33530       </summary>
  33531                    
  33532       <remarks>
  33533                       See th
  33534        <see 
  33535         cref="M:Io nic.Zlib.P arallelDef lateOutput Stream.#ct or(System. IO.Stream) "
  33536        />
  33537                       constr uctor for  example co de.
  33538                     
  33539       </remarks>
  33540                    
  33541       <param 
  33542        name="stre am"
  33543       >
  33544        The stream  to which  compressed  data will  be writte n.
  33545       </param>
  33546                    
  33547       <param 
  33548        name="leve l"
  33549       >
  33550        A tuning k nob to tra de speed f or effecti veness.
  33551       </param>
  33552               
  33553      </member>
  33554              
  33555      <member 
  33556       name="M:Io nic.Zlib.P arallelDef lateOutput Stream.#ct or(System. IO.Stream, System.Boo lean)"
  33557      >
  33558                    
  33559       <summary>
  33560                     Create a  ParallelD eflateOutp utStream a nd specify  whether t o leave th e captive  stream ope n
  33561                     when the  ParallelD eflateOutp utStream i s closed.
  33562                     
  33563       </summary>
  33564                    
  33565       <remarks>
  33566                       See th
  33567        <see 
  33568         cref="M:Io nic.Zlib.P arallelDef lateOutput Stream.#ct or(System. IO.Stream) "
  33569        />
  33570                       constr uctor for  example co de.
  33571                     
  33572       </remarks>
  33573                    
  33574       <param 
  33575        name="stre am"
  33576       >
  33577        The stream  to which  compressed  data will  be writte n.
  33578       </param>
  33579                    
  33580       <param 
  33581        name="leav eOpen"
  33582       >
  33583                        true  if the app lication w ould like  the stream  to remain  open afte r inflatio n/deflatio n.
  33584                     
  33585       </param>
  33586               
  33587      </member>
  33588              
  33589      <member 
  33590       name="M:Io nic.Zlib.P arallelDef lateOutput Stream.#ct or(System. IO.Stream, Ionic.Zlib .Compressi onLevel,Sy stem.Boole an)"
  33591      >
  33592                    
  33593       <summary>
  33594                     Create a  ParallelD eflateOutp utStream a nd specify  whether t o leave th e captive  stream ope n
  33595                     when the  ParallelD eflateOutp utStream i s closed.
  33596                     
  33597       </summary>
  33598                    
  33599       <remarks>
  33600                       See th
  33601        <see 
  33602         cref="M:Io nic.Zlib.P arallelDef lateOutput Stream.#ct or(System. IO.Stream) "
  33603        />
  33604                       constr uctor for  example co de.
  33605                     
  33606       </remarks>
  33607                    
  33608       <param 
  33609        name="stre am"
  33610       >
  33611        The stream  to which  compressed  data will  be writte n.
  33612       </param>
  33613                    
  33614       <param 
  33615        name="leve l"
  33616       >
  33617        A tuning k nob to tra de speed f or effecti veness.
  33618       </param>
  33619                    
  33620       <param 
  33621        name="leav eOpen"
  33622       >
  33623                        true  if the app lication w ould like  the stream  to remain  open afte r inflatio n/deflatio n.
  33624                     
  33625       </param>
  33626               
  33627      </member>
  33628              
  33629      <member 
  33630       name="M:Io nic.Zlib.P arallelDef lateOutput Stream.#ct or(System. IO.Stream, Ionic.Zlib .Compressi onLevel,Io nic.Zlib.C ompression Strategy,S ystem.Bool ean)"
  33631      >
  33632                    
  33633       <summary>
  33634                     Create a  ParallelD eflateOutp utStream u sing the s pecified
  33635                     Compress ionLevel a nd Compres sionStrate gy, and sp ecifying w hether to
  33636                     leave th e captive  stream ope n when the  ParallelD eflateOutp utStream i s
  33637                     closed.
  33638                     
  33639       </summary>
  33640                    
  33641       <remarks>
  33642                       See th
  33643        <see 
  33644         cref="M:Io nic.Zlib.P arallelDef lateOutput Stream.#ct or(System. IO.Stream) "
  33645        />
  33646                       constr uctor for  example co de.
  33647                     
  33648       </remarks>
  33649                    
  33650       <param 
  33651        name="stre am"
  33652       >
  33653        The stream  to which  compressed  data will  be writte n.
  33654       </param>
  33655                    
  33656       <param 
  33657        name="leve l"
  33658       >
  33659        A tuning k nob to tra de speed f or effecti veness.
  33660       </param>
  33661                    
  33662       <param 
  33663        name="stra tegy"
  33664       >
  33665                       By twe aking this  parameter , you may  be able to  optimize  the compre ssion for
  33666                       data w ith partic ular chara cteristics .
  33667                     
  33668       </param>
  33669                    
  33670       <param 
  33671        name="leav eOpen"
  33672       >
  33673                        true  if the app lication w ould like  the stream  to remain  open afte r inflatio n/deflatio n.
  33674                     
  33675       </param>
  33676               
  33677      </member>
  33678              
  33679      <member 
  33680       name="M:Io nic.Zlib.P arallelDef lateOutput Stream.Wri te(System. Byte[],Sys tem.Int32, System.Int 32)"
  33681      >
  33682                     
  33683       <summary>
  33684                        Write  data to t he stream.
  33685                      
  33686       </summary>
  33687                    
  33688                     
  33689       <remarks>
  33690                     
  33691                      
  33692        <para>
  33693                         To us e the Para llelDeflat eOutputStr eam to com press data , create a
  33694                         Paral lelDeflate OutputStre am with Co mpressionM ode.Compre ss, passin g a
  33695                         writa ble output  stream.   Then call  Write() on  that
  33696                         Paral lelDeflate OutputStre am, provid ing uncomp ressed dat a as input .  The
  33697                         data  sent to th e output s tream will  be the co mpressed f orm of the  data
  33698                         writt en.
  33699                       
  33700        </para>
  33701                     
  33702                      
  33703        <para>
  33704                         To de compress d ata, use t he 
  33705         <see 
  33706          cref="T:Io nic.Zlib.D eflateStre am"
  33707         />
  33708          class.
  33709                       
  33710        </para>
  33711                     
  33712                      
  33713       </remarks>
  33714                     
  33715       <param 
  33716        name="buff er"
  33717       >
  33718        The buffer  holding d ata to wri te to the  stream.
  33719       </param>
  33720                     
  33721       <param 
  33722        name="offs et"
  33723       >
  33724        the offset  within th at data ar ray to fin d the firs t byte to  write.
  33725       </param>
  33726                     
  33727       <param 
  33728        name="coun t"
  33729       >
  33730        the number  of bytes  to write.
  33731       </param>
  33732               
  33733      </member>
  33734              
  33735      <member 
  33736       name="M:Io nic.Zlib.P arallelDef lateOutput Stream.Flu sh"
  33737      >
  33738                    
  33739       <summary>
  33740                     Flush th e stream.
  33741                     
  33742       </summary>
  33743               
  33744      </member>
  33745              
  33746      <member 
  33747       name="M:Io nic.Zlib.P arallelDef lateOutput Stream.Clo se"
  33748      >
  33749                    
  33750       <summary>
  33751                     Close th e stream.
  33752                     
  33753       </summary>
  33754                    
  33755       <remarks>
  33756                     You must  call Clos e on the s tream to g uarantee t hat all of  the data  written in  has
  33757                     been com pressed, a nd the com pressed da ta has bee n written  out.
  33758                     
  33759       </remarks>
  33760               
  33761      </member>
  33762              
  33763      <member 
  33764       name="M:Io nic.Zlib.P arallelDef lateOutput Stream.Dis pose"
  33765      >
  33766                    
  33767       <summary>
  33768        Dispose th e object
  33769       </summary>
  33770                    
  33771       <remarks>
  33772                       
  33773        <para>
  33774                          Beca use Parall elDeflateO utputStrea m is IDisp osable, th e
  33775                          appl ication mu st call th is method  when finis hed using  the instan ce.
  33776                        
  33777        </para>
  33778                       
  33779        <para>
  33780                          This  method is  generally  called im plicitly u pon exit f rom
  33781                          a 
  33782         <c>
  33783          using
  33784         </c>
  33785          scope in  C# (
  33786         <c>
  33787          Using
  33788         </c>
  33789          in VB).
  33790                        
  33791        </para>
  33792                     
  33793       </remarks>
  33794               
  33795      </member>
  33796              
  33797      <member 
  33798       name="M:Io nic.Zlib.P arallelDef lateOutput Stream.Dis pose(Syste m.Boolean) "
  33799      >
  33800                    
  33801       <summary>
  33802        The Dispos e method
  33803       </summary>
  33804                    
  33805       <param 
  33806        name="disp osing"
  33807       >
  33808                       indica tes whethe r the Disp ose method  was invok ed by user  code.
  33809                     
  33810       </param>
  33811               
  33812      </member>
  33813              
  33814      <member 
  33815       name="M:Io nic.Zlib.P arallelDef lateOutput Stream.Res et(System. IO.Stream) "
  33816      >
  33817                     
  33818       <summary>
  33819                        Reset s the stre am for use  with anot her stream .
  33820                      
  33821       </summary>
  33822                     
  33823       <remarks>
  33824                        Becau se the Par allelDefla teOutputSt ream is ex pensive to  create, i t
  33825                        has b een design ed so that  it can be  recycled  and re-use d.  You ha ve
  33826                        to ca ll Close()  on the st ream first , then you  can call  Reset() on
  33827                        it, t o use it a gain on an other stre am.
  33828                      
  33829       </remarks>
  33830                    
  33831                     
  33832       <param 
  33833        name="stre am"
  33834       >
  33835                        The n ew output  stream for  this era.
  33836                      
  33837       </param>
  33838                    
  33839                     
  33840       <example>
  33841                      
  33842        <code>
  33843                       Paralle lDeflateOu tputStream  deflater  = null;
  33844                       foreach  (var inpu tFile in l istOfFiles )
  33845                       {
  33846                           str ing output File = inp utFile + " .compresse d";
  33847                           usi ng (System .IO.Stream  input = S ystem.IO.F ile.OpenRe ad(inputFi le))
  33848                           {
  33849                                using (va r outStrea m = System .IO.File.C reate(outp utFile))
  33850                                {
  33851                                    if (d eflater ==  null)
  33852                                        d eflater =  new Parall elDeflateO utputStrea m(outStrea m,
  33853                                                                                        Compress ionLevel.B est,
  33854                                                                                        Compress ionStrateg y.Default,
  33855                                                                                        true);
  33856                                    defla ter.Reset( outStream) ;
  33857                      
  33858                                    while  ((n= inpu t.Read(buf fer, 0, bu ffer.Lengt h)) != 0)
  33859                                    {
  33860                                        d eflater.Wr ite(buffer , 0, n);
  33861                                    }
  33862                                }
  33863                           }
  33864                       }
  33865                       
  33866        </code>
  33867                      
  33868       </example>
  33869               
  33870      </member>
  33871              
  33872      <member 
  33873       name="M:Io nic.Zlib.P arallelDef lateOutput Stream.Rea d(System.B yte[],Syst em.Int32,S ystem.Int3 2)"
  33874      >
  33875                    
  33876       <summary>
  33877                     This met hod always  throws a  NotSupport edExceptio n.
  33878                     
  33879       </summary>
  33880                    
  33881       <param 
  33882        name="buff er"
  33883       >
  33884                       The bu ffer into  which data  would be  read, IF T HIS METHOD
  33885                       ACTUAL LY DID ANY THING.
  33886                     
  33887       </param>
  33888                    
  33889       <param 
  33890        name="offs et"
  33891       >
  33892                       The of fset withi n that dat a array at  which to  insert the
  33893                       data t hat is rea d, IF THIS  METHOD AC TUALLY DID
  33894                       ANYTHI NG.
  33895                     
  33896       </param>
  33897                    
  33898       <param 
  33899        name="coun t"
  33900       >
  33901                       The nu mber of by tes to wri te, IF THI S METHOD A CTUALLY DI D
  33902                       ANYTHI NG.
  33903                     
  33904       </param>
  33905                    
  33906       <returns>
  33907        nothing.
  33908       </returns>
  33909               
  33910      </member>
  33911              
  33912      <member 
  33913       name="M:Io nic.Zlib.P arallelDef lateOutput Stream.See k(System.I nt64,Syste m.IO.SeekO rigin)"
  33914      >
  33915                    
  33916       <summary>
  33917                     This met hod always  throws a  NotSupport edExceptio n.
  33918                     
  33919       </summary>
  33920                    
  33921       <param 
  33922        name="offs et"
  33923       >
  33924                       The of fset to se ek to....
  33925                       IF THI S METHOD A CTUALLY DI D ANYTHING .
  33926                     
  33927       </param>
  33928                    
  33929       <param 
  33930        name="orig in"
  33931       >
  33932                       The re ference sp ecifying h ow to appl y the offs et....  IF
  33933                       THIS M ETHOD ACTU ALLY DID A NYTHING.
  33934                     
  33935       </param>
  33936                    
  33937       <returns>
  33938        nothing. I t always t hrows.
  33939       </returns>
  33940               
  33941      </member>
  33942              
  33943      <member 
  33944       name="M:Io nic.Zlib.P arallelDef lateOutput Stream.Set Length(Sys tem.Int64) "
  33945      >
  33946                    
  33947       <summary>
  33948                     This met hod always  throws a  NotSupport edExceptio n.
  33949                     
  33950       </summary>
  33951                    
  33952       <param 
  33953        name="valu e"
  33954       >
  33955                       The ne w value fo r the stre am length. ...  IF
  33956                       THIS M ETHOD ACTU ALLY DID A NYTHING.
  33957                     
  33958       </param>
  33959               
  33960      </member>
  33961              
  33962      <member 
  33963       name="P:Io nic.Zlib.P arallelDef lateOutput Stream.Str ategy"
  33964      >
  33965                     
  33966       <summary>
  33967                        The Z LIB strate gy to be u sed during  compressi on.
  33968                      
  33969       </summary>
  33970                    
  33971               
  33972      </member>
  33973              
  33974      <member 
  33975       name="P:Io nic.Zlib.P arallelDef lateOutput Stream.Max BufferPair s"
  33976      >
  33977                     
  33978       <summary>
  33979                        The m aximum num ber of buf fer pairs  to use.
  33980                      
  33981       </summary>
  33982                    
  33983                     
  33984       <remarks>
  33985                      
  33986        <para>
  33987                         This  property s ets an upp er limit o n the numb er of memo ry buffer
  33988                         pairs  to create .  The imp lementatio n of this  stream all ocates
  33989                         multi ple buffer s to facil itate para llel compr ession.  A s each buf fer
  33990                         fills  up, this  stream use
  33991         <see 
  33992          cref="M:Sy stem.Threa ding.Threa dPool.Queu eUserWorkI tem(System .Threading .WaitCallb ack)"
  33993         >
  33994                          Threa dPool.Queu eUserWorkI tem()
  33995         </see>
  33996                         to co mpress tho se buffers  in a back ground thr eadpool th read. Afte r a
  33997                         buffe r is compr essed, it  is re-orde red and wr itten to t he output
  33998                         strea m.
  33999                       
  34000        </para>
  34001                     
  34002                      
  34003        <para>
  34004                         A hig her number  of buffer  pairs ena bles a hig her degree  of
  34005                         paral lelism, wh ich tends  to increas e the spee d of compr ession on
  34006                         multi -cpu compu ters.  On  the other  hand, a hi gher numbe r of buffe r
  34007                         pairs  also impl ies a larg er memory  consumptio n, more ac tive worke r
  34008                         threa ds, and a  higher cpu  utilizati on for any  compressi on. This
  34009                         prope rty enable s the appl ication to  limit its  memory co nsumption  and
  34010                         CPU u tilization  behavior  depending  on require ments.
  34011                       
  34012        </para>
  34013                     
  34014                      
  34015        <para>
  34016                         For e ach compre ssion "tas k" that oc curs in pa rallel, th ere are 2
  34017                         buffe rs allocat ed: one fo r input an d one for  output.  T his proper ty
  34018                         sets  a limit fo r the numb er of pair s.  The to tal amount  of storag e
  34019                         space  allocated  for buffe ring will  then be (N *S*2), whe re N is th e
  34020                         numbe r of buffe r pairs, S  is the si ze of each  buffer (
  34021         <see 
  34022          cref="P:Io nic.Zlib.P arallelDef lateOutput Stream.Buf ferSize"
  34023         />
  34024         ).  By def ault, DotN etZip allo cates 4 bu ffer
  34025                         pairs  per CPU c ore, so if  your mach ine has 4  cores, and  you retai n
  34026                         the d efault buf fer size o f 128k, th en the
  34027                         Paral lelDeflate OutputStre am will us e 4 * 4 *  2 * 128kb  of buffer
  34028                         memor y in total , or 4mb,  in blocks  of 128kb.   If you th en set thi s
  34029                         prope rty to 8,  then the n umber will  be 8 * 2  * 128kb of  buffer
  34030                         memor y, or 2mb.
  34031                       
  34032        </para>
  34033                     
  34034                      
  34035        <para>
  34036                         CPU u tilization  will also  go up wit h addition al buffers , because  a
  34037                         large r number o f buffer p airs allow s a larger  number of  backgroun d
  34038                         threa ds to comp ress in pa rallel. If  you find  that paral lel
  34039                         compr ession is  consuming  too much m emory or C PU, you ca n adjust t his
  34040                         value  downward.
  34041                       
  34042        </para>
  34043                     
  34044                      
  34045        <para>
  34046                         The d efault val ue is 16.  Different  values may  deliver b etter or
  34047                         worse  results,  depending  on your pr iorities a nd the dyn amic
  34048                         perfo rmance cha racteristi cs of your  storage a nd compute  resources .
  34049                       
  34050        </para>
  34051                     
  34052                      
  34053        <para>
  34054                         This  property i s not the  number of  buffer pai rs to use;  it is an
  34055                         upper  limit. An  illustrat ion: Suppo se you hav e an appli cation tha t
  34056                         uses  the defaul t value of  this prop erty (whic h is 16),  and it run s
  34057                         on a  machine wi th 2 CPU c ores. In t hat case,  DotNetZip  will alloc ate
  34058                         4 buf fer pairs  per CPU co re, for a  total of 8  pairs.  T he upper
  34059                         limit  specified  by this p roperty ha s no effec t.
  34060                       
  34061        </para>
  34062                     
  34063                      
  34064        <para>
  34065                         The a pplication  can set t his value  at any tim e, but it  is effecti ve
  34066                         only  before the  first cal l to Write (), which  is when th e buffers  are
  34067                         alloc ated.
  34068                       
  34069        </para>
  34070                      
  34071       </remarks>
  34072               
  34073      </member>
  34074              
  34075      <member 
  34076       name="P:Io nic.Zlib.P arallelDef lateOutput Stream.Buf ferSize"
  34077      >
  34078                     
  34079       <summary>
  34080                        The s ize of the  buffers u sed by the  compresso r threads.
  34081                      
  34082       </summary>
  34083                     
  34084       <remarks>
  34085                     
  34086                      
  34087        <para>
  34088                         The d efault buf fer size i s 128k. Th e applicat ion can se t this val ue
  34089                         at an y time, bu t it is ef fective on ly before  the first  Write().
  34090                       
  34091        </para>
  34092                     
  34093                      
  34094        <para>
  34095                         Large r buffer s izes impli es larger  memory con sumption b ut allows
  34096                         more  efficient  compressio n. Using s maller buf fer sizes  consumes l ess
  34097                         memor y but may  result in  less effec tive compr ession.  F or example ,
  34098                         using  the defau lt buffer  size of 12 8k, the co mpression  delivered  is
  34099                         withi n 1% of th e compress ion delive red by the  single-th readed 
  34100         <see 
  34101          cref="T:Io nic.Zlib.D eflateStre am"
  34102         />
  34103         .  On the  other hand , using a
  34104                         Buffe rSize of 8 k can resu lt in a co mpressed d ata stream  that is 5 %
  34105                         large r than tha t delivere d by the s ingle-thre aded
  34106                         
  34107         <c>
  34108          DeflateStr eam
  34109         </c>
  34110         .  Excessi vely small  buffer si zes can al so cause
  34111                         the s peed of th e Parallel DeflateOut putStream  to drop, b ecause of
  34112                         large r thread s cheduling  overhead d ealing wit h many man y small
  34113                         buffe rs.
  34114                       
  34115        </para>
  34116                     
  34117                      
  34118        <para>
  34119                         The t otal amoun t of stora ge space a llocated f or bufferi ng will be
  34120                         (N*S* 2), where  N is the n umber of b uffer pair s, and S i s the size  of
  34121                         each  buffer (th is propert y). There  are 2 buff ers used b y the
  34122                         compr essor, one  for input  and one f or output.   By defau lt, DotNet Zip
  34123                         alloc ates 4 buf fer pairs  per CPU co re, so if  your machi ne has 4
  34124                         cores , then the  number of  buffer pa irs used w ill be 16.  If you
  34125                         accep t the defa ult value  of this pr operty, 12 8k, then t he
  34126                         Paral lelDeflate OutputStre am will us e 16 * 2 *  128kb of  buffer mem ory
  34127                         in to tal, or 4m b, in bloc ks of 128k b.  If you  set this  property t o
  34128                         64kb,  then the  number wil l be 16 *  2 * 64kb o f buffer m emory, or
  34129                         2mb.
  34130                       
  34131        </para>
  34132                     
  34133                      
  34134       </remarks>
  34135               
  34136      </member>
  34137              
  34138      <member 
  34139       name="P:Io nic.Zlib.P arallelDef lateOutput Stream.Crc 32"
  34140      >
  34141                    
  34142       <summary>
  34143                     The CRC3 2 for the  data that  was writte n out, pri or to comp ression.
  34144                     
  34145       </summary>
  34146                    
  34147       <remarks>
  34148                     This val ue is mean ingful onl y after a  call to Cl ose().
  34149                     
  34150       </remarks>
  34151               
  34152      </member>
  34153              
  34154      <member 
  34155       name="P:Io nic.Zlib.P arallelDef lateOutput Stream.Byt esProcesse d"
  34156      >
  34157                    
  34158       <summary>
  34159                     The tota l number o f uncompre ssed bytes  processed  by the Pa rallelDefl ateOutputS tream.
  34160                     
  34161       </summary>
  34162                    
  34163       <remarks>
  34164                     This val ue is mean ingful onl y after a  call to Cl ose().
  34165                     
  34166       </remarks>
  34167               
  34168      </member>
  34169              
  34170      <member 
  34171       name="P:Io nic.Zlib.P arallelDef lateOutput Stream.Can Seek"
  34172      >
  34173                    
  34174       <summary>
  34175                     Indicate s whether  the stream  supports  Seek opera tions.
  34176                     
  34177       </summary>
  34178                    
  34179       <remarks>
  34180                     Always r eturns fal se.
  34181                     
  34182       </remarks>
  34183               
  34184      </member>
  34185              
  34186      <member 
  34187       name="P:Io nic.Zlib.P arallelDef lateOutput Stream.Can Read"
  34188      >
  34189                    
  34190       <summary>
  34191                     Indicate s whether  the stream  supports  Read opera tions.
  34192                     
  34193       </summary>
  34194                    
  34195       <remarks>
  34196                     Always r eturns fal se.
  34197                     
  34198       </remarks>
  34199               
  34200      </member>
  34201              
  34202      <member 
  34203       name="P:Io nic.Zlib.P arallelDef lateOutput Stream.Can Write"
  34204      >
  34205                    
  34206       <summary>
  34207                     Indicate s whether  the stream  supports  Write oper ations.
  34208                     
  34209       </summary>
  34210                    
  34211       <remarks>
  34212                     Returns  true if th e provided  stream is  writable.
  34213                     
  34214       </remarks>
  34215               
  34216      </member>
  34217              
  34218      <member 
  34219       name="P:Io nic.Zlib.P arallelDef lateOutput Stream.Len gth"
  34220      >
  34221                    
  34222       <summary>
  34223                     Reading  this prope rty always  throws a  NotSupport edExceptio n.
  34224                     
  34225       </summary>
  34226               
  34227      </member>
  34228              
  34229      <member 
  34230       name="P:Io nic.Zlib.P arallelDef lateOutput Stream.Pos ition"
  34231      >
  34232                    
  34233       <summary>
  34234                     Returns  the curren t position  of the ou tput strea m.
  34235                     
  34236       </summary>
  34237                    
  34238       <remarks>
  34239                       
  34240        <para>
  34241                          Beca use the ou tput gets  written by  a backgro und thread ,
  34242                          the  value may  change asy nchronousl y.  Settin g this
  34243                          prop erty alway s throws a  NotSuppor tedExcepti on.
  34244                        
  34245        </para>
  34246                     
  34247       </remarks>
  34248               
  34249      </member>
  34250              
  34251      <member 
  34252       name="M:Io nic.Zlib.T ree.Distan ceCode(Sys tem.Int32) "
  34253      >
  34254                    
  34255       <summary>
  34256                     Map from  a distanc e to a dis tance code .
  34257                     
  34258       </summary>
  34259                    
  34260       <remarks> 
  34261                     No side  effects. _ dist_code[ 256] and _ dist_code[ 257] are n ever used.
  34262                     
  34263       </remarks>
  34264               
  34265      </member>
  34266              
  34267      <member 
  34268       name="T:Io nic.Zlib.F lushType"
  34269      >
  34270                    
  34271       <summary>
  34272                     Describe s how to f lush the c urrent def late opera tion.
  34273                     
  34274       </summary>
  34275                    
  34276       <remarks>
  34277                     The diff erent Flus hType valu es are use ful when u sing a Def late in a  streaming  applicatio n.
  34278                     
  34279       </remarks>
  34280               
  34281      </member>
  34282              
  34283      <member 
  34284       name="F:Io nic.Zlib.F lushType.N one"
  34285      >
  34286                    
  34287       <summary>
  34288        No flush a t all.
  34289       </summary>
  34290               
  34291      </member>
  34292              
  34293      <member 
  34294       name="F:Io nic.Zlib.F lushType.P artial"
  34295      >
  34296                    
  34297       <summary>
  34298        Closes the  current b lock, but  doesn't fl ush it to
  34299                     the outp ut. Used i nternally  only in hy pothetical
  34300                     scenario s.  This w as suppose d to be re moved by Z lib, but i t is
  34301                     still in  use in so me edge ca ses.
  34302                     
  34303       </summary>
  34304               
  34305      </member>
  34306              
  34307      <member 
  34308       name="F:Io nic.Zlib.F lushType.S ync"
  34309      >
  34310                    
  34311       <summary>
  34312                     Use this  during co mpression  to specify  that all  pending ou tput shoul d be
  34313                     flushed  to the out put buffer  and the o utput shou ld be alig ned on a b yte
  34314                     boundary .  You mig ht use thi s in a str eaming com munication  scenario,  so that
  34315                     the deco mpressor c an get all  input dat a availabl e so far.   When usin g this
  34316                     with a Z libCodec, 
  34317        <c>
  34318         AvailableB ytesIn
  34319        </c>
  34320         will be z ero after  the call i f
  34321                     enough o utput spac e has been  provided  before the  call.  Fl ushing wil l
  34322                     degrade  compressio n and so i t should b e used onl y when nec essary.
  34323                     
  34324       </summary>
  34325               
  34326      </member>
  34327              
  34328      <member 
  34329       name="F:Io nic.Zlib.F lushType.F ull"
  34330      >
  34331                    
  34332       <summary>
  34333                     Use this  during co mpression  to specify  that all  output sho uld be flu shed, as
  34334                     with 
  34335        <c>
  34336         FlushType. Sync
  34337        </c>
  34338        , but also , the comp ression st ate should  be reset
  34339                     so that  decompress ion can re start from  this poin t if previ ous compre ssed
  34340                     data has  been dama ged or if  random acc ess is des ired.  Usi ng
  34341                     
  34342        <c>
  34343         FlushType. Full
  34344        </c>
  34345         too often  can signi ficantly d egrade the  compressi on.
  34346                     
  34347       </summary>
  34348               
  34349      </member>
  34350              
  34351      <member 
  34352       name="F:Io nic.Zlib.F lushType.F inish"
  34353      >
  34354                    
  34355       <summary>
  34356        Signals th e end of t he compres sion/decom pression s tream.
  34357       </summary>
  34358               
  34359      </member>
  34360              
  34361      <member 
  34362       name="T:Io nic.Zlib.C ompression Level"
  34363      >
  34364                    
  34365       <summary>
  34366                     The comp ression le vel to be  used when  using a De flateStrea m or ZlibS tream with  Compressi onMode.Com press.
  34367                     
  34368       </summary>
  34369               
  34370      </member>
  34371              
  34372      <member 
  34373       name="F:Io nic.Zlib.C ompression Level.None "
  34374      >
  34375                    
  34376       <summary>
  34377                     None mea ns that th e data wil l be simpl y stored,  with no ch ange at al l.
  34378                     If you a re produci ng ZIPs fo r use on M ac OSX, be  aware tha t archives  produced  with Compr essionLeve l.None
  34379                     cannot b e opened w ith the de fault zip  reader. Us e a differ ent Compre ssionLevel .
  34380                     
  34381       </summary>
  34382               
  34383      </member>
  34384              
  34385      <member 
  34386       name="F:Io nic.Zlib.C ompression Level.Leve l0"
  34387      >
  34388                    
  34389       <summary>
  34390                     Same as  None.
  34391                     
  34392       </summary>
  34393               
  34394      </member>
  34395              
  34396      <member 
  34397       name="F:Io nic.Zlib.C ompression Level.Best Speed"
  34398      >
  34399                    
  34400       <summary>
  34401                     The fast est but le ast effect ive compre ssion.
  34402                     
  34403       </summary>
  34404               
  34405      </member>
  34406              
  34407      <member 
  34408       name="F:Io nic.Zlib.C ompression Level.Leve l1"
  34409      >
  34410                    
  34411       <summary>
  34412                     A synony m for Best Speed.
  34413                     
  34414       </summary>
  34415               
  34416      </member>
  34417              
  34418      <member 
  34419       name="F:Io nic.Zlib.C ompression Level.Leve l2"
  34420      >
  34421                    
  34422       <summary>
  34423                     A little  slower, b ut better,  than leve l 1.
  34424                     
  34425       </summary>
  34426               
  34427      </member>
  34428              
  34429      <member 
  34430       name="F:Io nic.Zlib.C ompression Level.Leve l3"
  34431      >
  34432                    
  34433       <summary>
  34434                     A little  slower, b ut better,  than leve l 2.
  34435                     
  34436       </summary>
  34437               
  34438      </member>
  34439              
  34440      <member 
  34441       name="F:Io nic.Zlib.C ompression Level.Leve l4"
  34442      >
  34443                    
  34444       <summary>
  34445                     A little  slower, b ut better,  than leve l 3.
  34446                     
  34447       </summary>
  34448               
  34449      </member>
  34450              
  34451      <member 
  34452       name="F:Io nic.Zlib.C ompression Level.Leve l5"
  34453      >
  34454                    
  34455       <summary>
  34456                     A little  slower th an level 4 , but with  better co mpression.
  34457                     
  34458       </summary>
  34459               
  34460      </member>
  34461              
  34462      <member 
  34463       name="F:Io nic.Zlib.C ompression Level.Defa ult"
  34464      >
  34465                    
  34466       <summary>
  34467                     The defa ult compre ssion leve l, with a  good balan ce of spee d and comp ression ef ficiency.
  34468                     
  34469       </summary>
  34470               
  34471      </member>
  34472              
  34473      <member 
  34474       name="F:Io nic.Zlib.C ompression Level.Leve l6"
  34475      >
  34476                    
  34477       <summary>
  34478                     A synony m for Defa ult.
  34479                     
  34480       </summary>
  34481               
  34482      </member>
  34483              
  34484      <member 
  34485       name="F:Io nic.Zlib.C ompression Level.Leve l7"
  34486      >
  34487                    
  34488       <summary>
  34489                     Pretty g ood compre ssion!
  34490                     
  34491       </summary>
  34492               
  34493      </member>
  34494              
  34495      <member 
  34496       name="F:Io nic.Zlib.C ompression Level.Leve l8"
  34497      >
  34498                    
  34499       <summary>
  34500                      Better  compressio n than Lev el7!
  34501                     
  34502       </summary>
  34503               
  34504      </member>
  34505              
  34506      <member 
  34507       name="F:Io nic.Zlib.C ompression Level.Best Compressio n"
  34508      >
  34509                    
  34510       <summary>
  34511                     The "bes t" compres sion, wher e best mea ns greates t reductio n in size  of the inp ut data st ream.
  34512                     This is  also the s lowest com pression.
  34513                     
  34514       </summary>
  34515               
  34516      </member>
  34517              
  34518      <member 
  34519       name="F:Io nic.Zlib.C ompression Level.Leve l9"
  34520      >
  34521                    
  34522       <summary>
  34523                     A synony m for Best Compressio n.
  34524                     
  34525       </summary>
  34526               
  34527      </member>
  34528              
  34529      <member 
  34530       name="T:Io nic.Zlib.C ompression Strategy"
  34531      >
  34532                    
  34533       <summary>
  34534                     Describe s options  for how th e compress ion algori thm is exe cuted.  Di fferent st rategies
  34535                     work bet ter on dif ferent sor ts of data .  The str ategy para meter can  affect the  compressi on
  34536                     ratio an d the spee d of compr ession but  not the c orrectness  of the co mpresssion .
  34537                     
  34538       </summary>
  34539               
  34540      </member>
  34541              
  34542      <member 
  34543       name="F:Io nic.Zlib.C ompression Strategy.D efault"
  34544      >
  34545                    
  34546       <summary>
  34547                     The defa ult strate gy is prob ably the b est for no rmal data.
  34548                     
  34549       </summary>
  34550               
  34551      </member>
  34552              
  34553      <member 
  34554       name="F:Io nic.Zlib.C ompression Strategy.F iltered"
  34555      >
  34556                    
  34557       <summary>
  34558                     The 
  34559        <c>
  34560         Filtered
  34561        </c>
  34562         strategy  is intende d to be us ed most ef fectively  with data  produced b y a
  34563                     filter o r predicto r.  By thi s definiti on, filter ed data co nsists mos tly of sma ll
  34564                     values w ith a some what rando m distribu tion.  In  this case,  the compr ession alg orithm
  34565                     is tuned  to compre ss them be tter.  The  effect of  
  34566        <c>
  34567         Filtered
  34568        </c>
  34569         is to for ce more Hu ffman
  34570                     coding a nd less st ring match ing; it is  a half-st ep between  
  34571        <c>
  34572         Default
  34573        </c>
  34574         and 
  34575        <c>
  34576         HuffmanOnl y
  34577        </c>
  34578        .
  34579                     
  34580       </summary>
  34581               
  34582      </member>
  34583              
  34584      <member 
  34585       name="F:Io nic.Zlib.C ompression Strategy.H uffmanOnly "
  34586      >
  34587                    
  34588       <summary>
  34589                     Using 
  34590        <c>
  34591         HuffmanOnl y
  34592        </c>
  34593         will forc e the comp ressor to  do Huffman  encoding  only, with  no
  34594                     string m atching.
  34595                     
  34596       </summary>
  34597               
  34598      </member>
  34599              
  34600      <member 
  34601       name="T:Io nic.Zlib.C ompression Mode"
  34602      >
  34603                    
  34604       <summary>
  34605                     An enum  to specify  the direc tion of tr anscoding  - whether  to compres s or decom press.
  34606                     
  34607       </summary>
  34608               
  34609      </member>
  34610              
  34611      <member 
  34612       name="F:Io nic.Zlib.C ompression Mode.Compr ess"
  34613      >
  34614                    
  34615       <summary>
  34616                     Used to  specify th at the str eam should  compress  the data.
  34617                     
  34618       </summary>
  34619               
  34620      </member>
  34621              
  34622      <member 
  34623       name="F:Io nic.Zlib.C ompression Mode.Decom press"
  34624      >
  34625                    
  34626       <summary>
  34627                     Used to  specify th at the str eam should  decompres s the data .
  34628                     
  34629       </summary>
  34630               
  34631      </member>
  34632              
  34633      <member 
  34634       name="T:Io nic.Zlib.Z libExcepti on"
  34635      >
  34636                    
  34637       <summary>
  34638                     A genera l purpose  exception  class for  exceptions  in the Zl ib library .
  34639                     
  34640       </summary>
  34641               
  34642      </member>
  34643              
  34644      <member 
  34645       name="M:Io nic.Zlib.Z libExcepti on.#ctor"
  34646      >
  34647                    
  34648       <summary>
  34649                     The Zlib Exception  class capt ures excep tion infor mation gen erated
  34650                     by the Z lib librar y.
  34651                     
  34652       </summary>
  34653               
  34654      </member>
  34655              
  34656      <member 
  34657       name="M:Io nic.Zlib.Z libExcepti on.#ctor(S ystem.Stri ng)"
  34658      >
  34659                    
  34660       <summary>
  34661                     This cto r collects  a message  attached  to the exc eption.
  34662                     
  34663       </summary>
  34664                    
  34665       <param 
  34666        name="s"
  34667       >
  34668        the messag e for the  exception.
  34669       </param>
  34670               
  34671      </member>
  34672              
  34673      <member 
  34674       name="M:Io nic.Zlib.S haredUtils .URShift(S ystem.Int3 2,System.I nt32)"
  34675      >
  34676                    
  34677       <summary>
  34678                     Performs  an unsign ed bitwise  right shi ft with th e specifie d number
  34679                     
  34680       </summary>
  34681                    
  34682       <param 
  34683        name="numb er"
  34684       >
  34685        Number to  operate on
  34686       </param>
  34687                    
  34688       <param 
  34689        name="bits "
  34690       >
  34691        Ammount of  bits to s hift
  34692       </param>
  34693                    
  34694       <returns>
  34695        The result ing number  from the  shift oper ation
  34696       </returns>
  34697               
  34698      </member>
  34699              
  34700      <member 
  34701       name="M:Io nic.Zlib.S haredUtils .ReadInput (System.IO .TextReade r,System.B yte[],Syst em.Int32,S ystem.Int3 2)"
  34702      >
  34703                     
  34704       <summary>
  34705                        Reads  a number  of charact ers from t he current  source Te xtReader a nd writes
  34706                        the d ata to the  target ar ray at the  specified  index.
  34707                      
  34708       </summary>
  34709                    
  34710                     
  34711       <param 
  34712        name="sour ceTextRead er"
  34713       >
  34714        The source  TextReade r to read  from
  34715       </param>
  34716                     
  34717       <param 
  34718        name="targ et"
  34719       >
  34720        Contains t he array o f characte res read f rom the so urce TextR eader.
  34721       </param>
  34722                     
  34723       <param 
  34724        name="star t"
  34725       >
  34726        The starti ng index o f the targ et array.
  34727       </param>
  34728                     
  34729       <param 
  34730        name="coun t"
  34731       >
  34732        The maximu m number o f characte rs to read  from the  source Tex tReader.
  34733       </param>
  34734                    
  34735                     
  34736       <returns>
  34737                        The n umber of c haracters  read. The  number wil l be less  than or eq ual to
  34738                        count  depending  on the da ta availab le in the  source Tex tReader. R eturns -1
  34739                        if th e end of t he stream  is reached .
  34740                      
  34741       </returns>
  34742               
  34743      </member>
  34744              
  34745      <member 
  34746       name="T:Io nic.Zlib.A dler"
  34747      >
  34748                     
  34749       <summary>
  34750                      Compute s an Adler -32 checks um.
  34751                      
  34752       </summary>
  34753                     
  34754       <remarks>
  34755                      The Adl er checksu m is simil ar to a CR C checksum , but fast er to comp ute, thoug h less
  34756                      reliabl e.  It is  used in pr oducing RF C1950 comp ressed str eams.  The  Adler che cksum
  34757                      is a re quired par t of the " ZLIB" stan dard.  App lications  will almos t never ne ed to
  34758                      use thi s class di rectly.
  34759                      
  34760       </remarks>
  34761                    
  34762                     
  34763       <exclude/>
  34764               
  34765      </member>
  34766              
  34767      <member 
  34768       name="M:Io nic.Zlib.A dler.Adler 32(System. UInt32,Sys tem.Byte[] ,System.In t32,System .Int32)"
  34769      >
  34770                    
  34771       <summary>
  34772                       Calcul ates the A dler32 che cksum.
  34773                     
  34774       </summary>
  34775                    
  34776       <remarks>
  34777                       
  34778        <para>
  34779                          This  is used w ithin ZLIB .  You pro bably don' t need to  use this d irectly.
  34780                        
  34781        </para>
  34782                     
  34783       </remarks>
  34784                    
  34785       <example>
  34786                        To co mpute an A dler32 che cksum on a  byte arra y:
  34787                      
  34788        <code>
  34789                         var a dler = Adl er.Adler32 (0, null,  0, 0);
  34790                         adler  = Adler.A dler32(adl er, buffer , index, l ength);
  34791                       
  34792        </code>
  34793                     
  34794       </example>
  34795               
  34796      </member>
  34797              
  34798      <member 
  34799       name="T:Io nic.Zlib.Z libCodec"
  34800      >
  34801                     
  34802       <summary>
  34803                      Encoder  and Decod er for ZLI B and DEFL ATE (IETF  RFC1950 an d RFC1951) .
  34804                      
  34805       </summary>
  34806                    
  34807                     
  34808       <remarks>
  34809                      This cl ass compre sses and d ecompresse s data acc ording to  the Deflat e algorith m
  34810                      and opt ionally, t he ZLIB fo rmat, as d ocumented  in 
  34811        <see
  34812                      
  34813         href="http ://www.iet f.org/rfc/ rfc1950.tx t"
  34814        >
  34815         RFC 1950 -  ZLIB
  34816        </see>
  34817         and 
  34818        <see
  34819                      
  34820         href="http ://www.iet f.org/rfc/ rfc1951.tx t"
  34821        >
  34822         RFC 1951 -  DEFLATE
  34823        </see>
  34824        .
  34825                      
  34826       </remarks>
  34827               
  34828      </member>
  34829              
  34830      <member 
  34831       name="F:Io nic.Zlib.Z libCodec.I nputBuffer "
  34832      >
  34833                    
  34834       <summary>
  34835                     The buff er from wh ich data i s taken.
  34836                     
  34837       </summary>
  34838               
  34839      </member>
  34840              
  34841      <member 
  34842       name="F:Io nic.Zlib.Z libCodec.N extIn"
  34843      >
  34844                    
  34845       <summary>
  34846                     An index  into the  InputBuffe r array, i ndicating  where to s tart readi ng. 
  34847                     
  34848       </summary>
  34849               
  34850      </member>
  34851              
  34852      <member 
  34853       name="F:Io nic.Zlib.Z libCodec.A vailableBy tesIn"
  34854      >
  34855                    
  34856       <summary>
  34857                     The numb er of byte s availabl e in the I nputBuffer , starting  at NextIn
  34858                     
  34859       </summary>
  34860                    
  34861       <remarks>
  34862                     Generall y you shou ld set thi s to Input Buffer.Len gth before  the first  Inflate()  or Deflat e() call. 
  34863                     The clas s will upd ate this n umber as c alls to In flate/Defl ate are ma de.
  34864                     
  34865       </remarks>
  34866               
  34867      </member>
  34868              
  34869      <member 
  34870       name="F:Io nic.Zlib.Z libCodec.T otalBytesI n"
  34871      >
  34872                    
  34873       <summary>
  34874                     Total nu mber of by tes read s o far, thr ough all c alls to In flate()/De flate().
  34875                     
  34876       </summary>
  34877               
  34878      </member>
  34879              
  34880      <member 
  34881       name="F:Io nic.Zlib.Z libCodec.O utputBuffe r"
  34882      >
  34883                    
  34884       <summary>
  34885                     Buffer t o store ou tput data.
  34886                     
  34887       </summary>
  34888               
  34889      </member>
  34890              
  34891      <member 
  34892       name="F:Io nic.Zlib.Z libCodec.N extOut"
  34893      >
  34894                    
  34895       <summary>
  34896                     An index  into the  OutputBuff er array,  indicating  where to  start writ ing. 
  34897                     
  34898       </summary>
  34899               
  34900      </member>
  34901              
  34902      <member 
  34903       name="F:Io nic.Zlib.Z libCodec.A vailableBy tesOut"
  34904      >
  34905                    
  34906       <summary>
  34907                     The numb er of byte s availabl e in the O utputBuffe r, startin g at NextO ut. 
  34908                     
  34909       </summary>
  34910                    
  34911       <remarks>
  34912                     Generall y you shou ld set thi s to Outpu tBuffer.Le ngth befor e the firs t Inflate( ) or Defla te() call.  
  34913                     The clas s will upd ate this n umber as c alls to In flate/Defl ate are ma de.
  34914                     
  34915       </remarks>
  34916               
  34917      </member>
  34918              
  34919      <member 
  34920       name="F:Io nic.Zlib.Z libCodec.T otalBytesO ut"
  34921      >
  34922                    
  34923       <summary>
  34924                     Total nu mber of by tes writte n to the o utput so f ar, throug h all call s to Infla te()/Defla te().
  34925                     
  34926       </summary>
  34927               
  34928      </member>
  34929              
  34930      <member 
  34931       name="F:Io nic.Zlib.Z libCodec.M essage"
  34932      >
  34933                    
  34934       <summary>
  34935                     used for  diagnosti cs, when s omething g oes wrong!
  34936                     
  34937       </summary>
  34938               
  34939      </member>
  34940              
  34941      <member 
  34942       name="F:Io nic.Zlib.Z libCodec.C ompressLev el"
  34943      >
  34944                    
  34945       <summary>
  34946                     The comp ression le vel to use  in this c odec.  Use ful only i n compress ion mode.
  34947                     
  34948       </summary>
  34949               
  34950      </member>
  34951              
  34952      <member 
  34953       name="F:Io nic.Zlib.Z libCodec.W indowBits"
  34954      >
  34955                    
  34956       <summary>
  34957                     The numb er of Wind ow Bits to  use.  
  34958                     
  34959       </summary>
  34960                    
  34961       <remarks>
  34962                     This gau ges the si ze of the  sliding wi ndow, and  hence the 
  34963                     compress ion effect iveness as  well as m emory cons umption. I t's best t o just lea ve this 
  34964                     setting  alone if y ou don't k now what i t is.  The  maximum v alue is 15  bits, whi ch implies
  34965                     a 32k wi ndow.  
  34966                     
  34967       </remarks>
  34968               
  34969      </member>
  34970              
  34971      <member 
  34972       name="F:Io nic.Zlib.Z libCodec.S trategy"
  34973      >
  34974                    
  34975       <summary>
  34976                     The comp ression st rategy to  use.
  34977                     
  34978       </summary>
  34979                    
  34980       <remarks>
  34981                     This is  only effec tive in co mpression.   The theo ry offered  by ZLIB i s that dif ferent
  34982                     strategi es could p otentially  produce s ignificant  differenc es in comp ression be havior
  34983                     for diff erent data  sets.  Un fortunatel y I don't  have any g ood recomm endations  for how
  34984                     to set i t differen tly.  When  I tested  changing t he strateg y I got mi nimally di fferent
  34985                     compress ion perfor mance. It' s best to  leave this  property  alone if y ou don't h ave a
  34986                     good fee l for it.   Or, you m ay want to  produce a  test harn ess that r uns throug h the
  34987                     differen t strategy  options a nd evaluat es them on  different  file type s. If you  do that,
  34988                     let me k now your r esults.
  34989                     
  34990       </remarks>
  34991               
  34992      </member>
  34993              
  34994      <member 
  34995       name="M:Io nic.Zlib.Z libCodec.# ctor"
  34996      >
  34997                    
  34998       <summary>
  34999                     Create a  ZlibCodec .
  35000                     
  35001       </summary>
  35002                    
  35003       <remarks>
  35004                     If you u se this de fault cons tructor, y ou will la ter have t o explicit ly call 
  35005                     Initiali zeInflate( ) or Initi alizeDefla te() befor e using th e ZlibCode c to compr ess 
  35006                     or decom press. 
  35007                     
  35008       </remarks>
  35009               
  35010      </member>
  35011              
  35012      <member 
  35013       name="M:Io nic.Zlib.Z libCodec.# ctor(Ionic .Zlib.Comp ressionMod e)"
  35014      >
  35015                    
  35016       <summary>
  35017                     Create a  ZlibCodec  that eith er compres ses or dec ompresses.
  35018                     
  35019       </summary>
  35020                    
  35021       <param 
  35022        name="mode "
  35023       >
  35024                     Indicate s whether  the codec  should com press (def late) or d ecompress  (inflate).
  35025                     
  35026       </param>
  35027               
  35028      </member>
  35029              
  35030      <member 
  35031       name="M:Io nic.Zlib.Z libCodec.I nitializeI nflate"
  35032      >
  35033                    
  35034       <summary>
  35035                     Initiali ze the inf lation sta te. 
  35036                     
  35037       </summary>
  35038                    
  35039       <remarks>
  35040                     It is no t necessar y to call  this befor e using th e ZlibCode c to infla te data; 
  35041                     It is im plicitly c alled when  you call  the constr uctor.
  35042                     
  35043       </remarks>
  35044                    
  35045       <returns>
  35046        Z_OK if ev erything g oes well.
  35047       </returns>
  35048               
  35049      </member>
  35050              
  35051      <member 
  35052       name="M:Io nic.Zlib.Z libCodec.I nitializeI nflate(Sys tem.Boolea n)"
  35053      >
  35054                     
  35055       <summary>
  35056                      Initial ize the in flation st ate with a n explicit  flag to
  35057                      govern  the handli ng of RFC1 950 header  bytes.
  35058                      
  35059       </summary>
  35060                    
  35061                     
  35062       <remarks>
  35063                      By defa ult, the Z LIB header  defined i
  35064        <see
  35065                      
  35066         href="http ://www.iet f.org/rfc/ rfc1950.tx t"
  35067        >
  35068         RFC 1950
  35069        </see>
  35070         is expect ed.  If
  35071                      you wan t to read  a zlib str eam you sh ould speci fy true fo r
  35072                      expectR fc1950Head er.  If yo u have a d eflate str eam, you w ill want t o specify
  35073                      false.  It is only  necessary  to invoke  this init ializer ex plicitly i f you
  35074                      want to  specify f alse.
  35075                      
  35076       </remarks>
  35077                    
  35078                     
  35079       <param 
  35080        name="expe ctRfc1950H eader"
  35081       >
  35082        whether to  expect an  RFC1950 h eader byte
  35083                      pair wh en reading  the strea m of data  to be infl ated.
  35084       </param>
  35085                    
  35086                     
  35087       <returns>
  35088        Z_OK if ev erything g oes well.
  35089       </returns>
  35090               
  35091      </member>
  35092              
  35093      <member 
  35094       name="M:Io nic.Zlib.Z libCodec.I nitializeI nflate(Sys tem.Int32) "
  35095      >
  35096                    
  35097       <summary>
  35098                     Initiali ze the Zli bCodec for  inflation , with the  specified  number of  window bi ts. 
  35099                     
  35100       </summary>
  35101                    
  35102       <param 
  35103        name="wind owBits"
  35104       >
  35105        The number  of window  bits to u se. If you  need to a sk what th at is, 
  35106                     then you  shouldn't  be callin g this ini tializer.
  35107       </param>
  35108                    
  35109       <returns>
  35110        Z_OK if al l goes wel l.
  35111       </returns>
  35112               
  35113      </member>
  35114              
  35115      <member 
  35116       name="M:Io nic.Zlib.Z libCodec.I nitializeI nflate(Sys tem.Int32, System.Boo lean)"
  35117      >
  35118                     
  35119       <summary>
  35120                      Initial ize the in flation st ate with a n explicit  flag to g overn the  handling o f
  35121                      RFC1950  header by tes. 
  35122                      
  35123       </summary>
  35124                    
  35125                     
  35126       <remarks>
  35127                      If you  want to re ad a zlib  stream you  should sp ecify true  for
  35128                      expectR fc1950Head er. In thi s case, th e library  will expec t to find  a ZLIB
  35129                      header,  as define d in 
  35130        <see 
  35131         href="http ://www.iet f.org/rfc/ rfc1950.tx t"
  35132        >
  35133         RFC
  35134                       1950
  35135        </see>
  35136        , in the c ompressed  stream.  I f you will  be readin g a DEFLAT E or
  35137                      GZIP st ream, whic h does not  have such  a header,  you will  want to sp ecify
  35138                      false.
  35139                      
  35140       </remarks>
  35141                    
  35142                     
  35143       <param 
  35144        name="expe ctRfc1950H eader"
  35145       >
  35146        whether to  expect an  RFC1950 h eader byte  pair when  reading 
  35147                      the str eam of dat a to be in flated.
  35148       </param>
  35149                     
  35150       <param 
  35151        name="wind owBits"
  35152       >
  35153        The number  of window  bits to u se. If you  need to a sk what th at is, 
  35154                      then yo u shouldn' t be calli ng this in itializer.
  35155       </param>
  35156                     
  35157       <returns>
  35158        Z_OK if ev erything g oes well.
  35159       </returns>
  35160               
  35161      </member>
  35162              
  35163      <member 
  35164       name="M:Io nic.Zlib.Z libCodec.I nflate(Ion ic.Zlib.Fl ushType)"
  35165      >
  35166                     
  35167       <summary>
  35168                      Inflate  the data  in the Inp utBuffer,  placing th e result i n the Outp utBuffer.
  35169                      
  35170       </summary>
  35171                     
  35172       <remarks>
  35173                      You mus t have set  InputBuff er and Out putBuffer,  NextIn an d NextOut,  and Avail ableBytesI n and 
  35174                      Availab leBytesOut   before c alling thi s method.
  35175                      
  35176       </remarks>
  35177                     
  35178       <example>
  35179                      
  35180        <code>
  35181                       private  void Infl ateBuffer( )
  35182                       {
  35183                           int  bufferSiz e = 1024;
  35184                           byt e[] buffer  = new byt e[bufferSi ze];
  35185                           Zli bCodec dec ompressor  = new Zlib Codec();
  35186                       
  35187                           Con sole.Write Line("\n== ========== ========== ========== ========== ==");
  35188                           Con sole.Write Line("Size  of Buffer  to Inflat e: {0} byt es.", Comp ressedByte s.Length);
  35189                           Mem oryStream  ms = new M emoryStrea m(Decompre ssedBytes) ;
  35190                       
  35191                           int  rc = deco mpressor.I nitializeI nflate();
  35192                       
  35193                           dec ompressor. InputBuffe r = Compre ssedBytes;
  35194                           dec ompressor. NextIn = 0 ;
  35195                           dec ompressor. AvailableB ytesIn = C ompressedB ytes.Lengt h;
  35196                       
  35197                           dec ompressor. OutputBuff er = buffe r;
  35198                       
  35199                           //  pass 1: in flate 
  35200                           do
  35201                           {
  35202                                decompres sor.NextOu t = 0;
  35203                                decompres sor.Availa bleBytesOu t = buffer .Length;
  35204                                rc = deco mpressor.I nflate(Flu shType.Non e);
  35205                       
  35206                                if (rc !=  ZlibConst ants.Z_OK  &amp;&amp;  rc != Zli bConstants .Z_STREAM_ END)
  35207                                    throw  new Excep tion("infl ating: " +  decompres sor.Messag e);
  35208                       
  35209                                ms.Write( decompress or.OutputB uffer, 0,  buffer.Len gth - deco mpressor.A vailableBy tesOut);
  35210                           }
  35211                           whi le (decomp ressor.Ava ilableByte sIn &gt; 0  || decomp ressor.Ava ilableByte sOut == 0) ;
  35212                       
  35213                           //  pass 2: fi nish and f lush
  35214                           do
  35215                           {
  35216                                decompres sor.NextOu t = 0;
  35217                                decompres sor.Availa bleBytesOu t = buffer .Length;
  35218                                rc = deco mpressor.I nflate(Flu shType.Fin ish);
  35219                       
  35220                                if (rc !=  ZlibConst ants.Z_STR EAM_END &a mp;&amp; r c != ZlibC onstants.Z _OK)
  35221                                    throw  new Excep tion("infl ating: " +  decompres sor.Messag e);
  35222                       
  35223                                if (buffe r.Length -  decompres sor.Availa bleBytesOu t &gt; 0)
  35224                                    ms.Wr ite(buffer , 0, buffe r.Length -  decompres sor.Availa bleBytesOu t);
  35225                           }
  35226                           whi le (decomp ressor.Ava ilableByte sIn &gt; 0  || decomp ressor.Ava ilableByte sOut == 0) ;
  35227                       
  35228                           dec ompressor. EndInflate ();
  35229                       }
  35230                      
  35231                       
  35232        </code>
  35233                      
  35234       </example>
  35235                     
  35236       <param 
  35237        name="flus h"
  35238       >
  35239        The flush  to use whe n inflatin g.
  35240       </param>
  35241                     
  35242       <returns>
  35243        Z_OK if ev erything g oes well.
  35244       </returns>
  35245               
  35246      </member>
  35247              
  35248      <member 
  35249       name="M:Io nic.Zlib.Z libCodec.E ndInflate"
  35250      >
  35251                    
  35252       <summary>
  35253                     Ends an  inflation  session. 
  35254                     
  35255       </summary>
  35256                    
  35257       <remarks>
  35258                     Call thi s after su ccessively  calling I nflate().   This will  cause all  buffers t o be flush ed. 
  35259                     After ca lling this  you canno t call Inf late() wit hout a int ervening c all to one  of the
  35260                     Initiali zeInflate( ) overload s.
  35261                     
  35262       </remarks>
  35263                    
  35264       <returns>
  35265        Z_OK if ev erything g oes well.
  35266       </returns>
  35267               
  35268      </member>
  35269              
  35270      <member 
  35271       name="M:Io nic.Zlib.Z libCodec.S yncInflate "
  35272      >
  35273                    
  35274       <summary>
  35275                     I don't  know what  this does!
  35276                     
  35277       </summary>
  35278                    
  35279       <returns>
  35280        Z_OK if ev erything g oes well.
  35281       </returns>
  35282               
  35283      </member>
  35284              
  35285      <member 
  35286       name="M:Io nic.Zlib.Z libCodec.I nitializeD eflate"
  35287      >
  35288                    
  35289       <summary>
  35290                     Initiali ze the Zli bCodec for  deflation  operation .
  35291                     
  35292       </summary>
  35293                    
  35294       <remarks>
  35295                     The code c will use  the MAX w indow bits  and the d efault lev el of comp ression.
  35296                     
  35297       </remarks>
  35298                    
  35299       <example>
  35300                     
  35301        <code>
  35302                       int buf ferSize =  40000;
  35303                       byte[]  Compressed Bytes = ne w byte[buf ferSize];
  35304                       byte[]  Decompress edBytes =  new byte[b ufferSize] ;
  35305                       
  35306                       ZlibCod ec compres sor = new  ZlibCodec( );
  35307                       
  35308                       compres sor.Initia lizeDeflat e(Compress ionLevel.D efault);
  35309                       
  35310                       compres sor.InputB uffer = Sy stem.Text. ASCIIEncod ing.ASCII. GetBytes(T extToCompr ess);
  35311                       compres sor.NextIn  = 0;
  35312                       compres sor.Availa bleBytesIn  = compres sor.InputB uffer.Leng th;
  35313                       
  35314                       compres sor.Output Buffer = C ompressedB ytes;
  35315                       compres sor.NextOu t = 0;
  35316                       compres sor.Availa bleBytesOu t = Compre ssedBytes. Length;
  35317                       
  35318                       while ( compressor .TotalByte sIn != Tex tToCompres s.Length & amp;&amp;  compressor .TotalByte sOut &lt;  bufferSize )
  35319                       {
  35320                         compr essor.Defl ate(FlushT ype.None);
  35321                       }
  35322                       
  35323                       while ( true)
  35324                       {
  35325                         int r c= compres sor.Deflat e(FlushTyp e.Finish);
  35326                         if (r c == ZlibC onstants.Z _STREAM_EN D) break;
  35327                       }
  35328                       
  35329                       compres sor.EndDef late();
  35330                        
  35331                      
  35332        </code>
  35333                     
  35334       </example>
  35335                    
  35336       <returns>
  35337        Z_OK if al l goes wel l. You gen erally don 't need to  check the  return co de.
  35338       </returns>
  35339               
  35340      </member>
  35341              
  35342      <member 
  35343       name="M:Io nic.Zlib.Z libCodec.I nitializeD eflate(Ion ic.Zlib.Co mpressionL evel)"
  35344      >
  35345                    
  35346       <summary>
  35347                     Initiali ze the Zli bCodec for  deflation  operation , using th e specifie d Compress ionLevel.
  35348                     
  35349       </summary>
  35350                    
  35351       <remarks>
  35352                     The code c will use  the maxim um window  bits (15)  and the sp ecified
  35353                     Compress ionLevel.   It will e mit a ZLIB  stream as  it compre sses.
  35354                     
  35355       </remarks>
  35356                    
  35357       <param 
  35358        name="leve l"
  35359       >
  35360        The compre ssion leve l for the  codec.
  35361       </param>
  35362                    
  35363       <returns>
  35364        Z_OK if al l goes wel l.
  35365       </returns>
  35366               
  35367      </member>
  35368              
  35369      <member 
  35370       name="M:Io nic.Zlib.Z libCodec.I nitializeD eflate(Ion ic.Zlib.Co mpressionL evel,Syste m.Boolean) "
  35371      >
  35372                    
  35373       <summary>
  35374                     Initiali ze the Zli bCodec for  deflation  operation , using th e specifie d Compress ionLevel, 
  35375                     and the  explicit f lag govern ing whethe r to emit  an RFC1950  header by te pair.
  35376                     
  35377       </summary>
  35378                    
  35379       <remarks>
  35380                     The code c will use  the maxim um window  bits (15)  and the sp ecified Co mpressionL evel.
  35381                     If you w ant to gen erate a zl ib stream,  you shoul d specify  true for
  35382                     wantRfc1 950Header.  In this c ase, the l ibrary wil l emit a Z LIB
  35383                     header,  as defined  in 
  35384        <see 
  35385         href="http ://www.iet f.org/rfc/ rfc1950.tx t"
  35386        >
  35387         RFC
  35388                      1950
  35389        </see>
  35390        , in the c ompressed  stream.  
  35391                     
  35392       </remarks>
  35393                    
  35394       <param 
  35395        name="leve l"
  35396       >
  35397        The compre ssion leve l for the  codec.
  35398       </param>
  35399                    
  35400       <param 
  35401        name="want Rfc1950Hea der"
  35402       >
  35403        whether to  emit an i nitial RFC 1950 byte  pair in th e compress ed stream.
  35404       </param>
  35405                    
  35406       <returns>
  35407        Z_OK if al l goes wel l.
  35408       </returns>
  35409               
  35410      </member>
  35411              
  35412      <member 
  35413       name="M:Io nic.Zlib.Z libCodec.I nitializeD eflate(Ion ic.Zlib.Co mpressionL evel,Syste m.Int32)"
  35414      >
  35415                    
  35416       <summary>
  35417                     Initiali ze the Zli bCodec for  deflation  operation , using th e specifie d Compress ionLevel, 
  35418                     and the  specified  number of  window bit s. 
  35419                     
  35420       </summary>
  35421                    
  35422       <remarks>
  35423                     The code c will use  the speci fied numbe r of windo w bits and  the speci fied Compr essionLeve l.
  35424                     
  35425       </remarks>
  35426                    
  35427       <param 
  35428        name="leve l"
  35429       >
  35430        The compre ssion leve l for the  codec.
  35431       </param>
  35432                    
  35433       <param 
  35434        name="bits "
  35435       >
  35436        the number  of window  bits to u se.  If yo u don't kn ow what th is means,  don't use  this metho d.
  35437       </param>
  35438                    
  35439       <returns>
  35440        Z_OK if al l goes wel l.
  35441       </returns>
  35442               
  35443      </member>
  35444              
  35445      <member 
  35446       name="M:Io nic.Zlib.Z libCodec.I nitializeD eflate(Ion ic.Zlib.Co mpressionL evel,Syste m.Int32,Sy stem.Boole an)"
  35447      >
  35448                     
  35449       <summary>
  35450                      Initial ize the Zl ibCodec fo r deflatio n operatio n, using t he specifi ed
  35451                      Compres sionLevel,  the speci fied numbe r of windo w bits, an d the expl icit flag
  35452                      governi ng whether  to emit a n RFC1950  header byt e pair.
  35453                      
  35454       </summary>
  35455                    
  35456                     
  35457       <param 
  35458        name="leve l"
  35459       >
  35460        The compre ssion leve l for the  codec.
  35461       </param>
  35462                     
  35463       <param 
  35464        name="want Rfc1950Hea der"
  35465       >
  35466        whether to  emit an i nitial RFC 1950 byte  pair in th e compress ed stream.
  35467       </param>
  35468                     
  35469       <param 
  35470        name="bits "
  35471       >
  35472        the number  of window  bits to u se.  If yo u don't kn ow what th is means,  don't use  this metho d.
  35473       </param>
  35474                     
  35475       <returns>
  35476        Z_OK if al l goes wel l.
  35477       </returns>
  35478               
  35479      </member>
  35480              
  35481      <member 
  35482       name="M:Io nic.Zlib.Z libCodec.D eflate(Ion ic.Zlib.Fl ushType)"
  35483      >
  35484                    
  35485       <summary>
  35486                     Deflate  one batch  of data.
  35487                     
  35488       </summary>
  35489                    
  35490       <remarks>
  35491                     You must  have set  InputBuffe r and Outp utBuffer b efore call ing this m ethod.
  35492                     
  35493       </remarks>
  35494                    
  35495       <example>
  35496                     
  35497        <code>
  35498                      private  void Defla teBuffer(C ompression Level leve l)
  35499                      {
  35500                          int  bufferSize  = 1024;
  35501                          byte [] buffer  = new byte [bufferSiz e];
  35502                          Zlib Codec comp ressor = n ew ZlibCod ec();
  35503                      
  35504                          Cons ole.WriteL ine("\n=== ========== ========== ========== ========== =");
  35505                          Cons ole.WriteL ine("Size  of Buffer  to Deflate : {0} byte s.", Uncom pressedByt es.Length) ;
  35506                          Memo ryStream m s = new Me moryStream ();
  35507                      
  35508                          int  rc = compr essor.Init ializeDefl ate(level) ;
  35509                      
  35510                          comp ressor.Inp utBuffer =  Uncompres sedBytes;
  35511                          comp ressor.Nex tIn = 0;
  35512                          comp ressor.Ava ilableByte sIn = Unco mpressedBy tes.Length ;
  35513                      
  35514                          comp ressor.Out putBuffer  = buffer;
  35515                      
  35516                          // p ass 1: def late 
  35517                          do
  35518                          {
  35519                               compressor .NextOut =  0;
  35520                               compressor .Available BytesOut =  buffer.Le ngth;
  35521                               rc = compr essor.Defl ate(FlushT ype.None);
  35522                      
  35523                               if (rc !=  ZlibConsta nts.Z_OK & amp;&amp;  rc != Zlib Constants. Z_STREAM_E ND)
  35524                                   throw  new Except ion("defla ting: " +  compressor .Message);
  35525                      
  35526                               ms.Write(c ompressor. OutputBuff er, 0, buf fer.Length  - compres sor.Availa bleBytesOu t);
  35527                          }
  35528                          whil e (compres sor.Availa bleBytesIn  &gt; 0 ||  compresso r.Availabl eBytesOut  == 0);
  35529                      
  35530                          // p ass 2: fin ish and fl ush
  35531                          do
  35532                          {
  35533                               compressor .NextOut =  0;
  35534                               compressor .Available BytesOut =  buffer.Le ngth;
  35535                               rc = compr essor.Defl ate(FlushT ype.Finish );
  35536                      
  35537                               if (rc !=  ZlibConsta nts.Z_STRE AM_END &am p;&amp; rc  != ZlibCo nstants.Z_ OK)
  35538                                   throw  new Except ion("defla ting: " +  compressor .Message);
  35539                      
  35540                               if (buffer .Length -  compressor .Available BytesOut & gt; 0)
  35541                                   ms.Wri te(buffer,  0, buffer .Length -  compressor .Available BytesOut);
  35542                          }
  35543                          whil e (compres sor.Availa bleBytesIn  &gt; 0 ||  compresso r.Availabl eBytesOut  == 0);
  35544                      
  35545                          comp ressor.End Deflate();
  35546                      
  35547                          ms.S eek(0, See kOrigin.Be gin);
  35548                          Comp ressedByte s = new by te[compres sor.TotalB ytesOut];
  35549                          ms.R ead(Compre ssedBytes,  0, Compre ssedBytes. Length);
  35550                      }
  35551                      
  35552        </code>
  35553                     
  35554       </example>
  35555                    
  35556       <param 
  35557        name="flus h"
  35558       >
  35559        whether to  flush all  data as y ou deflate . Generall y you will  want to 
  35560                     use Z_NO _FLUSH her e, in a se ries of ca lls to Def late(), an d then cal l EndDefla te() to 
  35561                     flush ev erything. 
  35562                     
  35563       </param>
  35564                    
  35565       <returns>
  35566        Z_OK if al l goes wel l.
  35567       </returns>
  35568               
  35569      </member>
  35570              
  35571      <member 
  35572       name="M:Io nic.Zlib.Z libCodec.E ndDeflate"
  35573      >
  35574                    
  35575       <summary>
  35576                     End a de flation se ssion.
  35577                     
  35578       </summary>
  35579                    
  35580       <remarks>
  35581                     Call thi s after ma king a ser ies of one  or more c alls to De flate(). A ll buffers  are flush ed.
  35582                     
  35583       </remarks>
  35584                    
  35585       <returns>
  35586        Z_OK if al l goes wel l.
  35587       </returns>
  35588               
  35589      </member>
  35590              
  35591      <member 
  35592       name="M:Io nic.Zlib.Z libCodec.R esetDeflat e"
  35593      >
  35594                    
  35595       <summary>
  35596                     Reset a  codec for  another de flation se ssion.
  35597                     
  35598       </summary>
  35599                    
  35600       <remarks>
  35601                     Call thi s to reset  the defla tion state .  For exa mple if a  thread is  deflating
  35602                     non-cons ecutive bl ocks, you  can call R eset() aft er the Def late(Sync)  of the fi rst
  35603                     block an d before t he next De flate(None ) of the s econd bloc k.
  35604                     
  35605       </remarks>
  35606                    
  35607       <returns>
  35608        Z_OK if al l goes wel l.
  35609       </returns>
  35610               
  35611      </member>
  35612              
  35613      <member 
  35614       name="M:Io nic.Zlib.Z libCodec.S etDeflateP arams(Ioni c.Zlib.Com pressionLe vel,Ionic. Zlib.Compr essionStra tegy)"
  35615      >
  35616                    
  35617       <summary>
  35618                     Set the  Compressio nStrategy  and Compre ssionLevel  for a def lation ses sion.
  35619                     
  35620       </summary>
  35621                    
  35622       <param 
  35623        name="leve l"
  35624       >
  35625        the level  of compres sion to us e.
  35626       </param>
  35627                    
  35628       <param 
  35629        name="stra tegy"
  35630       >
  35631        the strate gy to use  for compre ssion.
  35632       </param>
  35633                    
  35634       <returns>
  35635        Z_OK if al l goes wel l.
  35636       </returns>
  35637               
  35638      </member>
  35639              
  35640      <member 
  35641       name="M:Io nic.Zlib.Z libCodec.S etDictiona ry(System. Byte[])"
  35642      >
  35643                    
  35644       <summary>
  35645                     Set the  dictionary  to be use d for eith er Inflati on or Defl ation.
  35646                     
  35647       </summary>
  35648                    
  35649       <param 
  35650        name="dict ionary"
  35651       >
  35652        The dictio nary bytes  to use.
  35653       </param>
  35654                    
  35655       <returns>
  35656        Z_OK if al l goes wel l.
  35657       </returns>
  35658               
  35659      </member>
  35660              
  35661      <member 
  35662       name="P:Io nic.Zlib.Z libCodec.A dler32"
  35663      >
  35664                    
  35665       <summary>
  35666                     The Adle r32 checks um on the  data trans ferred thr ough the c odec so fa r. You pro bably don' t need to  look at th is.
  35667                     
  35668       </summary>
  35669               
  35670      </member>
  35671              
  35672      <member 
  35673       name="T:Io nic.Zlib.Z libConstan ts"
  35674      >
  35675                    
  35676       <summary>
  35677                     A bunch  of constan ts used in  the Zlib  interface.
  35678                     
  35679       </summary>
  35680               
  35681      </member>
  35682              
  35683      <member 
  35684       name="F:Io nic.Zlib.Z libConstan ts.WindowB itsMax"
  35685      >
  35686                    
  35687       <summary>
  35688                     The maxi mum number  of window  bits for  the Deflat e algorith m.
  35689                     
  35690       </summary>
  35691               
  35692      </member>
  35693              
  35694      <member 
  35695       name="F:Io nic.Zlib.Z libConstan ts.WindowB itsDefault "
  35696      >
  35697                    
  35698       <summary>
  35699                     The defa ult number  of window  bits for  the Deflat e algorith m.
  35700                     
  35701       </summary>
  35702               
  35703      </member>
  35704              
  35705      <member 
  35706       name="F:Io nic.Zlib.Z libConstan ts.Z_OK"
  35707      >
  35708                    
  35709       <summary>
  35710                     indicate s everythi ng is A-OK
  35711                     
  35712       </summary>
  35713               
  35714      </member>
  35715              
  35716      <member 
  35717       name="F:Io nic.Zlib.Z libConstan ts.Z_STREA M_END"
  35718      >
  35719                    
  35720       <summary>
  35721                     Indicate s that the  last oper ation reac hed the en d of the s tream.
  35722                     
  35723       </summary>
  35724               
  35725      </member>
  35726              
  35727      <member 
  35728       name="F:Io nic.Zlib.Z libConstan ts.Z_NEED_ DICT"
  35729      >
  35730                    
  35731       <summary>
  35732                     The oper ation ende d in need  of a dicti onary. 
  35733                     
  35734       </summary>
  35735               
  35736      </member>
  35737              
  35738      <member 
  35739       name="F:Io nic.Zlib.Z libConstan ts.Z_STREA M_ERROR"
  35740      >
  35741                    
  35742       <summary>
  35743                     There wa s an error  with the  stream - n ot enough  data, not  open and r eadable, e tc.
  35744                     
  35745       </summary>
  35746               
  35747      </member>
  35748              
  35749      <member 
  35750       name="F:Io nic.Zlib.Z libConstan ts.Z_DATA_ ERROR"
  35751      >
  35752                    
  35753       <summary>
  35754                     There wa s an error  with the  data - not  enough da ta, bad da ta, etc.
  35755                     
  35756       </summary>
  35757               
  35758      </member>
  35759              
  35760      <member 
  35761       name="F:Io nic.Zlib.Z libConstan ts.Z_BUF_E RROR"
  35762      >
  35763                    
  35764       <summary>
  35765                     There wa s an error  with the  working bu ffer.
  35766                     
  35767       </summary>
  35768               
  35769      </member>
  35770              
  35771      <member 
  35772       name="F:Io nic.Zlib.Z libConstan ts.Working BufferSize Default"
  35773      >
  35774                    
  35775       <summary>
  35776                     The size  of the wo rking buff er used in  the ZlibC odec class . Defaults  to 8192 b ytes.
  35777                     
  35778       </summary>
  35779               
  35780      </member>
  35781              
  35782      <member 
  35783       name="F:Io nic.Zlib.Z libConstan ts.Working BufferSize Min"
  35784      >
  35785                    
  35786       <summary>
  35787                     The mini mum size o f the work ing buffer  used in t he ZlibCod ec class.   Currently  it is 128  bytes.
  35788                     
  35789       </summary>
  35790               
  35791      </member>
  35792              
  35793      <member 
  35794       name="T:Io nic.Zlib.Z libStream"
  35795      >
  35796                     
  35797       <summary>
  35798                      Represe nts a Zlib  stream fo r compress ion or dec ompression .
  35799                      
  35800       </summary>
  35801                     
  35802       <remarks>
  35803                     
  35804                      
  35805        <para>
  35806                       The Zli bStream is  a 
  35807         <see 
  35808          href="http ://en.wiki pedia.org/ wiki/Decor ator_patte rn"
  35809         >
  35810          Decorator
  35811         </see>
  35812          on a 
  35813         <see 
  35814          cref="T:Sy stem.IO.St ream"
  35815         />
  35816         .  It adds  ZLIB comp ression or  decompres sion to an y
  35817                       stream.
  35818                       
  35819        </para>
  35820                     
  35821                      
  35822        <para>
  35823          Using thi s stream,  applicatio ns can com press or d ecompress  data via
  35824                       stream 
  35825         <c>
  35826          Read()
  35827         </c>
  35828          and 
  35829         <c>
  35830          Write()
  35831         </c>
  35832          operation s.  Either  compresss ion or
  35833                       decompr ession can  occur thr ough eithe r reading  or writing . The comp ression
  35834                       format  used is ZL IB, which  is documen ted in 
  35835         <see 
  35836          href="http ://www.iet f.org/rfc/ rfc1950.tx t"
  35837         >
  35838          IETF RFC 1 950
  35839         </see>
  35840         , "ZLIB Co mpressed
  35841                       Data Fo rmat Speci fication v ersion 3.3 ". This im plementati on of ZLIB  always us es
  35842                       DEFLATE  as the co mpression  method.  ( see 
  35843         <see 
  35844          href="http ://www.iet f.org/rfc/ rfc1951.tx t"
  35845         >
  35846          IETF RFC 1 951
  35847         </see>
  35848         , "DEFLATE
  35849                       Compres sed Data F ormat Spec ification  version 1. 3.") 
  35850        </para>
  35851                     
  35852                      
  35853        <para>
  35854                       The ZLI B format a llows for  varying co mpression  methods, w indow size s, and dic tionaries.
  35855                       This im plementati on always  uses the D EFLATE com pression m ethod, a p reset dict ionary,
  35856                       and 15  window bit s by defau lt.
  35857                       
  35858        </para>
  35859                     
  35860                      
  35861        <para>
  35862                       This cl ass is sim ilar to 
  35863         <see 
  35864          cref="T:Io nic.Zlib.D eflateStre am"
  35865         />
  35866         , except t hat it add s the
  35867                       RFC1950  header an d trailer  bytes to a  compresse d stream w hen compre ssing, or  expects
  35868                       the RFC 1950 heade r and trai ler bytes  when decom pressing.   It is als o similar  to the
  35869                       
  35870         <see 
  35871          cref="T:Io nic.Zlib.G ZipStream"
  35872         />
  35873         .
  35874                       
  35875        </para>
  35876                      
  35877       </remarks>
  35878                     
  35879       <seealso 
  35880        cref="T:Io nic.Zlib.D eflateStre am"
  35881       />
  35882                     
  35883       <seealso 
  35884        cref="T:Io nic.Zlib.G ZipStream"
  35885       />
  35886               
  35887      </member>
  35888              
  35889      <member 
  35890       name="M:Io nic.Zlib.Z libStream. #ctor(Syst em.IO.Stre am,Ionic.Z lib.Compre ssionMode) "
  35891      >
  35892                     
  35893       <summary>
  35894                      Create 
  35895        <c>
  35896         ZlibStream
  35897        </c>
  35898         using the  specified  
  35899        <c>
  35900         Compressio nMode
  35901        </c>
  35902        .
  35903                      
  35904       </summary>
  35905                     
  35906       <remarks>
  35907                     
  35908                      
  35909        <para>
  35910                         When  mode is 
  35911         <c>
  35912          Compressio nMode.Comp ress
  35913         </c>
  35914         , the 
  35915         <c>
  35916          ZlibStream
  35917         </c>
  35918                         will  use the de fault comp ression le vel. The " captive" s tream will  be
  35919                         close d when the  
  35920         <c>
  35921          ZlibStream
  35922         </c>
  35923          is closed .
  35924                       
  35925        </para>
  35926                     
  35927                      
  35928       </remarks>
  35929                    
  35930                     
  35931       <example>
  35932                      This ex ample uses  a 
  35933        <c>
  35934         ZlibStream
  35935        </c>
  35936         to compre ss a file,  and write s the
  35937                      compres sed data t o another  file.
  35938                      
  35939        <code>
  35940                       using ( System.IO. Stream inp ut = Syste m.IO.File. OpenRead(f ileToCompr ess))
  35941                       {
  35942                           usi ng (var ra w = System .IO.File.C reate(file ToCompress  + ".zlib" ))
  35943                           {
  35944                                using (St ream compr essor = ne w ZlibStre am(raw, Co mpressionM ode.Compre ss))
  35945                                {
  35946                                    byte[ ] buffer =  new byte[ WORKING_BU FFER_SIZE] ;
  35947                                    int n ;
  35948                                    while  ((n= inpu t.Read(buf fer, 0, bu ffer.Lengt h)) != 0)
  35949                                    {
  35950                                        c ompressor. Write(buff er, 0, n);
  35951                                    }
  35952                                }
  35953                           }
  35954                       }
  35955                       
  35956        </code>
  35957                      
  35958        <code 
  35959         lang="VB"
  35960        >
  35961                       Using i nput As St ream = Fil e.OpenRead (fileToCom press)
  35962                           Usi ng raw As  FileStream  = File.Cr eate(fileT oCompress  &amp; ".zl ib")
  35963                           Usi ng compres sor As Str eam = New  ZlibStream (raw, Comp ressionMod e.Compress )
  35964                                Dim buffe r As Byte( ) = New By te(4096) { }
  35965                                Dim n As  Integer =  -1
  35966                                Do While  (n &lt;&gt ; 0)
  35967                                    If (n  &gt; 0) T hen
  35968                                        c ompressor. Write(buff er, 0, n)
  35969                                    End I f
  35970                                    n = i nput.Read( buffer, 0,  buffer.Le ngth)
  35971                                Loop
  35972                           End  Using
  35973                           End  Using
  35974                       End Usi ng
  35975                       
  35976        </code>
  35977                      
  35978       </example>
  35979                    
  35980                     
  35981       <param 
  35982        name="stre am"
  35983       >
  35984        The stream  which wil l be read  or written .
  35985       </param>
  35986                     
  35987       <param 
  35988        name="mode "
  35989       >
  35990        Indicates  whether th e ZlibStre am will co mpress or  decompress .
  35991       </param>
  35992               
  35993      </member>
  35994              
  35995      <member 
  35996       name="M:Io nic.Zlib.Z libStream. #ctor(Syst em.IO.Stre am,Ionic.Z lib.Compre ssionMode, Ionic.Zlib .Compressi onLevel)"
  35997      >
  35998                     
  35999       <summary>
  36000                        Creat e a 
  36001        <c>
  36002         ZlibStream
  36003        </c>
  36004         using the  specified  
  36005        <c>
  36006         Compressio nMode
  36007        </c>
  36008         and
  36009                        the s pecified 
  36010        <c>
  36011         Compressio nLevel
  36012        </c>
  36013        .
  36014                      
  36015       </summary>
  36016                    
  36017                     
  36018       <remarks>
  36019                     
  36020                      
  36021        <para>
  36022                         When  mode is 
  36023         <c>
  36024          Compressio nMode.Deco mpress
  36025         </c>
  36026         , the leve l paramete r is ignor ed.
  36027                         The " captive" s tream will  be closed  when the 
  36028         <c>
  36029          ZlibStream
  36030         </c>
  36031          is closed .
  36032                       
  36033        </para>
  36034                     
  36035                      
  36036       </remarks>
  36037                    
  36038                     
  36039       <example>
  36040                        This  example us es a 
  36041        <c>
  36042         ZlibStream
  36043        </c>
  36044         to compre ss data fr om a file,  and write s the
  36045                        compr essed data  to anothe r file.
  36046                     
  36047                      
  36048        <code>
  36049                       using ( System.IO. Stream inp ut = Syste m.IO.File. OpenRead(f ileToCompr ess))
  36050                       {
  36051                           usi ng (var ra w = System .IO.File.C reate(file ToCompress  + ".zlib" ))
  36052                           {
  36053                                using (St ream compr essor = ne w ZlibStre am(raw,
  36054                                                                              Compres sionMode.C ompress,
  36055                                                                              Compres sionLevel. BestCompre ssion))
  36056                                {
  36057                                    byte[ ] buffer =  new byte[ WORKING_BU FFER_SIZE] ;
  36058                                    int n ;
  36059                                    while  ((n= inpu t.Read(buf fer, 0, bu ffer.Lengt h)) != 0)
  36060                                    {
  36061                                        c ompressor. Write(buff er, 0, n);
  36062                                    }
  36063                                }
  36064                           }
  36065                       }
  36066                       
  36067        </code>
  36068                     
  36069                      
  36070        <code 
  36071         lang="VB"
  36072        >
  36073                       Using i nput As St ream = Fil e.OpenRead (fileToCom press)
  36074                           Usi ng raw As  FileStream  = File.Cr eate(fileT oCompress  &amp; ".zl ib")
  36075                                Using com pressor As  Stream =  New ZlibSt ream(raw,  Compressio nMode.Comp ress, Comp ressionLev el.BestCom pression)
  36076                                    Dim b uffer As B yte() = Ne w Byte(409 6) {}
  36077                                    Dim n  As Intege r = -1
  36078                                    Do Wh ile (n &lt ;&gt; 0)
  36079                                        I f (n &gt;  0) Then
  36080                                             compres sor.Write( buffer, 0,  n)
  36081                                        E nd If
  36082                                        n  = input.R ead(buffer , 0, buffe r.Length)
  36083                                    Loop
  36084                                End Using
  36085                           End  Using
  36086                       End Usi ng
  36087                       
  36088        </code>
  36089                      
  36090       </example>
  36091                    
  36092                     
  36093       <param 
  36094        name="stre am"
  36095       >
  36096        The stream  to be rea d or writt en while d eflating o r inflatin g.
  36097       </param>
  36098                     
  36099       <param 
  36100        name="mode "
  36101       >
  36102        Indicates  whether th e ZlibStre am will co mpress or  decompress .
  36103       </param>
  36104                     
  36105       <param 
  36106        name="leve l"
  36107       >
  36108        A tuning k nob to tra de speed f or effecti veness.
  36109       </param>
  36110               
  36111      </member>
  36112              
  36113      <member 
  36114       name="M:Io nic.Zlib.Z libStream. #ctor(Syst em.IO.Stre am,Ionic.Z lib.Compre ssionMode, System.Boo lean)"
  36115      >
  36116                     
  36117       <summary>
  36118                        Creat e a 
  36119        <c>
  36120         ZlibStream
  36121        </c>
  36122         using the  specified  
  36123        <c>
  36124         Compressio nMode
  36125        </c>
  36126        , and
  36127                        expli citly spec ify whethe r the capt ive stream  should be  left open  after
  36128                        Defla tion or In flation.
  36129                      
  36130       </summary>
  36131                    
  36132                     
  36133       <remarks>
  36134                     
  36135                      
  36136        <para>
  36137                         When  mode is 
  36138         <c>
  36139          Compressio nMode.Comp ress
  36140         </c>
  36141         , the 
  36142         <c>
  36143          ZlibStream
  36144         </c>
  36145          will use
  36146                         the d efault com pression l evel.
  36147                       
  36148        </para>
  36149                     
  36150                      
  36151        <para>
  36152                         This  constructo r allows t he applica tion to re quest that  the capti ve stream
  36153                         remai n open aft er the def lation or  inflation  occurs.  B y default,  after
  36154                         
  36155         <c>
  36156          Close()
  36157         </c>
  36158          is called  on the st ream, the  captive st ream is al so
  36159                         close d. In some  cases thi s is not d esired, fo r example  if the str eam is a
  36160                         
  36161         <see 
  36162          cref="T:Sy stem.IO.Me moryStream "
  36163         />
  36164          that will  be re-rea d after
  36165                         compr ession.  S pecify tru e for the 
  36166         <paramref 
  36167          name="leav eOpen"
  36168         />
  36169          parameter  to leave  the stream
  36170                         open.
  36171                       
  36172        </para>
  36173                     
  36174                      
  36175        <para>
  36176                       See the  other ove rloads of  this const ructor for  example c ode.
  36177                       
  36178        </para>
  36179                     
  36180                      
  36181       </remarks>
  36182                    
  36183                     
  36184       <param 
  36185        name="stre am"
  36186       >
  36187        The stream  which wil l be read  or written . This is  called the
  36188                      "captiv e" stream  in other p laces in t his docume ntation.
  36189       </param>
  36190                     
  36191       <param 
  36192        name="mode "
  36193       >
  36194        Indicates  whether th e ZlibStre am will co mpress or  decompress .
  36195       </param>
  36196                     
  36197       <param 
  36198        name="leav eOpen"
  36199       >
  36200        true if th e applicat ion would  like the s tream to r emain
  36201                      open af ter inflat ion/deflat ion.
  36202       </param>
  36203               
  36204      </member>
  36205              
  36206      <member 
  36207       name="M:Io nic.Zlib.Z libStream. #ctor(Syst em.IO.Stre am,Ionic.Z lib.Compre ssionMode, Ionic.Zlib .Compressi onLevel,Sy stem.Boole an)"
  36208      >
  36209                     
  36210       <summary>
  36211                        Creat e a 
  36212        <c>
  36213         ZlibStream
  36214        </c>
  36215         using the  specified  
  36216        <c>
  36217         Compressio nMode
  36218        </c>
  36219                        and t he specifi ed 
  36220        <c>
  36221         Compressio nLevel
  36222        </c>
  36223        , and expl icitly spe cify
  36224                        wheth er the str eam should  be left o pen after  Deflation  or Inflati on.
  36225                      
  36226       </summary>
  36227                    
  36228                     
  36229       <remarks>
  36230                     
  36231                      
  36232        <para>
  36233                         This  constructo r allows t he applica tion to re quest that  the capti ve
  36234                         strea m remain o pen after  the deflat ion or inf lation occ urs.  By
  36235                         defau lt, after 
  36236         <c>
  36237          Close()
  36238         </c>
  36239          is called  on the st ream, the  captive
  36240                         strea m is also  closed. In  some case s this is  not desire d, for exa mple
  36241                         if th e stream i s a 
  36242         <see 
  36243          cref="T:Sy stem.IO.Me moryStream "
  36244         />
  36245          that will  be
  36246                         re-re ad after c ompression .  Specify  true for  the 
  36247         <paramref 
  36248          name="leav eOpen"
  36249         />
  36250          parameter  to leave  the stream  open.
  36251                       
  36252        </para>
  36253                     
  36254                      
  36255        <para>
  36256                         When  mode is 
  36257         <c>
  36258          Compressio nMode.Deco mpress
  36259         </c>
  36260         , the leve l paramete r is
  36261                         ignor ed.
  36262                       
  36263        </para>
  36264                     
  36265                      
  36266       </remarks>
  36267                    
  36268                     
  36269       <example>
  36270                     
  36271                      This ex ample show s how to u se a ZlibS tream to c ompress th e data fro m a file,
  36272                      and sto re the res ult into a nother fil e. The fil estream re mains open  to allow
  36273                      additio nal data t o be writt en to it.
  36274                     
  36275                      
  36276        <code>
  36277                       using ( var output  = System. IO.File.Cr eate(fileT oCompress  + ".zlib") )
  36278                       {
  36279                           usi ng (System .IO.Stream  input = S ystem.IO.F ile.OpenRe ad(fileToC ompress))
  36280                           {
  36281                                using (St ream compr essor = ne w ZlibStre am(output,  Compressi onMode.Com press, Com pressionLe vel.BestCo mpression,  true))
  36282                                {
  36283                                    byte[ ] buffer =  new byte[ WORKING_BU FFER_SIZE] ;
  36284                                    int n ;
  36285                                    while  ((n= inpu t.Read(buf fer, 0, bu ffer.Lengt h)) != 0)
  36286                                    {
  36287                                        c ompressor. Write(buff er, 0, n);
  36288                                    }
  36289                                }
  36290                           }
  36291                           //  can write  additional  data to t he output  stream her e
  36292                       }
  36293                       
  36294        </code>
  36295                      
  36296        <code 
  36297         lang="VB"
  36298        >
  36299                       Using o utput As F ileStream  = File.Cre ate(fileTo Compress & amp; ".zli b")
  36300                           Usi ng input A s Stream =  File.Open Read(fileT oCompress)
  36301                                Using com pressor As  Stream =  New ZlibSt ream(outpu t, Compres sionMode.C ompress, C ompression Level.Best Compressio n, True)
  36302                                    Dim b uffer As B yte() = Ne w Byte(409 6) {}
  36303                                    Dim n  As Intege r = -1
  36304                                    Do Wh ile (n &lt ;&gt; 0)
  36305                                        I f (n &gt;  0) Then
  36306                                             compres sor.Write( buffer, 0,  n)
  36307                                        E nd If
  36308                                        n  = input.R ead(buffer , 0, buffe r.Length)
  36309                                    Loop
  36310                                End Using
  36311                           End  Using
  36312                           ' c an write a dditional  data to th e output s tream here .
  36313                       End Usi ng
  36314                       
  36315        </code>
  36316                      
  36317       </example>
  36318                    
  36319                     
  36320       <param 
  36321        name="stre am"
  36322       >
  36323        The stream  which wil l be read  or written .
  36324       </param>
  36325                    
  36326                     
  36327       <param 
  36328        name="mode "
  36329       >
  36330        Indicates  whether th e ZlibStre am will co mpress or  decompress .
  36331       </param>
  36332                    
  36333                     
  36334       <param 
  36335        name="leav eOpen"
  36336       >
  36337                      true if  the appli cation wou ld like th e stream t o remain o pen after
  36338                      inflati on/deflati on.
  36339                      
  36340       </param>
  36341                    
  36342                     
  36343       <param 
  36344        name="leve l"
  36345       >
  36346                      A tunin g knob to  trade spee d for effe ctiveness.  This para meter is
  36347                      effecti ve only wh en mode is  
  36348        <c>
  36349         Compressio nMode.Comp ress
  36350        </c>
  36351        .
  36352                      
  36353       </param>
  36354               
  36355      </member>
  36356              
  36357      <member 
  36358       name="M:Io nic.Zlib.Z libStream. Dispose(Sy stem.Boole an)"
  36359      >
  36360                    
  36361       <summary>
  36362                       Dispos e the stre am.
  36363                     
  36364       </summary>
  36365                    
  36366       <remarks>
  36367                       
  36368        <para>
  36369                          This  may or ma y not resu lt in a 
  36370         <c>
  36371          Close()
  36372         </c>
  36373          call on t he captive
  36374                          stre am.  See t he constru ctors that  have a 
  36375         <c>
  36376          leaveOpen
  36377         </c>
  36378          parameter
  36379                          for  more infor mation.
  36380                        
  36381        </para>
  36382                       
  36383        <para>
  36384                          This  method ma y be invok ed in two  distinct s cenarios.   If dispos ing
  36385                          == t rue, the m ethod has  been calle d directly  or indire ctly by a
  36386                          user 's code, f or example  via the p ublic Disp ose() meth od. In thi s
  36387                          case , both man aged and u nmanaged r esources c an be refe renced and
  36388                          disp osed.  If  disposing  == false,  the method  has been  called by  the
  36389                          runt ime from i nside the  object fin alizer and  this meth od should  not
  36390                          refe rence othe r objects;  in that c ase only u nmanaged r esources m ust
  36391                          be r eferenced  or dispose d.
  36392                        
  36393        </para>
  36394                     
  36395       </remarks>
  36396                    
  36397       <param 
  36398        name="disp osing"
  36399       >
  36400                       indica tes whethe r the Disp ose method  was invok ed by user  code.
  36401                     
  36402       </param>
  36403               
  36404      </member>
  36405              
  36406      <member 
  36407       name="M:Io nic.Zlib.Z libStream. Flush"
  36408      >
  36409                    
  36410       <summary>
  36411                     Flush th e stream.
  36412                     
  36413       </summary>
  36414               
  36415      </member>
  36416              
  36417      <member 
  36418       name="M:Io nic.Zlib.Z libStream. Read(Syste m.Byte[],S ystem.Int3 2,System.I nt32)"
  36419      >
  36420                     
  36421       <summary>
  36422                      Read da ta from th e stream.
  36423                      
  36424       </summary>
  36425                    
  36426                     
  36427       <remarks>
  36428                     
  36429                      
  36430        <para>
  36431                         If yo u wish to  use the 
  36432         <c>
  36433          ZlibStream
  36434         </c>
  36435          to compre ss data wh ile readin g,
  36436                         you c an create 
  36437         <c>
  36438          ZlibStream
  36439         </c>
  36440          with 
  36441         <c>
  36442          Compressio nMode.Comp ress
  36443         </c>
  36444         ,
  36445                         provi ding an un compressed  data stre am.  Then  call 
  36446         <c>
  36447          Read()
  36448         </c>
  36449          on that
  36450                         
  36451         <c>
  36452          ZlibStream
  36453         </c>
  36454         , and the  data read  will be co mpressed.   If you wi sh to
  36455                         use t he 
  36456         <c>
  36457          ZlibStream
  36458         </c>
  36459          to decomp ress data  while read ing, you c an create
  36460                         a 
  36461         <c>
  36462          ZlibStream
  36463         </c>
  36464          with 
  36465         <c>
  36466          Compressio nMode.Deco mpress
  36467         </c>
  36468         , providin g a
  36469                         reada ble compre ssed data  stream.  T hen call 
  36470         <c>
  36471          Read()
  36472         </c>
  36473          on that
  36474                         
  36475         <c>
  36476          ZlibStream
  36477         </c>
  36478         , and the  data will  be decompr essed as i t is read.
  36479                       
  36480        </para>
  36481                     
  36482                      
  36483        <para>
  36484                         A 
  36485         <c>
  36486          ZlibStream
  36487         </c>
  36488          can be us ed for 
  36489         <c>
  36490          Read()
  36491         </c>
  36492          or 
  36493         <c>
  36494          Write()
  36495         </c>
  36496         , but
  36497                         not b oth.
  36498                       
  36499        </para>
  36500                     
  36501                      
  36502       </remarks>
  36503                    
  36504                     
  36505       <param 
  36506        name="buff er"
  36507       >
  36508                      The buf fer into w hich the r ead data s hould be p laced.
  36509       </param>
  36510                    
  36511                     
  36512       <param 
  36513        name="offs et"
  36514       >
  36515                      the off set within  that data  array to  put the fi rst byte r ead.
  36516       </param>
  36517                    
  36518                     
  36519       <param 
  36520        name="coun t"
  36521       >
  36522        the number  of bytes  to read.
  36523       </param>
  36524                    
  36525                     
  36526       <returns>
  36527        the number  of bytes  read
  36528       </returns>
  36529               
  36530      </member>
  36531              
  36532      <member 
  36533       name="M:Io nic.Zlib.Z libStream. Seek(Syste m.Int64,Sy stem.IO.Se ekOrigin)"
  36534      >
  36535                     
  36536       <summary>
  36537                      Calling  this meth od always  throws a 
  36538        <see 
  36539         cref="T:Sy stem.NotSu pportedExc eption"
  36540        />
  36541        .
  36542                      
  36543       </summary>
  36544                     
  36545       <param 
  36546        name="offs et"
  36547       >
  36548                        The o ffset to s eek to....
  36549                        IF TH IS METHOD  ACTUALLY D ID ANYTHIN G.
  36550                      
  36551       </param>
  36552                     
  36553       <param 
  36554        name="orig in"
  36555       >
  36556                        The r eference s pecifying  how to app ly the off set....  I F
  36557                        THIS  METHOD ACT UALLY DID  ANYTHING.
  36558                      
  36559       </param>
  36560                    
  36561                     
  36562       <returns>
  36563        nothing. T his method  always th rows.
  36564       </returns>
  36565               
  36566      </member>
  36567              
  36568      <member 
  36569       name="M:Io nic.Zlib.Z libStream. SetLength( System.Int 64)"
  36570      >
  36571                    
  36572       <summary>
  36573                     Calling  this metho d always t hrows a 
  36574        <see 
  36575         cref="T:Sy stem.NotSu pportedExc eption"
  36576        />
  36577        .
  36578                     
  36579       </summary>
  36580                    
  36581       <param 
  36582        name="valu e"
  36583       >
  36584                       The ne w value fo r the stre am length. ...  IF
  36585                       THIS M ETHOD ACTU ALLY DID A NYTHING.
  36586                     
  36587       </param>
  36588               
  36589      </member>
  36590              
  36591      <member 
  36592       name="M:Io nic.Zlib.Z libStream. Write(Syst em.Byte[], System.Int 32,System. Int32)"
  36593      >
  36594                     
  36595       <summary>
  36596                      Write d ata to the  stream.
  36597                      
  36598       </summary>
  36599                    
  36600                     
  36601       <remarks>
  36602                     
  36603                      
  36604        <para>
  36605                         If yo u wish to  use the 
  36606         <c>
  36607          ZlibStream
  36608         </c>
  36609          to compre ss data wh ile writin g,
  36610                         you c an create 
  36611         <c>
  36612          ZlibStream
  36613         </c>
  36614          with 
  36615         <c>
  36616          Compressio nMode.Comp ress
  36617         </c>
  36618         ,
  36619                         and a  writable  output str eam.  Then  call 
  36620         <c>
  36621          Write()
  36622         </c>
  36623          on that
  36624                         
  36625         <c>
  36626          ZlibStream
  36627         </c>
  36628         , providin g uncompre ssed data  as input.   The data  sent to
  36629                         the o utput stre am will be  the compr essed form  of the da ta written .  If you
  36630                         wish  to use the  
  36631         <c>
  36632          ZlibStream
  36633         </c>
  36634          to decomp ress data  while writ ing, you
  36635                         can c reate a 
  36636         <c>
  36637          ZlibStream
  36638         </c>
  36639          with 
  36640         <c>
  36641          Compressio nMode.Deco mpress
  36642         </c>
  36643         , and a
  36644                         writa ble output  stream.   Then call 
  36645         <c>
  36646          Write()
  36647         </c>
  36648          on that s tream,
  36649                         provi ding previ ously comp ressed dat a. The dat a sent to  the output  stream
  36650                         will  be the dec ompressed  form of th e data wri tten.
  36651                       
  36652        </para>
  36653                     
  36654                      
  36655        <para>
  36656                         A 
  36657         <c>
  36658          ZlibStream
  36659         </c>
  36660          can be us ed for 
  36661         <c>
  36662          Read()
  36663         </c>
  36664          or 
  36665         <c>
  36666          Write()
  36667         </c>
  36668         , but not  both.
  36669                       
  36670        </para>
  36671                      
  36672       </remarks>
  36673                     
  36674       <param 
  36675        name="buff er"
  36676       >
  36677        The buffer  holding d ata to wri te to the  stream.
  36678       </param>
  36679                     
  36680       <param 
  36681        name="offs et"
  36682       >
  36683        the offset  within th at data ar ray to fin d the firs t byte to  write.
  36684       </param>
  36685                     
  36686       <param 
  36687        name="coun t"
  36688       >
  36689        the number  of bytes  to write.
  36690       </param>
  36691               
  36692      </member>
  36693              
  36694      <member 
  36695       name="M:Io nic.Zlib.Z libStream. CompressSt ring(Syste m.String)"
  36696      >
  36697                     
  36698       <summary>
  36699                        Compr ess a stri ng into a  byte array  using ZLI B.
  36700                      
  36701       </summary>
  36702                    
  36703                     
  36704       <remarks>
  36705                        Uncom press it w ith 
  36706        <see 
  36707         cref="M:Io nic.Zlib.Z libStream. Uncompress String(Sys tem.Byte[] )"
  36708        />
  36709        .
  36710                      
  36711       </remarks>
  36712                    
  36713                     
  36714       <seealso 
  36715        cref="M:Io nic.Zlib.Z libStream. Uncompress String(Sys tem.Byte[] )"
  36716       />
  36717                     
  36718       <seealso 
  36719        cref="M:Io nic.Zlib.Z libStream. CompressBu ffer(Syste m.Byte[])"
  36720       />
  36721                     
  36722       <seealso 
  36723        cref="M:Io nic.Zlib.G ZipStream. CompressSt ring(Syste m.String)"
  36724       />
  36725                    
  36726                     
  36727       <param 
  36728        name="s"
  36729       >
  36730                        A str ing to com press.  Th e string w ill first  be encoded
  36731                        using  UTF8, the n compress ed.
  36732                      
  36733       </param>
  36734                    
  36735                     
  36736       <returns>
  36737        The string  in compre ssed form
  36738       </returns>
  36739               
  36740      </member>
  36741              
  36742      <member 
  36743       name="M:Io nic.Zlib.Z libStream. CompressBu ffer(Syste m.Byte[])"
  36744      >
  36745                     
  36746       <summary>
  36747                        Compr ess a byte  array int o a new by te array u sing ZLIB.
  36748                      
  36749       </summary>
  36750                    
  36751                     
  36752       <remarks>
  36753                        Uncom press it w ith 
  36754        <see 
  36755         cref="M:Io nic.Zlib.Z libStream. Uncompress Buffer(Sys tem.Byte[] )"
  36756        />
  36757        .
  36758                      
  36759       </remarks>
  36760                    
  36761                     
  36762       <seealso 
  36763        cref="M:Io nic.Zlib.Z libStream. CompressSt ring(Syste m.String)"
  36764       />
  36765                     
  36766       <seealso 
  36767        cref="M:Io nic.Zlib.Z libStream. Uncompress Buffer(Sys tem.Byte[] )"
  36768       />
  36769                    
  36770                     
  36771       <param 
  36772        name="b"
  36773       >
  36774                      A buffe r to compr ess.
  36775                      
  36776       </param>
  36777                    
  36778                     
  36779       <returns>
  36780        The data i n compress ed form
  36781       </returns>
  36782               
  36783      </member>
  36784              
  36785      <member 
  36786       name="M:Io nic.Zlib.Z libStream. Uncompress String(Sys tem.Byte[] )"
  36787      >
  36788                     
  36789       <summary>
  36790                        Uncom press a ZL IB-compres sed byte a rray into  a single s tring.
  36791                      
  36792       </summary>
  36793                    
  36794                     
  36795       <seealso 
  36796        cref="M:Io nic.Zlib.Z libStream. CompressSt ring(Syste m.String)"
  36797       />
  36798                     
  36799       <seealso 
  36800        cref="M:Io nic.Zlib.Z libStream. Uncompress Buffer(Sys tem.Byte[] )"
  36801       />
  36802                    
  36803                     
  36804       <param 
  36805        name="comp ressed"
  36806       >
  36807                        A buf fer contai ning ZLIB- compressed  data.
  36808                      
  36809       </param>
  36810                    
  36811                     
  36812       <returns>
  36813        The uncomp ressed str ing
  36814       </returns>
  36815               
  36816      </member>
  36817              
  36818      <member 
  36819       name="M:Io nic.Zlib.Z libStream. Uncompress Buffer(Sys tem.Byte[] )"
  36820      >
  36821                     
  36822       <summary>
  36823                        Uncom press a ZL IB-compres sed byte a rray into  a byte arr ay.
  36824                      
  36825       </summary>
  36826                    
  36827                     
  36828       <seealso 
  36829        cref="M:Io nic.Zlib.Z libStream. CompressBu ffer(Syste m.Byte[])"
  36830       />
  36831                     
  36832       <seealso 
  36833        cref="M:Io nic.Zlib.Z libStream. Uncompress String(Sys tem.Byte[] )"
  36834       />
  36835                    
  36836                     
  36837       <param 
  36838        name="comp ressed"
  36839       >
  36840                        A buf fer contai ning ZLIB- compressed  data.
  36841                      
  36842       </param>
  36843                    
  36844                     
  36845       <returns>
  36846        The data i n uncompre ssed form
  36847       </returns>
  36848               
  36849      </member>
  36850              
  36851      <member 
  36852       name="P:Io nic.Zlib.Z libStream. FlushMode"
  36853      >
  36854                    
  36855       <summary>
  36856                     This pro perty sets  the flush  behavior  on the str eam.
  36857                     Sorry, t hough, not  sure exac tly how to  describe  all the va rious sett ings.
  36858                     
  36859       </summary>
  36860               
  36861      </member>
  36862              
  36863      <member 
  36864       name="P:Io nic.Zlib.Z libStream. BufferSize "
  36865      >
  36866                     
  36867       <summary>
  36868                        The s ize of the  working b uffer for  the compre ssion code c.
  36869                      
  36870       </summary>
  36871                    
  36872                     
  36873       <remarks>
  36874                      
  36875        <para>
  36876                         The w orking buf fer is use d for all  stream ope rations.   The defaul t size is
  36877                         1024  bytes. The  minimum s ize is 128  bytes. Yo u may get  better per formance
  36878                         with  a larger b uffer.  Th en again,  you might  not.  You  would have  to test
  36879                         it.
  36880                       
  36881        </para>
  36882                     
  36883                      
  36884        <para>
  36885                         Set t his before  the first  call to 
  36886         <c>
  36887          Read()
  36888         </c>
  36889          or 
  36890         <c>
  36891          Write()
  36892         </c>
  36893          on the
  36894                         strea m. If you  try to set  it afterw ards, it w ill throw.
  36895                       
  36896        </para>
  36897                      
  36898       </remarks>
  36899               
  36900      </member>
  36901              
  36902      <member 
  36903       name="P:Io nic.Zlib.Z libStream. TotalIn"
  36904      >
  36905                    
  36906       <summary>
  36907         Returns t he total n umber of b ytes input  so far.
  36908       </summary>
  36909               
  36910      </member>
  36911              
  36912      <member 
  36913       name="P:Io nic.Zlib.Z libStream. TotalOut"
  36914      >
  36915                    
  36916       <summary>
  36917         Returns t he total n umber of b ytes outpu t so far.
  36918       </summary>
  36919               
  36920      </member>
  36921              
  36922      <member 
  36923       name="P:Io nic.Zlib.Z libStream. CanRead"
  36924      >
  36925                    
  36926       <summary>
  36927                     Indicate s whether  the stream  can be re ad.
  36928                     
  36929       </summary>
  36930                    
  36931       <remarks>
  36932                     The retu rn value d epends on  whether th e captive  stream sup ports read ing.
  36933                     
  36934       </remarks>
  36935               
  36936      </member>
  36937              
  36938      <member 
  36939       name="P:Io nic.Zlib.Z libStream. CanSeek"
  36940      >
  36941                    
  36942       <summary>
  36943                     Indicate s whether  the stream  supports  Seek opera tions.
  36944                     
  36945       </summary>
  36946                    
  36947       <remarks>
  36948                     Always r eturns fal se.
  36949                     
  36950       </remarks>
  36951               
  36952      </member>
  36953              
  36954      <member 
  36955       name="P:Io nic.Zlib.Z libStream. CanWrite"
  36956      >
  36957                    
  36958       <summary>
  36959                     Indicate s whether  the stream  can be wr itten.
  36960                     
  36961       </summary>
  36962                    
  36963       <remarks>
  36964                     The retu rn value d epends on  whether th e captive  stream sup ports writ ing.
  36965                     
  36966       </remarks>
  36967               
  36968      </member>
  36969              
  36970      <member 
  36971       name="P:Io nic.Zlib.Z libStream. Length"
  36972      >
  36973                    
  36974       <summary>
  36975                     Reading  this prope rty always  throws a 
  36976        <see 
  36977         cref="T:Sy stem.NotSu pportedExc eption"
  36978        />
  36979        .
  36980                     
  36981       </summary>
  36982               
  36983      </member>
  36984              
  36985      <member 
  36986       name="P:Io nic.Zlib.Z libStream. Position"
  36987      >
  36988                     
  36989       <summary>
  36990                        The p osition of  the strea m pointer.
  36991                      
  36992       </summary>
  36993                    
  36994                     
  36995       <remarks>
  36996                        Setti ng this pr operty alw ays throws  a 
  36997        <see 
  36998         cref="T:Sy stem.NotSu pportedExc eption"
  36999        />
  37000        . Reading  will retur n the tota l bytes
  37001                        writt en out, if  used in w riting, or  the total  bytes rea d in, if u sed in
  37002                        readi ng.  The c ount may r efer to co mpressed b ytes or un compressed  bytes,
  37003                        depen ding on ho w you've u sed the st ream.
  37004                      
  37005       </remarks>
  37006               
  37007      </member>
  37008              
  37009      <member 
  37010       name="T:Io nic.Crc.CR C32"
  37011      >
  37012                    
  37013       <summary>
  37014                       Comput es a CRC-3 2. The CRC -32 algori thm is par ameterized  - you
  37015                       can se t the poly nomial and  enable or  disable b it
  37016                       revers al. This c an be used  for GZIP,  BZip2, or  ZIP.
  37017                     
  37018       </summary>
  37019                    
  37020       <remarks>
  37021                       This t ype is use d internal ly by DotN etZip; it  is general ly not use d
  37022                       direct ly by appl ications w ishing to  create, re ad, or man ipulate zi p
  37023                       archiv e files.
  37024                     
  37025       </remarks>
  37026               
  37027      </member>
  37028              
  37029      <member 
  37030       name="M:Io nic.Crc.CR C32.GetCrc 32(System. IO.Stream) "
  37031      >
  37032                    
  37033       <summary>
  37034                     Returns  the CRC32  for the sp ecified st ream.
  37035                     
  37036       </summary>
  37037                    
  37038       <param 
  37039        name="inpu t"
  37040       >
  37041        The stream  over whic h to calcu late the C RC32
  37042       </param>
  37043                    
  37044       <returns>
  37045        the CRC32  calculatio n
  37046       </returns>
  37047               
  37048      </member>
  37049              
  37050      <member 
  37051       name="M:Io nic.Crc.CR C32.GetCrc 32AndCopy( System.IO. Stream,Sys tem.IO.Str eam)"
  37052      >
  37053                    
  37054       <summary>
  37055                     Returns  the CRC32  for the sp ecified st ream, and  writes the  input int o the
  37056                     output s tream.
  37057                     
  37058       </summary>
  37059                    
  37060       <param 
  37061        name="inpu t"
  37062       >
  37063        The stream  over whic h to calcu late the C RC32
  37064       </param>
  37065                    
  37066       <param 
  37067        name="outp ut"
  37068       >
  37069        The stream  into whic h to defla te the inp ut
  37070       </param>
  37071                    
  37072       <returns>
  37073        the CRC32  calculatio n
  37074       </returns>
  37075               
  37076      </member>
  37077              
  37078      <member 
  37079       name="M:Io nic.Crc.CR C32.Comput eCrc32(Sys tem.Int32, System.Byt e)"
  37080      >
  37081                    
  37082       <summary>
  37083                       Get th e CRC32 fo r the give n (word,by te) combo.   This is  a
  37084                       comput ation defi ned by PKz ip for PKZ IP 2.0 (we ak) encryp tion.
  37085                     
  37086       </summary>
  37087                    
  37088       <param 
  37089        name="W"
  37090       >
  37091        The word t o start wi th.
  37092       </param>
  37093                    
  37094       <param 
  37095        name="B"
  37096       >
  37097        The byte t o combine  it with.
  37098       </param>
  37099                    
  37100       <returns>
  37101        The CRC-iz ed result.
  37102       </returns>
  37103               
  37104      </member>
  37105              
  37106      <member 
  37107       name="M:Io nic.Crc.CR C32.SlurpB lock(Syste m.Byte[],S ystem.Int3 2,System.I nt32)"
  37108      >
  37109                    
  37110       <summary>
  37111                     Update t he value f or the run ning CRC32  using the  given blo ck of byte s.
  37112                     This is  useful whe n using th e CRC32()  class in a  Stream.
  37113                     
  37114       </summary>
  37115                    
  37116       <param 
  37117        name="bloc k"
  37118       >
  37119        block of b ytes to sl urp
  37120       </param>
  37121                    
  37122       <param 
  37123        name="offs et"
  37124       >
  37125        starting p oint in th e block
  37126       </param>
  37127                    
  37128       <param 
  37129        name="coun t"
  37130       >
  37131        how many b ytes withi n the bloc k to slurp
  37132       </param>
  37133               
  37134      </member>
  37135              
  37136      <member 
  37137       name="M:Io nic.Crc.CR C32.Update CRC(System .Byte)"
  37138      >
  37139                    
  37140       <summary>
  37141                       Proces s one byte  in the CR C.
  37142                     
  37143       </summary>
  37144                    
  37145       <param 
  37146        name = "b"
  37147       >
  37148        the byte t o include  into the C RC .  
  37149       </param>
  37150               
  37151      </member>
  37152              
  37153      <member 
  37154       name="M:Io nic.Crc.CR C32.Update CRC(System .Byte,Syst em.Int32)"
  37155      >
  37156                    
  37157       <summary>
  37158                       Proces s a run of  N identic al bytes i nto the CR C.
  37159                     
  37160       </summary>
  37161                    
  37162       <remarks>
  37163                       
  37164        <para>
  37165                          This  method se rves as an  optimizat ion for up dating the  CRC when  a
  37166                          run  of identic al bytes i s found. R ather than  passing i n a buffer  of
  37167                          leng th n, cont aining all  identical  bytes b,  this metho d accepts  the
  37168                          byte  value and  the lengt h of the ( virtual) b uffer - th e length o f
  37169                          the  run.
  37170                        
  37171        </para>
  37172                     
  37173       </remarks>
  37174                    
  37175       <param 
  37176        name = "b"
  37177       >
  37178        the byte t o include  into the C RC.  
  37179       </param>
  37180                    
  37181       <param 
  37182        name = "n"
  37183       >
  37184        the number  of times  that byte  should be  repeated. 
  37185       </param>
  37186               
  37187      </member>
  37188              
  37189      <member 
  37190       name="M:Io nic.Crc.CR C32.Combin e(System.I nt32,Syste m.Int32)"
  37191      >
  37192                    
  37193       <summary>
  37194                       Combin es the giv en CRC32 v alue with  the curren t running  total.
  37195                     
  37196       </summary>
  37197                    
  37198       <remarks>
  37199                       This i s useful w hen using  a divide-a nd-conquer  approach  to
  37200                       calcul ating a CR C.  Multip le threads  can each  calculate  a
  37201                       CRC32  on a segme nt of the  data, and  then combi ne the
  37202                       indivi dual CRC32  values at  the end.
  37203                     
  37204       </remarks>
  37205                    
  37206       <param 
  37207        name="crc"
  37208       >
  37209        the crc va lue to be  combined w ith this o ne
  37210       </param>
  37211                    
  37212       <param 
  37213        name="leng th"
  37214       >
  37215        the length  of data t he CRC val ue was cal culated on
  37216       </param>
  37217               
  37218      </member>
  37219              
  37220      <member 
  37221       name="M:Io nic.Crc.CR C32.#ctor"
  37222      >
  37223                    
  37224       <summary>
  37225                       Create  an instan ce of the  CRC32 clas s using th e default  settings:  no
  37226                       bit re versal, an d a polyno mial of 0x EDB88320.
  37227                     
  37228       </summary>
  37229               
  37230      </member>
  37231              
  37232      <member 
  37233       name="M:Io nic.Crc.CR C32.#ctor( System.Boo lean)"
  37234      >
  37235                    
  37236       <summary>
  37237                       Create  an instan ce of the  CRC32 clas s, specify ing whethe r to rever se
  37238                       data b its or not .
  37239                     
  37240       </summary>
  37241                    
  37242       <param 
  37243        name='reve rseBits'
  37244       >
  37245                       specif y true if  the instan ce should  reverse da ta bits.
  37246                     
  37247       </param>
  37248                    
  37249       <remarks>
  37250                       
  37251        <para>
  37252                          In t he CRC-32  used by BZ ip2, the b its are re versed. Th erefore if  you
  37253                          want  a CRC32 w ith compat ibility wi th BZip2,  you should  pass true
  37254                          here . In the C RC-32 used  by GZIP a nd PKZIP,  the bits a re not
  37255                          reve rsed; Ther efore if y ou want a  CRC32 with  compatibi lity with
  37256                          thos e, you sho uld pass f alse.
  37257                        
  37258        </para>
  37259                     
  37260       </remarks>
  37261               
  37262      </member>
  37263              
  37264      <member 
  37265       name="M:Io nic.Crc.CR C32.#ctor( System.Int 32,System. Boolean)"
  37266      >
  37267                     
  37268       <summary>
  37269                        Creat e an insta nce of the  CRC32 cla ss, specif ying the p olynomial  and
  37270                        wheth er to reve rse data b its or not .
  37271                      
  37272       </summary>
  37273                     
  37274       <param 
  37275        name='poly nomial'
  37276       >
  37277                        The p olynomial  to use for  the CRC,  expressed  in the rev ersed (LSB )
  37278                        forma t: the hig hest order ed bit in  the polyno mial value  is the
  37279                        coeff icient of  the 0th po wer; the s econd-high est order  bit is the
  37280                        coeff icient of  the 1 powe r, and so  on. Expres sed this w ay, the
  37281                        polyn omial for  the CRC-32 C used in  IEEE 802.3 , is 0xEDB 88320.
  37282                      
  37283       </param>
  37284                     
  37285       <param 
  37286        name='reve rseBits'
  37287       >
  37288                        speci fy true if  the insta nce should  reverse d ata bits.
  37289                      
  37290       </param>
  37291                    
  37292                     
  37293       <remarks>
  37294                        
  37295        <para>
  37296                           In  the CRC-32  used by B Zip2, the  bits are r eversed. T herefore i f you
  37297                           wan t a CRC32  with compa tibility w ith BZip2,  you shoul d pass tru e
  37298                           her e for the 
  37299         <c>
  37300          reverseBit s
  37301         </c>
  37302          parameter . In the C RC-32 used  by
  37303                           GZI P and PKZI P, the bit s are not  reversed;  Therefore  if you wan t a
  37304                           CRC 32 with co mpatibilit y with tho se, you sh ould pass  false for  the
  37305                           
  37306         <c>
  37307          reverseBit s
  37308         </c>
  37309          parameter .
  37310                         
  37311        </para>
  37312                      
  37313       </remarks>
  37314               
  37315      </member>
  37316              
  37317      <member 
  37318       name="M:Io nic.Crc.CR C32.Reset"
  37319      >
  37320                    
  37321       <summary>
  37322                       Reset  the CRC-32  class - c lear the C RC "remain der regist er."
  37323                     
  37324       </summary>
  37325                    
  37326       <remarks>
  37327                       
  37328        <para>
  37329                          Use  this when  employing  a single i nstance of  this clas s to compu te
  37330                          mult iple, dist inct CRCs  on multipl e, distinc t data blo cks.
  37331                        
  37332        </para>
  37333                     
  37334       </remarks>
  37335               
  37336      </member>
  37337              
  37338      <member 
  37339       name="P:Io nic.Crc.CR C32.TotalB ytesRead"
  37340      >
  37341                    
  37342       <summary>
  37343                       Indica tes the to tal number  of bytes  applied to  the CRC.
  37344                     
  37345       </summary>
  37346               
  37347      </member>
  37348              
  37349      <member 
  37350       name="P:Io nic.Crc.CR C32.Crc32R esult"
  37351      >
  37352                    
  37353       <summary>
  37354                     Indicate s the curr ent CRC fo r all bloc ks slurped  in.
  37355                     
  37356       </summary>
  37357               
  37358      </member>
  37359              
  37360      <member 
  37361       name="T:Io nic.Crc.Cr cCalculato rStream"
  37362      >
  37363                     
  37364       <summary>
  37365                      A Strea m that cal culates a  CRC32 (a c hecksum) o n all byte s read,
  37366                      or on a ll bytes w ritten.
  37367                      
  37368       </summary>
  37369                    
  37370                     
  37371       <remarks>
  37372                      
  37373        <para>
  37374                       This cl ass can be  used to v erify the  CRC of a Z ipEntry wh en
  37375                       reading  from a st ream, or t o calculat e a CRC wh en writing  to a
  37376                       stream.   The stre am should  be used to  either re ad, or wri te, but
  37377                       not bot h.  If you  intermix  reads and  writes, th e results  are not
  37378                       defined .
  37379                       
  37380        </para>
  37381                     
  37382                      
  37383        <para>
  37384                       This cl ass is int ended prim arily for  use intern ally by th e
  37385                       DotNetZ ip library .
  37386                       
  37387        </para>
  37388                      
  37389       </remarks>
  37390               
  37391      </member>
  37392              
  37393      <member 
  37394       name="M:Io nic.Crc.Cr cCalculato rStream.#c tor(System .IO.Stream )"
  37395      >
  37396                    
  37397       <summary>
  37398                     The defa ult constr uctor.
  37399                     
  37400       </summary>
  37401                    
  37402       <remarks>
  37403                       
  37404        <para>
  37405                          Inst ances retu rned from  this const ructor wil l leave th e underlyi ng
  37406                          stre am open up on Close() .  The str eam uses t he default  CRC32
  37407                          algo rithm, whi ch implies  a polynom ial of 0xE DB88320.
  37408                        
  37409        </para>
  37410                     
  37411       </remarks>
  37412                    
  37413       <param 
  37414        name="stre am"
  37415       >
  37416        The underl ying strea m
  37417       </param>
  37418               
  37419      </member>
  37420              
  37421      <member 
  37422       name="M:Io nic.Crc.Cr cCalculato rStream.#c tor(System .IO.Stream ,System.Bo olean)"
  37423      >
  37424                    
  37425       <summary>
  37426                       The co nstructor  allows the  caller to  specify h ow to hand le the
  37427                       underl ying strea m at close .
  37428                     
  37429       </summary>
  37430                    
  37431       <remarks>
  37432                       
  37433        <para>
  37434                          The  stream use s the defa ult CRC32  algorithm,  which imp lies a
  37435                          poly nomial of  0xEDB88320 .
  37436                        
  37437        </para>
  37438                     
  37439       </remarks>
  37440                    
  37441       <param 
  37442        name="stre am"
  37443       >
  37444        The underl ying strea m
  37445       </param>
  37446                    
  37447       <param 
  37448        name="leav eOpen"
  37449       >
  37450        true to le ave the un derlying s tream
  37451                     open upo n close of  the 
  37452        <c>
  37453         CrcCalcula torStream
  37454        </c>
  37455        ; false ot herwise.
  37456       </param>
  37457               
  37458      </member>
  37459              
  37460      <member 
  37461       name="M:Io nic.Crc.Cr cCalculato rStream.#c tor(System .IO.Stream ,System.In t64)"
  37462      >
  37463                    
  37464       <summary>
  37465                       A cons tructor al lowing the  specifica tion of th e length o f the stre am
  37466                       to rea d.
  37467                     
  37468       </summary>
  37469                    
  37470       <remarks>
  37471                       
  37472        <para>
  37473                          The  stream use s the defa ult CRC32  algorithm,  which imp lies a
  37474                          poly nomial of  0xEDB88320 .
  37475                        
  37476        </para>
  37477                       
  37478        <para>
  37479                          Inst ances retu rned from  this const ructor wil l leave th e underlyi ng
  37480                          stre am open up on Close() .
  37481                        
  37482        </para>
  37483                     
  37484       </remarks>
  37485                    
  37486       <param 
  37487        name="stre am"
  37488       >
  37489        The underl ying strea m
  37490       </param>
  37491                    
  37492       <param 
  37493        name="leng th"
  37494       >
  37495        The length  of the st ream to sl urp
  37496       </param>
  37497               
  37498      </member>
  37499              
  37500      <member 
  37501       name="M:Io nic.Crc.Cr cCalculato rStream.#c tor(System .IO.Stream ,System.In t64,System .Boolean)"
  37502      >
  37503                    
  37504       <summary>
  37505                       A cons tructor al lowing the  specifica tion of th e length o f the stre am
  37506                       to rea d, as well  as whethe r to keep  the underl ying strea m open upo n
  37507                       Close( ).
  37508                     
  37509       </summary>
  37510                    
  37511       <remarks>
  37512                       
  37513        <para>
  37514                          The  stream use s the defa ult CRC32  algorithm,  which imp lies a
  37515                          poly nomial of  0xEDB88320 .
  37516                        
  37517        </para>
  37518                     
  37519       </remarks>
  37520                    
  37521       <param 
  37522        name="stre am"
  37523       >
  37524        The underl ying strea m
  37525       </param>
  37526                    
  37527       <param 
  37528        name="leng th"
  37529       >
  37530        The length  of the st ream to sl urp
  37531       </param>
  37532                    
  37533       <param 
  37534        name="leav eOpen"
  37535       >
  37536        true to le ave the un derlying s tream
  37537                     open upo n close of  the 
  37538        <c>
  37539         CrcCalcula torStream
  37540        </c>
  37541        ; false ot herwise.
  37542       </param>
  37543               
  37544      </member>
  37545              
  37546      <member 
  37547       name="M:Io nic.Crc.Cr cCalculato rStream.#c tor(System .IO.Stream ,System.In t64,System .Boolean,I onic.Crc.C RC32)"
  37548      >
  37549                    
  37550       <summary>
  37551                       A cons tructor al lowing the  specifica tion of th e length o f the stre am
  37552                       to rea d, as well  as whethe r to keep  the underl ying strea m open upo n
  37553                       Close( ), and the  CRC32 ins tance to u se.
  37554                     
  37555       </summary>
  37556                    
  37557       <remarks>
  37558                       
  37559        <para>
  37560                          The  stream use s the spec ified CRC3 2 instance , which al lows the
  37561                          appl ication to  specify h ow the CRC  gets calc ulated.
  37562                        
  37563        </para>
  37564                     
  37565       </remarks>
  37566                    
  37567       <param 
  37568        name="stre am"
  37569       >
  37570        The underl ying strea m
  37571       </param>
  37572                    
  37573       <param 
  37574        name="leng th"
  37575       >
  37576        The length  of the st ream to sl urp
  37577       </param>
  37578                    
  37579       <param 
  37580        name="leav eOpen"
  37581       >
  37582        true to le ave the un derlying s tream
  37583                     open upo n close of  the 
  37584        <c>
  37585         CrcCalcula torStream
  37586        </c>
  37587        ; false ot herwise.
  37588       </param>
  37589                    
  37590       <param 
  37591        name="crc3 2"
  37592       >
  37593        the CRC32  instance t o use to c alculate t he CRC32
  37594       </param>
  37595               
  37596      </member>
  37597              
  37598      <member 
  37599       name="M:Io nic.Crc.Cr cCalculato rStream.Re ad(System. Byte[],Sys tem.Int32, System.Int 32)"
  37600      >
  37601                    
  37602       <summary>
  37603                     Read fro m the stre am
  37604                     
  37605       </summary>
  37606                    
  37607       <param 
  37608        name="buff er"
  37609       >
  37610        the buffer  to read
  37611       </param>
  37612                    
  37613       <param 
  37614        name="offs et"
  37615       >
  37616        the offset  at which  to start
  37617       </param>
  37618                    
  37619       <param 
  37620        name="coun t"
  37621       >
  37622        the number  of bytes  to read
  37623       </param>
  37624                    
  37625       <returns>
  37626        the number  of bytes  actually r ead
  37627       </returns>
  37628               
  37629      </member>
  37630              
  37631      <member 
  37632       name="M:Io nic.Crc.Cr cCalculato rStream.Wr ite(System .Byte[],Sy stem.Int32 ,System.In t32)"
  37633      >
  37634                    
  37635       <summary>
  37636                     Write to  the strea m.
  37637                     
  37638       </summary>
  37639                    
  37640       <param 
  37641        name="buff er"
  37642       >
  37643        the buffer  from whic h to write
  37644       </param>
  37645                    
  37646       <param 
  37647        name="offs et"
  37648       >
  37649        the offset  at which  to start w riting
  37650       </param>
  37651                    
  37652       <param 
  37653        name="coun t"
  37654       >
  37655        the number  of bytes  to write
  37656       </param>
  37657               
  37658      </member>
  37659              
  37660      <member 
  37661       name="M:Io nic.Crc.Cr cCalculato rStream.Fl ush"
  37662      >
  37663                    
  37664       <summary>
  37665                     Flush th e stream.
  37666                     
  37667       </summary>
  37668               
  37669      </member>
  37670              
  37671      <member 
  37672       name="M:Io nic.Crc.Cr cCalculato rStream.Se ek(System. Int64,Syst em.IO.Seek Origin)"
  37673      >
  37674                    
  37675       <summary>
  37676                     Seeking  is not sup ported on  this strea m. This me thod alway s throws
  37677                     
  37678        <see 
  37679         cref="T:Sy stem.NotSu pportedExc eption"
  37680        />
  37681                     
  37682       </summary>
  37683                    
  37684       <param 
  37685        name="offs et"
  37686       >
  37687        N/A
  37688       </param>
  37689                    
  37690       <param 
  37691        name="orig in"
  37692       >
  37693        N/A
  37694       </param>
  37695                    
  37696       <returns>
  37697        N/A
  37698       </returns>
  37699               
  37700      </member>
  37701              
  37702      <member 
  37703       name="M:Io nic.Crc.Cr cCalculato rStream.Se tLength(Sy stem.Int64 )"
  37704      >
  37705                    
  37706       <summary>
  37707                     This met hod always  throws
  37708                     
  37709        <see 
  37710         cref="T:Sy stem.NotSu pportedExc eption"
  37711        />
  37712                     
  37713       </summary>
  37714                    
  37715       <param 
  37716        name="valu e"
  37717       >
  37718        N/A
  37719       </param>
  37720               
  37721      </member>
  37722              
  37723      <member 
  37724       name="M:Io nic.Crc.Cr cCalculato rStream.Cl ose"
  37725      >
  37726                    
  37727       <summary>
  37728                     Closes t he stream.
  37729                     
  37730       </summary>
  37731               
  37732      </member>
  37733              
  37734      <member 
  37735       name="P:Io nic.Crc.Cr cCalculato rStream.To talBytesSl urped"
  37736      >
  37737                     
  37738       <summary>
  37739                        Gets  the total  number of  bytes run  through th e CRC32 ca lculator.
  37740                      
  37741       </summary>
  37742                    
  37743                     
  37744       <remarks>
  37745                        This  is either  the total  number of  bytes read , or the t otal numbe r of
  37746                        bytes  written,  depending  on the dir ection of  this strea m.
  37747                      
  37748       </remarks>
  37749               
  37750      </member>
  37751              
  37752      <member 
  37753       name="P:Io nic.Crc.Cr cCalculato rStream.Cr c"
  37754      >
  37755                    
  37756       <summary>
  37757                       Provid es the cur rent CRC f or all blo cks slurpe d in.
  37758                     
  37759       </summary>
  37760                    
  37761       <remarks>
  37762                       
  37763        <para>
  37764                          The  running to tal of the  CRC is ke pt as data  is writte n or read
  37765                          thro ugh the st ream.  rea d this pro perty afte r all read s or write s to
  37766                          get  an accurat e CRC for  the entire  stream.
  37767                        
  37768        </para>
  37769                     
  37770       </remarks>
  37771               
  37772      </member>
  37773              
  37774      <member 
  37775       name="P:Io nic.Crc.Cr cCalculato rStream.Le aveOpen"
  37776      >
  37777                    
  37778       <summary>
  37779                       Indica tes whethe r the unde rlying str eam will b e left ope n when the
  37780                       
  37781        <c>
  37782         CrcCalcula torStream
  37783        </c>
  37784         is Closed .
  37785                     
  37786       </summary>
  37787                    
  37788       <remarks>
  37789                       
  37790        <para>
  37791                          Set  this at an y point be fore calli ng 
  37792         <see 
  37793          cref="M:Io nic.Crc.Cr cCalculato rStream.Cl ose"
  37794         />
  37795         .
  37796                        
  37797        </para>
  37798                     
  37799       </remarks>
  37800               
  37801      </member>
  37802              
  37803      <member 
  37804       name="P:Io nic.Crc.Cr cCalculato rStream.Ca nRead"
  37805      >
  37806                    
  37807       <summary>
  37808                     Indicate s whether  the stream  supports  reading.
  37809                     
  37810       </summary>
  37811               
  37812      </member>
  37813              
  37814      <member 
  37815       name="P:Io nic.Crc.Cr cCalculato rStream.Ca nSeek"
  37816      >
  37817                    
  37818       <summary>
  37819                       Indica tes whethe r the stre am support s seeking.
  37820                     
  37821       </summary>
  37822                    
  37823       <remarks>
  37824                       
  37825        <para>
  37826                          Alwa ys returns  false.
  37827                        
  37828        </para>
  37829                     
  37830       </remarks>
  37831               
  37832      </member>
  37833              
  37834      <member 
  37835       name="P:Io nic.Crc.Cr cCalculato rStream.Ca nWrite"
  37836      >
  37837                    
  37838       <summary>
  37839                     Indicate s whether  the stream  supports  writing.
  37840                     
  37841       </summary>
  37842               
  37843      </member>
  37844              
  37845      <member 
  37846       name="P:Io nic.Crc.Cr cCalculato rStream.Le ngth"
  37847      >
  37848                    
  37849       <summary>
  37850                       Return s the leng th of the  underlying  stream.
  37851                     
  37852       </summary>
  37853               
  37854      </member>
  37855              
  37856      <member 
  37857       name="P:Io nic.Crc.Cr cCalculato rStream.Po sition"
  37858      >
  37859                    
  37860       <summary>
  37861                       The ge tter for t his proper ty returns  the total  bytes rea d.
  37862                       If you  use the s etter, it  will throw
  37863                     
  37864        <see 
  37865         cref="T:Sy stem.NotSu pportedExc eption"
  37866        />
  37867        .
  37868                     
  37869       </summary>
  37870               
  37871      </member>
  37872          
  37873     </members>
  37874   </doc>