Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More swig cleanup and refactor Added native address comparator and hasher for better performance
- Loading branch information
Showing
10 changed files
with
1,196 additions
and
504 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* ---------------------------------------------------------------------------- | ||
* This file was automatically generated by SWIG (http://www.swig.org). | ||
* Version 3.0.8 | ||
* | ||
* Do not make changes to this file unless you know what you are doing--modify | ||
* the SWIG interface file instead. | ||
* ----------------------------------------------------------------------------- */ | ||
|
||
package com.frostwire.jlibtorrent.swig; | ||
|
||
public class hasher { | ||
private transient long swigCPtr; | ||
protected transient boolean swigCMemOwn; | ||
|
||
protected hasher(long cPtr, boolean cMemoryOwn) { | ||
swigCMemOwn = cMemoryOwn; | ||
swigCPtr = cPtr; | ||
} | ||
|
||
protected static long getCPtr(hasher obj) { | ||
return (obj == null) ? 0 : obj.swigCPtr; | ||
} | ||
|
||
protected void finalize() { | ||
delete(); | ||
} | ||
|
||
public synchronized void delete() { | ||
if (swigCPtr != 0) { | ||
if (swigCMemOwn) { | ||
swigCMemOwn = false; | ||
libtorrent_jni.delete_hasher(swigCPtr); | ||
} | ||
swigCPtr = 0; | ||
} | ||
} | ||
|
||
public hasher() { | ||
this(libtorrent_jni.new_hasher__SWIG_0(), true); | ||
} | ||
|
||
public sha1_hash final_hash() { | ||
return new sha1_hash(libtorrent_jni.hasher_final_hash(swigCPtr, this), true); | ||
} | ||
|
||
public void reset() { | ||
libtorrent_jni.hasher_reset(swigCPtr, this); | ||
} | ||
|
||
public hasher(byte_vector data) { | ||
this(libtorrent_jni.new_hasher__SWIG_1(byte_vector.getCPtr(data), data), true); | ||
} | ||
|
||
public hasher update(byte_vector data) { | ||
return new hasher(libtorrent_jni.hasher_update(swigCPtr, this, byte_vector.getCPtr(data), data), false); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.