title: How does GZIP decompression work in chunks?
body: <p>I am using GZIP compression to compress the file. Consider the code snippet for decompressing</p>
  
  <pre><code>public static void decompress(File compressed, File raw)
      throws IOException
  {
      InputStream in =
          new GZIPInputStream(new FileInputStream(compressed));
      OutputStream out = new FileOutputStream(raw);
      byte[] buffer = new byte[1000];
      int len;
      while((len = in.read(buffer)) &gt; 0) {
          out.write(buffer, 0, len);
      }
      in.close();
      out.close();
  }
  </code></pre>
  
  <p>Please clarify me the following</p>
  
  <ol>
  <li>Will this decompress the file in chunks (ie; decompress the file content which is read in the buffer only)</li>
  <li>Will this be same as decompressing the entire file (ie; by providing very large buffer size). If so how? </li>
  <li>How many bytes are read by GZIP algorithm to compress/decompress for a single turn? Will this read by bytes or will GZIP read the entire content in buffer to compress/decompress?</li>
  <li>Compression rate between file compressed in chunks and entire file?</li>
  </ol>