code: public TorrentHandle addTorrent(AddTorrentParams params, ErrorCode ec) {
          error_code e = new error_code();
          TorrentHandle th = new TorrentHandle(s.add_torrent(params.swig(), e));
          ec.assign(e);
          return th;
      }
docs: You add torrents through the {@link #addTorrent(AddTorrentParams, ErrorCode)}
  function where you give an object with all the parameters.
  The {@code addTorrent} overloads will block
  until the torrent has been added (or failed to be added) and returns
  an error code and a {@link TorrentHandle}. In order to add torrents more
  efficiently, consider using {@link #asyncAddTorrent(AddTorrentParams)}
  which returns immediately, without waiting for the torrent to add.
  Notification of the torrent being added is sent as
  {@link com.frostwire.jlibtorrent.alerts.AddTorrentAlert}.
  <p>
  The {@link TorrentHandle} returned by this method can be used to retrieve
  information about the torrent's progress, its peers etc. It is also
  used to abort a torrent.
  <p>
  If the torrent you are trying to add already exists in the session (is
  either queued for checking, being checked or downloading)
  the error code will be set to {@link libtorrent_errors#duplicate_torrent}
  unless {@code flag_duplicate_is_error}
  is set to false. In that case, {@code addTorrent} will return the handle
  to the existing torrent.
  <p>
  All torrent handles must be destructed before the session is destructed!
  
  @param params the parameters to create the torrent download
  @param ec     the error code if no torrent handle was created
  @return the torrent handle, could be invalid