code: public static void copyTo(InputStream in, OutputStream out) throws IOException {
          Objects.requireNonNull(in);
          Objects.requireNonNull(out);
  
          int r;
          while ((r = in.read()) != -1) {
              out.write(r);
          }
  
          out.flush();
      }
docs: Copies all remaining bytes from {@code in} to {@code out}. The {@code out} will be flushed.
  <p>
  Note that method does not make any buffering, so caller must ensure that streams are buffered if needed.
  
  @param in  The input source.
  @param out The output destination.
  
  @throws IOException When any I/O error occurred.