title: Inconsistency between ZipEntry size for ZipInputStream and JarInputStream
body: <p>I have bunch of image files in a zip file which I am reading using ZipInputStream and Iterating over ZipEntry from an Applet.</p>
  
  <pre><code>   ZipInputStream zis = new ZipInputStream(in);
          ZipEntry ze = null;
          while ((ze = zis.getNextEntry()) != null) {
              htSizes.put(ze.getName(), new Integer((int) ze.getSize()));
              if (ze.isDirectory()) {
                  continue;
              }
              int size = (int) ze.getSize();
              // -1 means unknown size.
              if (size == -1) {
                  size = ((Integer) htSizes.get(ze.getName())).intValue();
              }
              byte[] b = new byte[(int) size];
              int rb = 0;
              int chunk = 0;
              while (((int) size - rb) &gt; 0) {
                  chunk = zis.read(b, rb, (int) size - rb);
                  if (chunk == -1) {
                      break;
                  }
                  rb += chunk;
              }
              // add to internal resource hashtable
              htJarContents.put(ze.getName(), b);
          }
  </code></pre>
  
  <p>However when I put these images into a signed jar "<code>ze.getSize()</code>" is coming as -1, and image file is getting read incorrectly.</p>
  
  <p>Can someone help me in this regards.</p>