title: zip file is being create but without any files in it
body: <p>i copied this code directly from oracle website. i have two .png file inside d:\barcode. while i run this code myfigs.zip is created in d: drive but it is corruped and 0kb size.</p>
  
  <p>code:-</p>
  
  <pre><code>public class Zip {
  static final int BUFFER = 2048;
  public static void main (String argv[]) {
      try {
          BufferedInputStream origin = null;
          FileOutputStream dest = new
                  FileOutputStream("D:\\myfigs.zip");
          CheckedOutputStream checksum = new
                  CheckedOutputStream(dest, new Adler32());
          ZipOutputStream out = new
                  ZipOutputStream(new
                  BufferedOutputStream(checksum));
          //out.setMethod(ZipOutputStream.DEFLATED);
          byte data[] = new byte[BUFFER];
          // get a list of files from current directory
          File f = new File("D:\\barcode");
          String files[] = f.list();
  
          for (int i=0; i&lt;files.length; i++) {
              System.out.println("Adding: "+files[i]);
              FileInputStream fi = new FileInputStream(files[i]);
              origin = new BufferedInputStream(fi, BUFFER);
              ZipEntry entry = new ZipEntry(files[i]);
              out.putNextEntry(entry);
              int count;
              while((count = origin.read(data, 0,
                      BUFFER)) != -1) {
                  out.write(data, 0, count);
              }
              origin.close();
          }
          out.close();
          System.out.println("checksum: "+checksum.getChecksum().getValue());
      } catch(Exception e) {
          e.printStackTrace();
      }
  }
  }
  </code></pre>
  
  <p>to add more information whenever i run the code in debug mode code is successfully compiled to FileInputStream fi line then it is stopped there. the error thrown is </p>
  
  <pre><code>java.io.FileNotFoundException: barcode.png (The system cannot find the file    specified)
  Adding: barcode.png
  at java.io.FileInputStream.open0(Native Method)
  at java.io.FileInputStream.open(FileInputStream.java:195)
  at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:138)
  at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:93)
  </code></pre>