mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-10-23 02:12:54 +00:00
i2psnark: Restore 2-arg getNameAndInfoHash()
used by i2psnark-rpc plugin
This commit is contained in:
1 file changed
+13
-1
@@ -430,6 +430,18 @@ public class MetaInfo
|
||||
info_hash = calculateInfoHash();
|
||||
}
|
||||
|
||||
/**
|
||||
* Efficiently returns the name and the 20 byte SHA1 hash of the info dictionary in a torrent file.
|
||||
* Caller must close stream.
|
||||
* Unused within snark, used by i2psnark-rpc plugin.
|
||||
*
|
||||
* @param infoHashOut 20-byte out parameter
|
||||
* @since 0.8.5
|
||||
*/
|
||||
public static String getNameAndInfoHash(InputStream in, byte[] infoHashOut) throws IOException {
|
||||
return getNameAndInfoHash(in, infoHashOut, new AtomicLong());
|
||||
}
|
||||
|
||||
/**
|
||||
* Efficiently returns the name and the 20 byte SHA1 hash of the info dictionary in a torrent file,
|
||||
* and approximate total length.
|
||||
@@ -437,7 +449,7 @@ public class MetaInfo
|
||||
*
|
||||
* @param infoHashOut 20-byte out parameter
|
||||
* @param lengthOut out parameter approximate, not exact
|
||||
* @since 0.8.5
|
||||
* @since 0.9.71
|
||||
*/
|
||||
public static String getNameAndInfoHash(InputStream in, byte[] infoHashOut, AtomicLong lengthOut) throws IOException {
|
||||
BDecoder bd = new BDecoder(in);
|
||||
|
||||
Reference in new issue
Block a user