code: public static void copy(InputStream input, OutputStream output) throws IOException {
          final byte[] buffer = new byte[4096];
          int read = 0;
          while ((read = input.read(buffer)) != -1) {
              output.write(buffer, 0, read);
          }
  
          output.flush();
      }
docs: Copies the contents from an InputStream to an OutputStream. It is the responsibility of the caller to close the
  streams passed in when done, though the {@link OutputStream} will be fully flushed.
  
  @param input
  @param output
  @throws IOException
  If a problem occurred during any I/O operations