code: protected void write(InputStream source, OutputStream destination, int bufferSize) throws IOException {
      if (source == null || destination == null) {
        throw new IllegalArgumentException("Must provide non-null source and destination streams.");
      }
  
      int read;
      byte[] chunk = new byte[bufferSize];
      while ((read = source.read(chunk)) > 0)
        destination.write(chunk, 0, read);
    }
docs: Writes the contents of the {@code source} stream to the {@code destination} stream using the given
  {@code bufferSize}.
  
  @param source
  The source stream to copy from.
  @param destination
  The destination stream to copy to.
  @param bufferSize
  The size of the buffer to use during the copy operation.
  @throws IOException
  If an error occurs when reading from {@code source} or writing to {@code destination}.
  @throws NullPointerException
  If either {@code source} or @{code destination} is {@code null}.