Skip to content

Commit

Permalink
Session API and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aldenml committed Feb 5, 2016
1 parent 00fc53a commit f673ea1
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions src/main/java/com/frostwire/jlibtorrent/Session.java
Expand Up @@ -390,19 +390,29 @@ public boolean isListening() {
}

/**
* Loads and saves all session settings, including dht_settings,
* encryption settings and proxy settings. ``save_state`` writes all keys
* to the ``entry`` that's passed in, which needs to either not be
* initialized, or initialized as a dictionary.
* Loads and saves all session settings, including dht settings,
* encryption settings and proxy settings. {@link #saveState()}
* internally writes all keys to an {@link entry} that's passed in,
* which needs to either not be initialized, or initialized as a dictionary.
* <p/>
* ``load_state`` expects a lazy_entry which can be built from a bencoded
* buffer with lazy_bdecode().
* <p/>
* The ``flags`` arguments passed in to ``save_state`` can be used to
* The {@code flags} arguments passed in to this method can be used to
* filter which parts of the session state to save. By default, all state
* is saved (except for the individual torrents). see save_state_flags_t
* is saved (except for the individual torrents).
* See {@link com.frostwire.jlibtorrent.swig.session_handle.save_state_flags_t}
*
* @return
*/
public byte[] saveState(long flags) {
entry e = new entry();
s.save_state(e);
return Vectors.byte_vector2bytes(e.bencode());
}

/**
* Same as calling {@link #saveState(long)} with all save state flags.
*
* @return
* @see #saveState(long)
*/
public byte[] saveState() {
entry e = new entry();
Expand Down

0 comments on commit f673ea1

Please sign in to comment.