title: Not able to process big file inside a zip file using ZipInputStream
body: <p>I am having a below mentioned java class which extracts a zip, and one by one convert its content to string and print to console.
  <br>Problem is, when the file present inside the zip is big ~80KB. Entire content is not getting displayed (only 3/4 of the data is getting converted to string and displayed in console).
  <br> Secondly below mentioned code is introducing null/space in between and also if the file size is small ~1KB</p>
  
  <p>what is wrong in below mentioned code.  </p>
  
  <pre><code> public static void main(String[] args) throws Exception {
      byte[] buf = new byte[1024];
      final int BUFFER = 1024;
      String fName = "c:\\DOC00001.zip";
      ZipInputStream zinstream = new ZipInputStream(
              new FileInputStream(fName));
      ZipEntry zentry = zinstream.getNextEntry();
  
      while (zentry != null) {            
      byte data[] = new byte[BUFFER];
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      while ((zinstream.read(data, 0, BUFFER)) != -1) {
          out.write(data);
      }       
      InputStream is = new ByteArrayInputStream(out.toByteArray());
      StringWriter writer = new StringWriter();
      IOUtils.copy(is, writer, "UTF-8");
      String response = writer.toString();
      System.out.println(response);
      zentry = zinstream.getNextEntry();
      }
      zinstream.close();
  }
  </code></pre>