code: private void streamContent(HttpServletResponse response, InputStream is) throws IOException {
  
          OutputStream os = response.getOutputStream();
          try {
              byte buffer[] = new byte[DEFAULT_BUFFER_SIZE];
              int bytes;
              while ((bytes = is.read(buffer)) >= 0) {
                  os.write(buffer, 0, bytes);
              }
          } finally {
              os.close();
          }
      }
docs: Streams the input stream to the response.<p>
  
  @param response the response
  @param is the input stream
  
  @throws IOException in case writing to the response fails