code: public static void decompressChunks(InputStream inputStream, Path tempFileOut) throws IOException {
          try (BufferedWriter writer = Files.newBufferedWriter(tempFileOut)) {
              try (GZIPInputStream chunkZipper = new GZIPInputStream(inputStream);
                   InputStream in = new BufferedInputStream(chunkZipper);) {
                  byte[] buffer = new byte[BYTES_BUFFER_SIZE];
                  int len;
                  while ((len = in.read(buffer)) > 0) {
                      byte[] writtenBytes = new byte[len];
                      getBytes(buffer, 0, len, writtenBytes, 0);
                      String val = new String(writtenBytes, StandardCharsets.UTF_8);
                      writer.write(val);
                  }
              }
          }
      }
docs: The method decompresses the big strings using gzip - low memory via the File system
  
  @param inputStream
  @param tempFileOut
  @throws IOException