code: public static void streamCopy(final URL url, final FileChannel out,
          final ProgressBar progressBar) throws IOException {
          NullArgumentException.validateNotNull(url, "URL");
          InputStream is = null;
          try {
              is = url.openStream();
              streamCopy(is, out, progressBar);
          }
          finally {
              if (is != null) {
                  is.close();
              }
          }
  
      }
docs: Copy a stream from an urlto a destination.
  
  @param url
  the url to copy from
  @param out
  the stream to copy to
  @param progressBar
  download progress feedback. Can be null.
  
  @throws IOException
  re-thrown