jdk/test/java/util/zip/ZipFile/Assortment.java
changeset 8553 46c2babb1e44
parent 5506 202f599c92aa
child 9035 1255eb81cc2f
equal deleted inserted replaced
8552:f36470084574 8553:46c2babb1e44
   199                                                   toExtra(extra), comment));
   199                                                   toExtra(extra), comment));
   200 
   200 
   201         //----------------------------------------------------------------
   201         //----------------------------------------------------------------
   202         // Write zip file using ZipOutputStream
   202         // Write zip file using ZipOutputStream
   203         //----------------------------------------------------------------
   203         //----------------------------------------------------------------
   204         ZipOutputStream zos = new ZipOutputStream(
   204         try (FileOutputStream fos = new FileOutputStream(zipName);
   205             new FileOutputStream(zipName));
   205              ZipOutputStream zos = new ZipOutputStream(fos))
   206 
   206         {
   207         for (Entry e : entries)
   207             for (Entry e : entries)
   208             e.write(zos);
   208                 e.write(zos);
   209 
   209         }
   210         zos.close();
       
   211 
   210 
   212         //----------------------------------------------------------------
   211         //----------------------------------------------------------------
   213         // Verify zip file contents using JarFile class
   212         // Verify zip file contents using JarFile class
   214         //----------------------------------------------------------------
   213         //----------------------------------------------------------------
   215         JarFile f = new JarFile(zipName);
   214         JarFile f = new JarFile(zipName);