title: Java zip.close() hangs
body: <p>I am trying to add two small files to a zip, as that is the format the destination requires. Both files are less than 1000kb but when I run my code, the program hangs indefinitely during zip.close(), no errors.
  What am I doing wrong?</p>
  
  <pre><code>val is = new PipedInputStream()
  val os = new PipedOutputStream(is)
  val cos = new CountingOutputStream(os)
  val zip = new ZipOutputStream(cos)
  
  val fis = new FileInputStream(file)
  zip.putNextEntry(new ZipEntry(location))
  var i = 0
  while(i != -1) {
    zip.write(i)
    i = fis.read()
  }
  zip.closeEntry()
  fis.close()
  zip.close()
  </code></pre>